From 22428432c498785c454f393793036892d759fa1c Mon Sep 17 00:00:00 2001 From: iromli Date: Wed, 9 Feb 2022 04:13:38 +0700 Subject: [PATCH] feat(image): pull otp and super_gluu configuration from secrets --- docker-casa/scripts/auth_conf.py | 28 ++++++++++++++++++++++++++++ docker-casa/scripts/entrypoint.sh | 3 +-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 docker-casa/scripts/auth_conf.py diff --git a/docker-casa/scripts/auth_conf.py b/docker-casa/scripts/auth_conf.py new file mode 100644 index 000000000..acab444dc --- /dev/null +++ b/docker-casa/scripts/auth_conf.py @@ -0,0 +1,28 @@ +import os + +from jans.pycloudlib import get_manager + +import logging.config +from settings import LOGGING_CONFIG + +logging.config.dictConfig(LOGGING_CONFIG) +logger = logging.getLogger("entrypoint") + + +manager = get_manager() + + +def pull_auth_conf(): + conf_files = ( + "otp_configuration.json", + "super_gluu_creds.json", + ) + for conf_file in conf_files: + file_ = f"/etc/certs/{conf_file}" + secret_name = os.path.splitext(conf_file)[0] + logger.info(f"Pulling {file_} from secrets") + manager.secret.to_file(secret_name, file_) + + +if __name__ == "__main__": + pull_auth_conf() diff --git a/docker-casa/scripts/entrypoint.sh b/docker-casa/scripts/entrypoint.sh index f86c43d1e..1ae862767 100644 --- a/docker-casa/scripts/entrypoint.sh +++ b/docker-casa/scripts/entrypoint.sh @@ -24,10 +24,9 @@ wget -q ${CASA_PLUGIN_REPO}/strong-authn-settings/${GLUU_VERSION}/strong-authn-s # ========== python3 /app/scripts/wait.py - python3 /app/scripts/bootstrap.py - # python3 /app/scripts/jca_sync.py & +python3 /app/scripts/auth_conf.py # run Casa server cd /opt/jans/jetty/casa