__matrix_synapse: add --saml2-mapping-provider-extra-settings flag

This commit is contained in:
fnux 2022-01-16 12:41:03 +01:00
parent c198a74a34
commit 974e42e20e
No known key found for this signature in database
GPG Key ID: 4502C902C00A1E12
4 changed files with 21 additions and 0 deletions

View File

@ -1846,6 +1846,17 @@ cat << EOF
# value will be used instead. # value will be used instead.
# #
#mxid_mapping: dotreplace #mxid_mapping: dotreplace
EOF
if [ -n "$SAML2_MAPPING_PROVIDER_EXTRA_CONFIG" ]; then
echo "$SAML2_MAPPING_PROVIDER_EXTRA_CONFIG" | while IFS= read -r entry; do
cat << EOF
$entry
EOF
done
fi
cat << EOF
# In previous versions of synapse, the mapping from SAML attribute to # In previous versions of synapse, the mapping from SAML attribute to
# MXID was always calculated dynamically rather than stored in a # MXID was always calculated dynamically rather than stored in a

View File

@ -201,6 +201,10 @@ saml2-sp-cert
saml2-mapping-provider-module saml2-mapping-provider-module
Name of custom Python module used to map SAML2 attributes to synapse internals. Name of custom Python module used to map SAML2 attributes to synapse internals.
saml2-mapping-provider-extra-settings
Extra YAML-formatted key/pair values provided as configuration to the SAML2
mapping provider module (e.g. 'key: value'). Can be specified multiple times.
extra-setting extra-setting
Arbitrary string to be added to the configuration file. Can be specified multiple times. Arbitrary string to be added to the configuration file. Can be specified multiple times.

View File

@ -215,6 +215,11 @@ if [ -f "$__object/parameter/saml2-mapping-provider-module" ]; then
export SAML2_MAPPING_PROVIDER_MODULE export SAML2_MAPPING_PROVIDER_MODULE
fi fi
if [ -f "$__object/parameter/saml2-mapping-provider-extra-config" ]; then
SAML2_MAPPING_PROVIDER_EXTRA_CONFIG=$(cat "$__object/parameter/saml2-mapping-provider-extra-config")
export SAML2_MAPPING_PROVIDER_EXTRA_CONFIG
fi
if [ -n "$SAML2_SP_KEY" ] && [ -z "$SAML2_SP_CERT" ]; then if [ -n "$SAML2_SP_KEY" ] && [ -z "$SAML2_SP_CERT" ]; then
echo "--saml2-sp-cert must be set if --saml2-sp-key is provided." >&2 echo "--saml2-sp-cert must be set if --saml2-sp-key is provided." >&2
exit 1 exit 1

View File

@ -5,3 +5,4 @@ app-service-config-file
extra-setting extra-setting
bind-address bind-address
outbound-federation-worker outbound-federation-worker
saml2-mapping-provider-extra-config