check turn domain and port range (#90)
* check negative turn port * check turn domain * domain check test code
This commit is contained in:
@@ -3,6 +3,7 @@ package service
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"regexp"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
"github.com/google/wire"
|
||||
@@ -93,6 +94,11 @@ func boolValue(s string) bool {
|
||||
return s == "1" || s == "true"
|
||||
}
|
||||
|
||||
func IsValidDomain(domain string) bool {
|
||||
domainRegexp := regexp.MustCompile(`^(?i)[a-z0-9-]+(\.[a-z0-9-]+)+\.?$`)
|
||||
return domainRegexp.MatchString(domain)
|
||||
}
|
||||
|
||||
func permissionFromGrant(claim *auth.VideoGrant) *livekit.ParticipantPermission {
|
||||
p := &livekit.ParticipantPermission{
|
||||
CanSubscribe: true,
|
||||
|
||||
Reference in New Issue
Block a user