fix: Update ScopesSupported to match RFC 9728 Section 2

This commit is contained in:
Alex Leach 2025-10-12 21:26:05 +01:00
parent 56d969b785
commit 8ca4bb4787
No known key found for this signature in database
GPG key ID: 46E1D1A0150DEEA3
5 changed files with 17 additions and 66 deletions

View file

@ -7,7 +7,6 @@ import (
"github.com/golang-jwt/jwt/v4"
"github.com/wso2/open-mcp-auth-proxy/internal/config"
"github.com/wso2/open-mcp-auth-proxy/internal/util"
)
type ScopeValidator struct{}
@ -18,11 +17,7 @@ func (d *ScopeValidator) ValidateAccess(
claims *jwt.MapClaims,
config *config.Config,
) AccessControlResult {
env, err := util.ParseRPCRequest(r)
if err != nil {
return AccessControlResult{DecisionDeny, "bad JSON-RPC request"}
}
requiredScopes := util.GetRequiredScopes(config, env)
requiredScopes := config.ProtectedResourceMetadata.ScopesSupported
if len(requiredScopes) == 0 {
return AccessControlResult{DecisionAllow, ""}