1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Set resources payload as a list (#7563)

* Set resources payload as a list

* Update changelogs/fragments/7151-fix-keycloak_authz_permission-incorrect-resource-payload.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
fostermi 2023-11-22 11:03:15 -07:00 committed by GitHub
parent d530470d30
commit 09b9ea466f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- keycloak_authz_permission - resource payload variable for scope-based permission was constructed as a string, when it needs to be a list, even for a single item (https://github.com/ansible-collections/community.general/issues/7151).

View file

@ -330,7 +330,7 @@ def main():
if not r: if not r:
module.fail_json(msg='Unable to find authorization resource with name %s for client %s in realm %s' % (resources[0], cid, realm)) module.fail_json(msg='Unable to find authorization resource with name %s for client %s in realm %s' % (resources[0], cid, realm))
else: else:
payload['resources'] = r['_id'] payload['resources'].append(r['_id'])
for rs in r['scopes']: for rs in r['scopes']:
resource_scopes.append(rs['id']) resource_scopes.append(rs['id'])