fixup! fixup! Downgrade gorilla sessions preventing the publishing by traefik hub temporarily.

This commit is contained in:
2024-11-06 14:43:13 +00:00
parent f77c804fad
commit f068d1092e
3 changed files with 75 additions and 78 deletions
+10
View File
@@ -65,6 +65,7 @@ type TraefikOidc struct {
initComplete chan struct{}
endSessionURL string
baseURL string
postLogoutRedirectURI string
}
// ProviderMetadata holds OIDC provider metadata
@@ -241,6 +242,7 @@ func New(ctx context.Context, next http.Handler, config *Config, name string) (h
allowedUserDomains: createStringMap(config.AllowedUserDomains),
allowedRolesAndGroups: createStringMap(config.AllowedRolesAndGroups),
initComplete: make(chan struct{}),
postLogoutRedirectURI: config.PostLogoutRedirectURI,
}
t.extractClaimsFunc = extractClaims
@@ -767,3 +769,11 @@ func (t *TraefikOidc) extractGroupsAndRoles(idToken string) ([]string, []string,
return groups, roles, nil
}
// buildFullURL constructs a full URL from scheme, host and path
func buildFullURL(scheme, host, path string) string {
if strings.HasPrefix(path, "http://") || strings.HasPrefix(path, "https://") {
return path
}
return fmt.Sprintf("%s://%s%s", scheme, host, path)
}