Skip to content

Commit

Permalink
$OIDC_SCOPES must be an array, testing the env to be a valid json arr…
Browse files Browse the repository at this point in the history
…ay before pushing to config (without escaping)
  • Loading branch information
capile committed Nov 12, 2024
1 parent ce805b5 commit 7a37d9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/files/configure_misp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ set_up_oidc() {
}
}" > /dev/null

# Check if OIDC_SCOPES is set and not empty
if [[ -n "$OIDC_SCOPES" ]]; then
# Check if OIDC_SCOPES is set and is an array
if [[ "$(echo "$OIDC_SCOPES" | jq type -r)" == "array" ]]; then
# 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
sudo -u www-data php /var/www/MISP/tests/modify_config.php modify "{
\"OidcAuth\": {
${OIDC_SCOPES:+\"scopes\": \"${OIDC_SCOPES}\"}
\"scopes\": ${OIDC_SCOPES}
}
}" > /dev/null
fi
Expand Down

0 comments on commit 7a37d9f

Please sign in to comment.