From 09aed77f431597203dc66fb05a8757d26530be8e Mon Sep 17 00:00:00 2001 From: James Elson Date: Tue, 11 Jul 2023 13:47:42 -0700 Subject: [PATCH] Check for case sensitivity in map_res_name_to_id function --- microservices/gatewayApi/clients/uma/resourceset.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/microservices/gatewayApi/clients/uma/resourceset.py b/microservices/gatewayApi/clients/uma/resourceset.py index 8e72a43..e65a6d2 100644 --- a/microservices/gatewayApi/clients/uma/resourceset.py +++ b/microservices/gatewayApi/clients/uma/resourceset.py @@ -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, @@ -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']