From 463def8b0c6bee3d5097fc3f68c91b684452a664 Mon Sep 17 00:00:00 2001 From: peterbolha Date: Tue, 24 Oct 2023 11:09:55 +0200 Subject: [PATCH] Replace wrapper with direct check in validator --- src/idpyoidc/server/oauth2/authorization.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/idpyoidc/server/oauth2/authorization.py b/src/idpyoidc/server/oauth2/authorization.py index 42db0b4b..07e4227d 100755 --- a/src/idpyoidc/server/oauth2/authorization.py +++ b/src/idpyoidc/server/oauth2/authorization.py @@ -285,10 +285,7 @@ def check_unknown_scopes_policy(request_info, client_id, context): def validate_resource_indicators_policy(request, context, **kwargs): if "resource" not in request: - return oauth2.AuthorizationErrorResponse( - error="invalid_target", - error_description="Missing resource parameter", - ) + return request resource_servers_per_client = kwargs["resource_servers_per_client"] client_id = request["client_id"] @@ -332,11 +329,6 @@ def validate_resource_indicators_policy(request, context, **kwargs): request["scope"] = scopes return request -def optional_validate_resource_indicators_policy(request, context, **kwargs): - if "resource" not in request: - return request - - return validate_resource_indicators_policy(request, context, **kwargs) class Authorization(Endpoint): request_cls = oauth2.AuthorizationRequest