2020-05-23 16:29:07 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Script that wraps kcadm.sh to securely get our credentials.
|
2020-05-23 17:09:44 +02:00
|
|
|
# It always operates on the realm `archlinux` for convenience.
|
2020-05-23 16:29:07 +02:00
|
|
|
#
|
|
|
|
# Example invocation:
|
|
|
|
# misc/kcadm_wrapper.sh get realms
|
2020-05-23 17:03:37 +02:00
|
|
|
# misc/kcadm_wrapper.sh get authentication/flows
|
|
|
|
# Refer to the API docs for which resources exist:
|
|
|
|
# https://www.keycloak.org/docs-api/10.0/rest-api/index.html
|
2020-05-23 17:05:37 +02:00
|
|
|
# See for general kcadm usage:
|
|
|
|
# https://github.com/keycloak/keycloak-documentation/blob/master/server_admin/topics/admin-cli.adoc
|
|
|
|
|
2022-11-12 17:51:25 +01:00
|
|
|
kcadm.sh "$@" \
|
2020-05-23 17:09:44 +02:00
|
|
|
-r archlinux \
|
|
|
|
--no-config \
|
2022-11-12 15:07:09 +01:00
|
|
|
--server https://accounts.archlinux.org \
|
2020-05-23 17:09:44 +02:00
|
|
|
--realm master \
|
|
|
|
--user $(misc/get_key.py group_vars/all/vault_keycloak.yml vault_keycloak_admin_user) \
|
|
|
|
--password $(misc/get_key.py group_vars/all/vault_keycloak.yml vault_keycloak_admin_password)
|