Skip to content

Commit

Permalink
feat(docker-jans): use mixed strategy for Agama serialization (#6889)
Browse files Browse the repository at this point in the history
Signed-off-by: Mustafa Baser <mbaser@mail.com>
  • Loading branch information
iromli authored and devrimyatar committed Dec 30, 2023
1 parent 0b93213 commit 9d0e82c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docker-jans-auth-server/Dockerfile
Expand Up @@ -51,7 +51,7 @@ RUN /opt/jython/bin/pip uninstall -y pip setuptools
# ===========

ENV CN_VERSION=1.0.21-SNAPSHOT
ENV CN_BUILD_DATE='2023-11-14 10:53'
ENV CN_BUILD_DATE='2023-12-01 12:29'
ENV CN_SOURCE_URL=https://jenkins.jans.io/maven/io/jans/jans-auth-server/${CN_VERSION}/jans-auth-server-${CN_VERSION}.war

# Install Jans Auth
Expand Down Expand Up @@ -95,7 +95,7 @@ RUN mkdir -p ${JETTY_BASE}/jans-auth/agama/fl \
${JETTY_BASE}/jans-auth/agama/ftl \
${JETTY_BASE}/jans-auth/agama/scripts

ENV JANS_SOURCE_VERSION=a3026d7957a1aaefa30269904744975352ae4642
ENV JANS_SOURCE_VERSION=00aee0c26565e8b0b574370610a75139c2155568

# note that as we're pulling from a monorepo (with multiple project in it)
# we are using partial-clone and sparse-checkout to get the agama code
Expand Down
4 changes: 2 additions & 2 deletions docker-jans-config-api/Dockerfile
Expand Up @@ -41,7 +41,7 @@ RUN wget -q https://maven.jans.io/maven/io/jans/jython-installer/${JYTHON_VERSIO
# ==========

ENV CN_VERSION=1.0.21-SNAPSHOT
ENV CN_BUILD_DATE='2023-11-21 10:01'
ENV CN_BUILD_DATE='2023-12-01 11:39'
ENV CN_SOURCE_URL=https://jenkins.jans.io/maven/io/jans/jans-config-api-server/${CN_VERSION}/jans-config-api-server-${CN_VERSION}.war

# Install Jans Config API
Expand Down Expand Up @@ -94,7 +94,7 @@ RUN wget -q ${SCIM_PLUGIN_SOURCE_URL} -O ${JETTY_BASE}/jans-config-api/_plugins/
# jans-linux-setup sync
# =====================

ENV JANS_SOURCE_VERSION=2918c11a25b50a395c71ad5dc252cf49d319a407
ENV JANS_SOURCE_VERSION=00aee0c26565e8b0b574370610a75139c2155568
ARG JANS_SETUP_DIR=jans-linux-setup/jans_setup
ARG JANS_CONFIG_API_RESOURCES=jans-config-api/server/src/main/resources

Expand Down
2 changes: 1 addition & 1 deletion docker-jans-persistence-loader/Dockerfile
Expand Up @@ -26,7 +26,7 @@ RUN python3 -m ensurepip \
# =====================

# janssenproject/jans SHA commit
ENV JANS_SOURCE_VERSION=fa98c326cb8d8a51c36053e44363fdf6ddcef4b9
ENV JANS_SOURCE_VERSION=00aee0c26565e8b0b574370610a75139c2155568
ARG JANS_SETUP_DIR=jans-linux-setup/jans_setup
ARG JANS_SCRIPT_CATALOG_DIR=docs/script-catalog
ARG JANS_CONFIG_API_RESOURCES=jans-config-api/server/src/main/resources
Expand Down
17 changes: 13 additions & 4 deletions docker-jans-persistence-loader/scripts/hooks.py
Expand Up @@ -195,10 +195,19 @@ def transform_auth_dynamic_config_hook(conf, manager):
})
should_update = True

# avoid setting agama configuration root dir based on java system variable
if "rootDir" not in conf["agamaConfiguration"]:
conf["agamaConfiguration"]["rootDir"] = "/opt/jans/jetty/jans-auth/agama"
should_update = True
# add missing agama-level keys
for new_key, value in [
# avoid setting agama configuration root dir based on java system variable
("rootDir", "/opt/jans/jetty/jans-auth/agama"),
# add serializers
("serializeRules", {
"JAVA": ["java", "sun", "com.sun", "jdk"],
"KRYO": [],
}),
]:
if new_key not in conf["agamaConfiguration"]:
conf["agamaConfiguration"][new_key] = value
should_update = True

# return the conf and flag to determine whether it needs update or not
return conf, should_update
Expand Down

0 comments on commit 9d0e82c

Please sign in to comment.