Skip to content

Commit

Permalink
Replace wrapper with direct check in validator
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBolha committed Oct 24, 2023
1 parent f235988 commit 463def8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/idpyoidc/server/oauth2/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 463def8

Please sign in to comment.