From fe6a6c1072ee98c683a1154977f8f0232bde1c38 Mon Sep 17 00:00:00 2001 From: flytreeleft Date: Fri, 26 Apr 2019 23:05:43 +0800 Subject: [PATCH] Develop: support to verify the multiple Keycloak Realms feature --- develop/keycloak-plugin.properties | 1 + develop/keycloak.json | 11 +++++++++++ develop/keycloak.test.json | 10 ++++++++++ develop/run-nexus3.sh | 2 ++ 4 files changed, 24 insertions(+) create mode 100644 develop/keycloak-plugin.properties create mode 100644 develop/keycloak.json create mode 100644 develop/keycloak.test.json diff --git a/develop/keycloak-plugin.properties b/develop/keycloak-plugin.properties new file mode 100644 index 0000000..fa9610c --- /dev/null +++ b/develop/keycloak-plugin.properties @@ -0,0 +1 @@ +keycloak.auth.config=keycloak.json diff --git a/develop/keycloak.json b/develop/keycloak.json new file mode 100644 index 0000000..aa29cf0 --- /dev/null +++ b/develop/keycloak.json @@ -0,0 +1,11 @@ +{ + "realm": "master", + "auth-server-url": "http://172.17.0.1:8086/auth", + "ssl-required": "external", + "resource": "nexus3", + "credentials": { + "secret": "1a2bfe56-9b4b-4bf3-bda2-2dd31fed1b9a" + }, + "confidential-port": 0, + "policy-enforcer": {} +} diff --git a/develop/keycloak.test.json b/develop/keycloak.test.json new file mode 100644 index 0000000..7a2319c --- /dev/null +++ b/develop/keycloak.test.json @@ -0,0 +1,10 @@ +{ + "realm": "test", + "auth-server-url": "http://172.17.0.1:8086/auth", + "ssl-required": "external", + "resource": "nexus3", + "credentials": { + "secret": "f5e314e8-6081-4ecb-85de-f4e9ff374bc8" + }, + "confidential-port": 0 +} diff --git a/develop/run-nexus3.sh b/develop/run-nexus3.sh index e0917c2..1789924 100644 --- a/develop/run-nexus3.sh +++ b/develop/run-nexus3.sh @@ -29,7 +29,9 @@ docker run -d --name ${DCR_NAME} \ --restart always \ -e NEXUS_CONTEXT="/" \ -v "${DCR_DATA_VOLUME}":/nexus-data \ + -v "${DIR}/keycloak-plugin.properties":${NEXUS_HOME}/etc/keycloak-plugin.properties:ro \ -v "${DIR}/keycloak.json":${NEXUS_HOME}/etc/keycloak.json:ro \ + -v "${DIR}/keycloak.test.json":${NEXUS_HOME}/etc/keycloak.test.json:ro \ -v "${PLUGIN_JAR}":"${NEXUS_HOME}/system/org/github/flytreeleft/nexus3-keycloak-plugin/${PLUGIN_VERSION}/nexus3-keycloak-plugin-${PLUGIN_VERSION}.jar":ro \ -p 172.17.0.1:8903:8081 \ ${DCR_IMAGE}