__matrix_synapse: add --saml2-mapping-provider-module flag

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

View File

@ -1808,7 +1808,15 @@ cat << EOF
# The custom module's class. Uncomment to use a custom module. # The custom module's class. Uncomment to use a custom module.
# #
#module: mapping_provider.SamlMappingProvider #module: mapping_provider.SamlMappingProvider
EOF
if [ -n "$SAML2_MAPPING_PROVIDER_MODULE" ]; then
cat << EOF
module: "$SAML2_MAPPING_PROVIDER_MODULE"
EOF
fi
cat << EOF
# Custom configuration values for the module. Below options are # Custom configuration values for the module. Below options are
# intended for the built-in provider, they should be changed if # intended for the built-in provider, they should be changed if
# using a custom module. This section will be passed as a Python # using a custom module. This section will be passed as a Python

View File

@ -198,6 +198,9 @@ saml2-sp-key
saml2-sp-cert saml2-sp-cert
Path to PEM-formatted cert file for use by PySAML2. Path to PEM-formatted cert file for use by PySAML2.
saml2-mapping-provider-module
Name of custom Python module used to map SAML2 attributes to synapse internals.
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

@ -210,6 +210,11 @@ if [ -f "$__object/parameter/saml2-sp-cert" ]; then
export SAML2_SP_CERT export SAML2_SP_CERT
fi fi
if [ -f "$__object/parameter/saml2-mapping-provider-module" ]; then
SAML2_MAPPING_PROVIDER_MODULE=$(cat "$__object/parameter/saml2-mapping-provider-module")
export SAML2_MAPPING_PROVIDER_MODULE
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

@ -40,3 +40,4 @@ saml2-idp-metadata-url
saml2-sp-key saml2-sp-key
saml2-sp-cert saml2-sp-cert
default-identity-server default-identity-server
saml2-mapping-provider-module