1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/keycloak_clientsecret_regenerate/tasks/main.yml
patchback[bot] 8a231e4b36
[PR #5606/7ea544a6 backport][stable-6] New Module: Keycloak ClientSecret with PR changes (#5654)
New Module: Keycloak ClientSecret with PR changes (#5606)

* feat(plugins/keycloak): add get and create util function for client secret

* feat(plugins/keycloak): add client secret module

* chore: add maintainer in BOTMETA

* Update plugins/modules/identity/keycloak/keycloak_clientsecret.py

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

* Make changes to keycloak_clientsecret from PR

* Add SPDX identifier for keycloak_clientsecret

* Add copyright in keycloak_clientsecret for REUSE

* Add integration test for keycloak_clientsecret

* rm clientsecret from keycloak_clientsecret result

  - end_state used instead

* keycloak_clientsecret: Undo meta/runtime.yml change

* Fix sanity tests for keycloak_clientsecret

* New keycloak_clientsecret_info module

  - Replaces keycloak_clientsecret
  - Module definition and some common logic moved into module_utils
  - Update documentation, tests, etc.
  - Add myself as author

* Misc fixes to keycloak_clientsecret_info

* Add keycloak_clientsecret_regenerate module

* keycloak_clientsecret* Update .github/BOTMETA.yml

* keycloak_clientsecret_regenerate: Fix sanity tests

* Fix README for keycloak_clientsecret integration test

* Separate out keycloak_clientsecret module_utils

* Keycloak_clientsecret module_utils: boilerplate

* Update plugins/modules/keycloak_clientsecret_info.py

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

* Update plugins/modules/keycloak_clientsecret_info.py

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

* Update plugins/modules/keycloak_clientsecret_info.py

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

* Update plugins/modules/keycloak_clientsecret_info.py

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

* Update plugins/modules/keycloak_clientsecret_info.py

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

* Update plugins/modules/keycloak_clientsecret_info.py

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

* keycloak_clientsecret: Add no_log to examples and docs

* keycloak_clientsecret: Update BOTMETA

* Update .github/BOTMETA.yml

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

Co-authored-by: fynncfchen <fynn.cfchen@gmail.com>
Co-authored-by: Fynnnnn <ethan.cfchen@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 7ea544a624)

Co-authored-by: John Cant <a.johncant@gmail.com>
2022-12-05 05:47:23 +00:00

49 lines
1.5 KiB
YAML

---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Create realm
community.general.keycloak_realm: "{{ auth_args | combine(call_args) }}"
vars:
call_args:
id: "{{ realm }}"
realm: "{{ realm }}"
state: present
- name: Keycloak Client
community.general.keycloak_client: "{{ auth_args | combine(call_args) }}"
vars:
call_args:
realm: "{{ realm }}"
client_id: "{{ client_id }}"
state: present
register: client
- name: Keycloak Client regenerate clientsecret by client_id
community.general.keycloak_clientsecret_regenerate: "{{ auth_args | combine(call_args) }}"
vars:
call_args:
realm: "{{ realm }}"
client_id: "{{ client_id }}"
register: regenerate_by_client_id
- name: Assert that the client secret was retrieved
assert:
that:
- regenerate_by_client_id.end_state.type == "secret"
- "{{ regenerate_by_client_id.end_state.value | length }} >= 32"
- name: Keycloak Client regenerate clientsecret by id
community.general.keycloak_clientsecret_regenerate: "{{ auth_args | combine(call_args) }}"
vars:
call_args:
realm: "{{ realm }}"
id: "{{ client.end_state.id }}"
register: regenerate_by_id
- name: Assert that client secret was regenerated
assert:
that:
- "{{ regenerate_by_id.end_state.value | length }} >= 32"
- regenerate_by_id.end_state.value != regenerate_by_client_id.end_state.value