1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00
community.general/tests/integration/targets/keycloak_user
Ivan Kokalovic c41de53dbb
keycloak: URL-encode query parameters for usernames with special characters (#11472)
* fix(keycloak): URL-encode query params for usernames with special chars

get_user_by_username() concatenates the username directly into the URL
query string. When the username contains a +, it is interpreted as a
space by the server, returning no match and causing a TypeError.

Use urllib.parse.quote() (already imported) for the username parameter.
Also replace three fragile .replace(' ', '%20') calls in the authz
search methods with proper quote() calls.

Fixes #10305

* Update changelogs/fragments/keycloak-url-encode-query-params.yml

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-02-06 07:10:55 +01:00
..
tasks keycloak: URL-encode query parameters for usernames with special characters (#11472) 2026-02-06 07:10:55 +01:00
vars Inspq keycloak user module (#6476) 2023-06-09 06:17:44 +02:00
aliases Inspq keycloak user module (#6476) 2023-06-09 06:17:44 +02:00
README.md Inspq keycloak user module (#6476) 2023-06-09 06:17:44 +02:00

Running keycloak_user module integration test

To run Keycloak user module's integration test, start a keycloak server using Docker or Podman:

podman|docker run -d --rm --name mykeycloak -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=password quay.io/keycloak/keycloak:latest start-dev --http-relative-path /auth

Source Ansible env-setup from ansible github repository

Run integration tests:

ansible-test integration keycloak_user --python 3.10 --allow-unsupported

Cleanup:

podman|docker stop mykeycloak