Some configuration parameters values should be True/False not "true"/"false".

This commit is contained in:
Roland Hedberg
2015-09-01 12:22:21 +02:00
parent e341cdc5fe
commit 0a83d585ca
3 changed files with 22 additions and 13 deletions

View File

@@ -351,13 +351,13 @@ by default. This can be overriden by application code for a specific call.
This sets the AuthnRequestsSigned attribute of the SPSSODescriptor node This sets the AuthnRequestsSigned attribute of the SPSSODescriptor node
of the metadata so the IdP will know this SP preference. of the metadata so the IdP will know this SP preference.
Valid values are "true" or "false". Default value is "false". Valid values are True or False. Default value is True.
Example:: Example::
"service": { "service": {
"sp": { "sp": {
"authn_requests_signed": "true", "authn_requests_signed": True,
} }
} }
@@ -419,13 +419,13 @@ Indicates if this SP wants the IdP to send the assertions signed. This
sets the WantAssertionsSigned attribute of the SPSSODescriptor node sets the WantAssertionsSigned attribute of the SPSSODescriptor node
of the metadata so the IdP will know this SP preference. of the metadata so the IdP will know this SP preference.
Valid values are "true" or "false". Default value is "true". Valid values are True or False. Default value is True.
Example:: Example::
"service": { "service": {
"sp": { "sp": {
"want_assertions_signed": "true", "want_assertions_signed": True,
} }
} }
@@ -475,13 +475,13 @@ Indicates if this entity will sign the Logout Requests originated from it.
This can be overriden by application code for a specific call. This can be overriden by application code for a specific call.
Valid values are "true" or "false". Default value is "false". Valid values are True or False. Default value is False.
Example:: Example::
"service": { "service": {
"sp": { "sp": {
"logout_requests_signed": "true", "logout_requests_signed": False,
} }
} }

View File

@@ -35,7 +35,6 @@ from saml2.extension import ui
from saml2 import xmldsig from saml2 import xmldsig
from saml2 import xmlenc from saml2 import xmlenc
ONTS = { ONTS = {
saml.NAMESPACE: saml, saml.NAMESPACE: saml,
mdui.NAMESPACE: mdui, mdui.NAMESPACE: mdui,
@@ -49,7 +48,8 @@ ONTS = {
} }
COMMON_ARGS = [ COMMON_ARGS = [
"entityid", "xmlsec_binary", "debug", "key_file", "cert_file", "encryption_keypairs", "additional_cert_files", "entityid", "xmlsec_binary", "debug", "key_file", "cert_file",
"encryption_keypairs", "additional_cert_files",
"metadata_key_usage", "secret", "accepted_time_diff", "name", "ca_certs", "metadata_key_usage", "secret", "accepted_time_diff", "name", "ca_certs",
"description", "valid_for", "verify_ssl_cert", "description", "valid_for", "verify_ssl_cert",
"organization", "organization",
@@ -58,7 +58,6 @@ COMMON_ARGS = [
"virtual_organization", "virtual_organization",
"logger", "logger",
"only_use_keys_in_metadata", "only_use_keys_in_metadata",
"logout_requests_signed",
"disable_ssl_certificate_validation", "disable_ssl_certificate_validation",
"referred_binding", "referred_binding",
"session_storage", "session_storage",
@@ -93,6 +92,7 @@ SP_ARGS = [
"allow_unsolicited", "allow_unsolicited",
"ecp", "ecp",
"name_id_format", "name_id_format",
"logout_requests_signed",
] ]
AA_IDP_ARGS = [ AA_IDP_ARGS = [
@@ -176,6 +176,7 @@ PREFERRED_BINDING = {
class ConfigurationError(SAMLError): class ConfigurationError(SAMLError):
pass pass
# ----------------------------------------------------------------- # -----------------------------------------------------------------
@@ -254,9 +255,15 @@ class Config(object):
def load_special(self, cnf, typ, metadata_construction=False): def load_special(self, cnf, typ, metadata_construction=False):
for arg in SPEC[typ]: for arg in SPEC[typ]:
try: try:
self.setattr(typ, arg, cnf[arg]) _val = cnf[arg]
except KeyError: except KeyError:
pass pass
else:
if _val == "true":
_val = True
elif _val == "false":
_val = False
self.setattr(typ, arg, _val)
self.context = typ self.context = typ
self.load_complex(cnf, typ, metadata_construction=metadata_construction) self.load_complex(cnf, typ, metadata_construction=metadata_construction)

View File

@@ -64,7 +64,9 @@ sp2 = {
"optional_attributes": ["title"], "optional_attributes": ["title"],
"idp": { "idp": {
"": "https://example.com/saml2/idp/SSOService.php", "": "https://example.com/saml2/idp/SSOService.php",
} },
"authn_requests_signed": True,
"logout_requests_signed": True,
} }
}, },
#"xmlsec_binary" : "/opt/local/bin/xmlsec1", #"xmlsec_binary" : "/opt/local/bin/xmlsec1",
@@ -370,4 +372,4 @@ def test_assertion_consumer_service():
"location"] == 'https://www.zimride.com/Shibboleth.sso/SAML2/POST' "location"] == 'https://www.zimride.com/Shibboleth.sso/SAML2/POST'
if __name__ == "__main__": if __name__ == "__main__":
test_1() test_2()