-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reuse session when running kcadm commands (#328)
* Reuse session when running kcadm commands Fixes #327 * Move to using kcadm-wrapper config file so that script is just a script and not a template * Fix conditional * Remove kcmadm login session when Keycloak service restarts unless using persistent sessions
- Loading branch information
Showing
7 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# shellcheck source=/dev/null | ||
. /opt/keycloak/conf/kcadm-wrapper.conf | ||
|
||
EXPIRES=$(/usr/bin/sed -n -r 's|.*"refreshExpiresAt" : ([0-9]*).*|\1|p' "$CONFIG" 2>/dev/null || echo "0") | ||
NOW=$(/usr/bin/date +%s%3N) | ||
|
||
if [ ! -f "$CONFIG" ] || [ "$EXPIRES" -lt "$NOW" ]; then | ||
${KCADM} config credentials --config "$CONFIG" --server "$SERVER" --realm "$REALM" --user "$ADMIN_USER" --password "$PASSWORD" | ||
fi | ||
|
||
${KCADM} "$@" --config "$CONFIG" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<%- | | ||
Hash[String, String] $vars | ||
| -%> | ||
# This file is managed by Puppet, DO NOT EDIT | ||
|
||
<% $vars.each |$key, $value| { -%> | ||
<%= $key %>='<%= $value %>' | ||
<% } -%> |