Add OAuth2 API scope registration and enforcement
Register v1 API scopes in coredata, advertise them in OIDC discovery and protected-resource metadata, show them on the consent screen, and enforce scope-to-action mapping in the IAM Authorizer before policy evaluation. Signed-off-by: Ludovic Vielle <ludovic@probo.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"go.gearno.de/kit/log"
|
||||
"go.probo.inc/probo/pkg/bearertoken"
|
||||
"go.probo.inc/probo/pkg/iam"
|
||||
"go.probo.inc/probo/pkg/iam/oauth2"
|
||||
)
|
||||
|
||||
func NewOAuth2AccessTokenMiddleware(svc *iam.Service) func(next http.Handler) http.Handler {
|
||||
@@ -53,6 +54,7 @@ func NewOAuth2AccessTokenMiddleware(svc *iam.Service) func(next http.Handler) ht
|
||||
}
|
||||
|
||||
ctx = ContextWithIdentity(ctx, identity)
|
||||
ctx = oauth2.ContextWithAccessToken(ctx, accessToken)
|
||||
|
||||
httpserver.LoggerFromContext(ctx).InfoCtx(
|
||||
ctx,
|
||||
|
||||
Reference in New Issue
Block a user