Skip to content

Commit

Permalink
Add support for docker-v2 protocol in Keycloak modules (#8216)
Browse files Browse the repository at this point in the history
* Add support for docker-v2 protocol in Keycloak modules

* use dash instead of underscore for the docker-v2

* Update documentation

* Add changelog fragment

* fix missing whitespace around operator

* Update changelogs/fragments/8215-add-docker-v2-protocol.yml

Update changelog fragment to reviewers suggestion, add refrence to issue and pull request

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

* Add documentation about adding docker-v2 value in community general 8.6.0

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
  • Loading branch information
anderssh and felixfontein committed Apr 20, 2024
1 parent 12b76ea commit a5b2b5c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/8215-add-docker-v2-protocol.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- keycloak_client, keycloak_clientscope, keycloak_clienttemplate - added ``docker-v2`` protocol support, enhancing alignment with Keycloak's protocol options (https://github.com/ansible-collections/community.general/issues/8215, https://github.com/ansible-collections/community.general/pull/8216).
10 changes: 6 additions & 4 deletions plugins/modules/keycloak_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@
description:
- Type of client.
- At creation only, default value will be V(openid-connect) if O(protocol) is omitted.
- The V(docker-v2) value was added in community.general 8.6.0.
type: str
choices: ['openid-connect', 'saml']
choices: ['openid-connect', 'saml', 'docker-v2']
full_scope_allowed:
description:
Expand Down Expand Up @@ -393,7 +394,7 @@
protocol:
description:
- This specifies for which protocol this protocol mapper is active.
choices: ['openid-connect', 'saml']
choices: ['openid-connect', 'saml', 'docker-v2']
type: str
protocolMapper:
Expand Down Expand Up @@ -724,6 +725,7 @@

PROTOCOL_OPENID_CONNECT = 'openid-connect'
PROTOCOL_SAML = 'saml'
PROTOCOL_DOCKER_V2 = 'docker-v2'
CLIENT_META_DATA = ['authorizationServicesEnabled']


Expand Down Expand Up @@ -785,7 +787,7 @@ def main():
consentText=dict(type='str'),
id=dict(type='str'),
name=dict(type='str'),
protocol=dict(type='str', choices=[PROTOCOL_OPENID_CONNECT, PROTOCOL_SAML]),
protocol=dict(type='str', choices=[PROTOCOL_OPENID_CONNECT, PROTOCOL_SAML, PROTOCOL_DOCKER_V2]),
protocolMapper=dict(type='str'),
config=dict(type='dict'),
)
Expand Down Expand Up @@ -819,7 +821,7 @@ def main():
authorization_services_enabled=dict(type='bool', aliases=['authorizationServicesEnabled']),
public_client=dict(type='bool', aliases=['publicClient']),
frontchannel_logout=dict(type='bool', aliases=['frontchannelLogout']),
protocol=dict(type='str', choices=[PROTOCOL_OPENID_CONNECT, PROTOCOL_SAML]),
protocol=dict(type='str', choices=[PROTOCOL_OPENID_CONNECT, PROTOCOL_SAML, PROTOCOL_DOCKER_V2]),
attributes=dict(type='dict'),
full_scope_allowed=dict(type='bool', aliases=['fullScopeAllowed']),
node_re_registration_timeout=dict(type='int', aliases=['nodeReRegistrationTimeout']),
Expand Down
9 changes: 5 additions & 4 deletions plugins/modules/keycloak_clientscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
protocol:
description:
- Type of client.
choices: ['openid-connect', 'saml', 'wsfed']
- The V(docker-v2) value was added in community.general 8.6.0.
choices: ['openid-connect', 'saml', 'wsfed', 'docker-v2']
type: str
protocol_mappers:
Expand All @@ -95,7 +96,7 @@
description:
- This specifies for which protocol this protocol mapper.
- is active.
choices: ['openid-connect', 'saml', 'wsfed']
choices: ['openid-connect', 'saml', 'wsfed', 'docker-v2']
type: str
protocolMapper:
Expand Down Expand Up @@ -330,7 +331,7 @@ def main():
protmapper_spec = dict(
id=dict(type='str'),
name=dict(type='str'),
protocol=dict(type='str', choices=['openid-connect', 'saml', 'wsfed']),
protocol=dict(type='str', choices=['openid-connect', 'saml', 'wsfed', 'docker-v2']),
protocolMapper=dict(type='str'),
config=dict(type='dict'),
)
Expand All @@ -341,7 +342,7 @@ def main():
id=dict(type='str'),
name=dict(type='str'),
description=dict(type='str'),
protocol=dict(type='str', choices=['openid-connect', 'saml', 'wsfed']),
protocol=dict(type='str', choices=['openid-connect', 'saml', 'wsfed', 'docker-v2']),
attributes=dict(type='dict'),
protocol_mappers=dict(type='list', elements='dict', options=protmapper_spec, aliases=['protocolMappers']),
)
Expand Down
9 changes: 5 additions & 4 deletions plugins/modules/keycloak_clienttemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
protocol:
description:
- Type of client template.
choices: ['openid-connect', 'saml']
- The V(docker-v2) value was added in community.general 8.6.0.
choices: ['openid-connect', 'saml', 'docker-v2']
type: str
full_scope_allowed:
Expand Down Expand Up @@ -107,7 +108,7 @@
protocol:
description:
- This specifies for which protocol this protocol mapper is active.
choices: ['openid-connect', 'saml']
choices: ['openid-connect', 'saml', 'docker-v2']
type: str
protocolMapper:
Expand Down Expand Up @@ -292,7 +293,7 @@ def main():
consentText=dict(type='str'),
id=dict(type='str'),
name=dict(type='str'),
protocol=dict(type='str', choices=['openid-connect', 'saml']),
protocol=dict(type='str', choices=['openid-connect', 'saml', 'docker-v2']),
protocolMapper=dict(type='str'),
config=dict(type='dict'),
)
Expand All @@ -304,7 +305,7 @@ def main():
id=dict(type='str'),
name=dict(type='str'),
description=dict(type='str'),
protocol=dict(type='str', choices=['openid-connect', 'saml']),
protocol=dict(type='str', choices=['openid-connect', 'saml', 'docker-v2']),
attributes=dict(type='dict'),
full_scope_allowed=dict(type='bool'),
protocol_mappers=dict(type='list', elements='dict', options=protmapper_spec),
Expand Down

0 comments on commit a5b2b5c

Please sign in to comment.