community.general/tests/integration/targets/keycloak_authz_custom_policy
Felix Fontein 8bd68e7e41
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.16) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.11) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.6) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
Remove and prevent trailing whitespace (#10199)
* Remove trailing whitespace.

* Add no-trailing-whitespace extra test.

* Re-add needed trailing whitespace.

* Remove one more trailing whitespace.
2025-06-07 17:47:22 +02:00
..
policy Add keycloak_authz_custom_policy module (#7126) 2023-09-19 18:07:25 +02:00
tasks Remove and prevent trailing whitespace (#10199) 2025-06-07 17:47:22 +02:00
vars Add keycloak_authz_custom_policy module (#7126) 2023-09-19 18:07:25 +02:00
aliases Add keycloak_authz_custom_policy module (#7126) 2023-09-19 18:07:25 +02:00
readme.adoc Add keycloak_authz_custom_policy module (#7126) 2023-09-19 18:07:25 +02:00

// 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

To be able to run these integration tests a keycloak server must be
reachable under a specific url with a specific admin user and password.
The exact values expected for these parameters can be found in
'vars/main.yml' file. A vanilla Keycloak server will not be sufficient:
you will need to deploy a custom JAR file with two policies:

* _MyPolicy1:_ policy-1.js
* _MyPolicy2:_ policy-2.js

To create a customized Keycloak test instance running on Podman first
install the "zip" command, go to the policy subdirectory and then do

[source,shell]
----
./build-policy.sh
podman build --tag keycloak_authz_custom_policy_test:1.0.0 .
podman rm mykeycloak && podman run --name mykeycloak -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=password -e KC_HTTP_RELATIVE_PATH=/auth localhost/keycloak_authz_custom_policy_test:1.0.0  start-dev
----

This process probably also work with Docker just by replacing _podman_ with
_docker_. Modify the FROM argument in Containerfile to change Keycloak version
to test against. Quarkus versions of Keycloak should work - older versions
will not.