Skip to content

Commit

Permalink
stuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
MatMaul committed Aug 27, 2024
1 parent 064626c commit 1fdc6ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func exchangeOIDCToken(
return nil, errors.New("missing parameters in OIDC token")
}

log.Printf("allow list size: %v", len(homeserverAllowList))
if len(homeserverAllowList) > 0 {
for _, allowed_hs := range homeserverAllowList {
if allowed_hs == token.MatrixServerName {
Expand All @@ -78,6 +79,7 @@ func exchangeOIDCToken(
}
client := fclient.NewClient(fclient.WithWellKnownSRVLookups(true), fclient.WithSkipVerify(skipVerifyTLS))

log.Printf("lookup")
// validate the openid token by getting the user's ID
userinfo, err := client.LookupUserInfo(
ctx, spec.ServerName(token.MatrixServerName), token.AccessToken,
Expand Down Expand Up @@ -195,7 +197,10 @@ func main() {
secret := os.Getenv("LIVEKIT_SECRET")
lk_url := os.Getenv("LIVEKIT_URL")

homeserverAllowList := strings.Split(os.Getenv("HS_ALLOWLIST"), ",")
homeserverAllowList := []string{}
if os.Getenv("HS_ALLOWLIST") != "" {
homeserverAllowList = strings.Split(os.Getenv("HS_ALLOWLIST"), ",")
}

// Check if the key, secret or url are empty.
if key == "" || secret == "" || lk_url == "" {
Expand Down

0 comments on commit 1fdc6ce

Please sign in to comment.