chore: drop "oidc_wellknown" tmpl, use json directly (#38731)

`testOAuth2WellKnown` already covers the endpoint's response.
This commit is contained in:
wxiaoguang
2026-07-31 18:32:01 +02:00
committed by GitHub
parent f0a95eebe3
commit 76a787a79d
9 changed files with 81 additions and 90 deletions
+6 -4
View File
@@ -74,16 +74,18 @@ type AccessTokenResponse struct {
IDToken string `json:"id_token,omitempty"`
}
// GrantAdditionalScopes returns valid scopes coming from grant
func GrantAdditionalScopes(grantScopes string) auth.AccessTokenScope {
// scopes_supported from templates/user/auth/oidc_wellknown.tmpl
generalScopesSupported := []string{
func GeneralScopesSupported() []string {
return []string{
"openid",
"profile",
"email",
"groups",
}
}
// GrantAdditionalScopes returns valid scopes coming from grant
func GrantAdditionalScopes(grantScopes string) auth.AccessTokenScope {
generalScopesSupported := GeneralScopesSupported()
var accessScopes []string // the scopes for access control, but not for general information
for scope := range strings.SplitSeq(grantScopes, " ") {
if scope != "" && !slices.Contains(generalScopesSupported, scope) {