mirror of https://github.com/MISP/misp-docker
$OIDC_SCOPES must be an array, testing the env to be a valid json array before pushing to config (without escaping) (#184)
parent
ce805b58a3
commit
5e60a88eeb
|
@ -101,13 +101,13 @@ set_up_oidc() {
|
||||||
}
|
}
|
||||||
}" > /dev/null
|
}" > /dev/null
|
||||||
|
|
||||||
# Check if OIDC_SCOPES is set and not empty
|
# Check if OIDC_SCOPES is set and is an array
|
||||||
if [[ -n "$OIDC_SCOPES" ]]; then
|
if [[ "$(echo "$OIDC_SCOPES" | jq type -r)" == "array" ]]; then
|
||||||
# Run the modify_config.php script to update OidcAuth configuration with the provided OIDC_SCOPES
|
# Run the modify_config.php script to update OidcAuth configuration with the provided OIDC_SCOPES
|
||||||
# The 'scopes' field will only be added if OIDC_SCOPES has a value
|
# The 'scopes' field will only be added if OIDC_SCOPES has a value
|
||||||
sudo -u www-data php /var/www/MISP/tests/modify_config.php modify "{
|
sudo -u www-data php /var/www/MISP/tests/modify_config.php modify "{
|
||||||
\"OidcAuth\": {
|
\"OidcAuth\": {
|
||||||
${OIDC_SCOPES:+\"scopes\": \"${OIDC_SCOPES}\"}
|
\"scopes\": ${OIDC_SCOPES}
|
||||||
}
|
}
|
||||||
}" > /dev/null
|
}" > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue