Some configuration parameters values should be True/False not "true"/"false".
This commit is contained in:
		@@ -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
 | 
			
		||||
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::
 | 
			
		||||
 | 
			
		||||
    "service": {
 | 
			
		||||
        "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
 | 
			
		||||
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::
 | 
			
		||||
 | 
			
		||||
    "service": {
 | 
			
		||||
        "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.
 | 
			
		||||
 | 
			
		||||
Valid values are "true" or "false". Default value is "false".
 | 
			
		||||
Valid values are True or False. Default value is False.
 | 
			
		||||
 | 
			
		||||
Example::
 | 
			
		||||
 | 
			
		||||
    "service": {
 | 
			
		||||
        "sp": {
 | 
			
		||||
            "logout_requests_signed": "true",
 | 
			
		||||
            "logout_requests_signed": False,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,6 @@ from saml2.extension import ui
 | 
			
		||||
from saml2 import xmldsig
 | 
			
		||||
from saml2 import xmlenc
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ONTS = {
 | 
			
		||||
    saml.NAMESPACE: saml,
 | 
			
		||||
    mdui.NAMESPACE: mdui,
 | 
			
		||||
@@ -49,7 +48,8 @@ ONTS = {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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",
 | 
			
		||||
    "description", "valid_for", "verify_ssl_cert",
 | 
			
		||||
    "organization",
 | 
			
		||||
@@ -58,7 +58,6 @@ COMMON_ARGS = [
 | 
			
		||||
    "virtual_organization",
 | 
			
		||||
    "logger",
 | 
			
		||||
    "only_use_keys_in_metadata",
 | 
			
		||||
    "logout_requests_signed",
 | 
			
		||||
    "disable_ssl_certificate_validation",
 | 
			
		||||
    "referred_binding",
 | 
			
		||||
    "session_storage",
 | 
			
		||||
@@ -93,6 +92,7 @@ SP_ARGS = [
 | 
			
		||||
    "allow_unsolicited",
 | 
			
		||||
    "ecp",
 | 
			
		||||
    "name_id_format",
 | 
			
		||||
    "logout_requests_signed",
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
AA_IDP_ARGS = [
 | 
			
		||||
@@ -176,6 +176,7 @@ PREFERRED_BINDING = {
 | 
			
		||||
class ConfigurationError(SAMLError):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# -----------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -254,9 +255,15 @@ class Config(object):
 | 
			
		||||
    def load_special(self, cnf, typ, metadata_construction=False):
 | 
			
		||||
        for arg in SPEC[typ]:
 | 
			
		||||
            try:
 | 
			
		||||
                self.setattr(typ, arg, cnf[arg])
 | 
			
		||||
                _val = cnf[arg]
 | 
			
		||||
            except KeyError:
 | 
			
		||||
                pass
 | 
			
		||||
            else:
 | 
			
		||||
                if _val == "true":
 | 
			
		||||
                    _val = True
 | 
			
		||||
                elif _val == "false":
 | 
			
		||||
                    _val = False
 | 
			
		||||
                self.setattr(typ, arg, _val)
 | 
			
		||||
 | 
			
		||||
        self.context = typ
 | 
			
		||||
        self.load_complex(cnf, typ, metadata_construction=metadata_construction)
 | 
			
		||||
@@ -377,7 +384,7 @@ class Config(object):
 | 
			
		||||
            config_file = config_file[:-3]
 | 
			
		||||
 | 
			
		||||
        mod = self._load(config_file)
 | 
			
		||||
        #return self.load(eval(open(config_file).read()))
 | 
			
		||||
        # return self.load(eval(open(config_file).read()))
 | 
			
		||||
        return self.load(copy.deepcopy(mod.CONFIG), metadata_construction)
 | 
			
		||||
 | 
			
		||||
    def load_metadata(self, metadata_conf):
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,9 @@ sp2 = {
 | 
			
		||||
            "optional_attributes": ["title"],
 | 
			
		||||
            "idp": {
 | 
			
		||||
                "": "https://example.com/saml2/idp/SSOService.php",
 | 
			
		||||
            }
 | 
			
		||||
            },
 | 
			
		||||
            "authn_requests_signed": True,
 | 
			
		||||
            "logout_requests_signed": True,
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    #"xmlsec_binary" : "/opt/local/bin/xmlsec1",
 | 
			
		||||
@@ -370,4 +372,4 @@ def test_assertion_consumer_service():
 | 
			
		||||
        "location"] == 'https://www.zimride.com/Shibboleth.sso/SAML2/POST'
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    test_1()
 | 
			
		||||
    test_2()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user