Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(image): preserve attribute's values in jans-auth config #3013

Merged
merged 1 commit into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-jans-persistence-loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The following environment variables are supported by the container:
- `CN_PERSISTENCE_TYPE`: Persistence backend being used (one of `ldap`, `couchbase`, or `hybrid`; default to `ldap`).
- `CN_HYBRID_MAPPING`: Specify data mapping for each persistence (default to `"{}"`). Note this environment only takes effect when `CN_PERSISTENCE_TYPE` is set to `hybrid`. See [hybrid mapping](#hybrid-mapping) section for details.
- `CN_PERSISTENCE_SKIP_INITIALIZED`: skip initialization if backend already initialized (default to `false`).
- `CN_PERSISTENCE_UPDATE_AUTH_DYNAMIC_CONFIG`: Whether to allow automatic updates of `jans-auth` configuration (default to `true`).
- `CN_LDAP_URL`: Address and port of LDAP server (default to `localhost:1636`).
- `CN_LDAP_USE_SSL`: Whether to use SSL connection to LDAP server (default to `true`).
- `CN_COUCHBASE_URL`: Address of Couchbase server (default to `localhost`).
Expand Down
12 changes: 7 additions & 5 deletions docker-jans-persistence-loader/scripts/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,16 @@ def _transform_auth_dynamic_config(conf):
lambda x: isinstance(x, dict), conf["authorizationRequestCustomAllowedParameters"]
))
if not params_with_dict:
conf["authorizationRequestCustomAllowedParameters"] = list(map(
lambda p: {"paramName": p[0], "returnInResponse": p[1]},
[
conf["authorizationRequestCustomAllowedParameters"] = [
{"paramName": p[0], "returnInResponse": p[1]}
for p in [
("customParam1", False),
("customParam2", False),
("customParam3", False),
("customParam4", True),
("customParam5", True),
]
))
]
should_update = True

if "useHighestLevelScriptIfAcrScriptNotFound" not in conf:
Expand Down Expand Up @@ -457,7 +457,9 @@ def invoke(self):
if hasattr(self.backend, "update_misc"):
self.backend.update_misc()

self.update_auth_dynamic_config()
if as_boolean(os.environ.get("CN_PERSISTENCE_UPDATE_AUTH_DYNAMIC_CONFIG", "true")):
self.update_auth_dynamic_config()

self.update_auth_errors_config()
self.update_auth_static_config()
self.update_attributes_entries()
Expand Down