Skip to content

CLI utility to generate plain Keycloak configuration files from a JSON template using variable substitution. This tool can be used when building Keycloak's Docker image in a CI environment.

License

Notifications You must be signed in to change notification settings

jachinte/keycloak-as-code

Repository files navigation

Keycloak Configuration as Code

This is a command line application that generates a plain configuration file based on a JSON template. Variables within the template are replaced with their corresponding value at run-time. Examples of variable substitution are:

Base64 Decoder:        ${base64Decoder:SGVsbG9Xb3JsZCE=}
Base64 Encoder:        ${base64Encoder:HelloWorld!}
Java Constant:         ${const:java.awt.event.KeyEvent.VK_ESCAPE}
Date:                  ${date:yyyy-MM-dd}
DNS:                   ${dns:address|apache.org}
Environment Variable:  ${env:USERNAME}
File Content:          ${file:UTF-8:src/test/resources/document.properties}
Java:                  ${java:version}
Localhost:             ${localhost:canonical-name}
Properties File:       ${properties:src/test/resources/document.properties::mykey}
Resource Bundle:       ${resourceBundle:org.example.testResourceBundleLookup:mykey}
Script:                ${script:javascript:3 + 4}
System Property:       ${sys:user.dir}
URL Decoder:           ${urlDecoder:Hello%20World%21}
URL Encoder:           ${urlEncoder:Hello World!}
URL Content (HTTP):    ${url:UTF-8:http://www.apache.org}
URL Content (HTTPS):   ${url:UTF-8:https://www.apache.org}
URL Content (File):    ${url:UTF-8:file:///${sys:user.dir}/src/test/resources/document.properties}
XML XPath:             ${xml:src/test/resources/document.xml:/root/path/to/node}

See Apache Common StringSubstitutor documentation for more information and advanced usage.

Use this project

Visit the releases page and download the binary.

Compile, test and run this project

# Generate distribution files
./gradlew distZip

# Generate a native image
./gradlew nativeImage

# Test and run
./gradlew test --info
./gradlew run --args="-i path/to/template"

About

CLI utility to generate plain Keycloak configuration files from a JSON template using variable substitution. This tool can be used when building Keycloak's Docker image in a CI environment.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages