Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for case sensitivity in map_res_name_to_id function #98

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions microservices/gatewayApi/clients/uma/resourceset.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def map_res_name_to_id (pat_token, name):

log = app.logger

tokenUrl = "%srealms/%s/authz/protection/resource_set?exactName=true&name=%s" % (conf['serverUrl'],conf['realm'], name)
tokenUrl = "%srealms/%s/authz/protection/resource_set?name=%s&deep=true" % (conf['serverUrl'],conf['realm'], name)

headers = {
"Authorization": "Bearer %s" % pat_token,
Expand All @@ -111,7 +111,7 @@ def map_res_name_to_id (pat_token, name):
log.debug("[map_res_name_to_id] %s" % r.status_code)
json = r.json()
log.debug("[map_res_name_to_id] %s" % json)
if len(json) == 0:
if len(json) == 0 or name != json[0]['name']:
return None
else:
return json[0]
return json[0]['_id']