Support for metadata mdfile type
This commit is contained in:
		
							
								
								
									
										128801
									
								
								tests/swamid.md
									
									
									
									
									
								
							
							
						
						
									
										128801
									
								
								tests/swamid.md
									
									
									
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -6,7 +6,7 @@ from saml2.mdstore import MetadataStore
 | 
			
		||||
from saml2.mdstore import destinations
 | 
			
		||||
from saml2.mdstore import name
 | 
			
		||||
 | 
			
		||||
from saml2 import md
 | 
			
		||||
from saml2 import md, sigver
 | 
			
		||||
from saml2 import BINDING_SOAP
 | 
			
		||||
from saml2 import BINDING_HTTP_REDIRECT
 | 
			
		||||
from saml2 import BINDING_HTTP_POST
 | 
			
		||||
@@ -69,6 +69,9 @@ METADATACONF = {
 | 
			
		||||
    },
 | 
			
		||||
    "6": {
 | 
			
		||||
        "local": [full_path("metasp.xml")]
 | 
			
		||||
    },
 | 
			
		||||
    "8": {
 | 
			
		||||
        "mdfile": [full_path("swamid.md")]
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -236,5 +239,15 @@ def test_sp_metadata():
 | 
			
		||||
    assert _eq([n["friendly_name"] for n in req["required"]],
 | 
			
		||||
               ['surName', 'givenName', 'mail'])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_metadata_file():
 | 
			
		||||
    sec_config.xmlsec_binary = sigver.get_xmlsec_binary(["/opt/local/bin"])
 | 
			
		||||
    mds = MetadataStore(ONTS.values(), ATTRCONV, sec_config,
 | 
			
		||||
                        disable_ssl_certificate_validation=True)
 | 
			
		||||
 | 
			
		||||
    mds.imp(METADATACONF["8"])
 | 
			
		||||
    print len(mds.keys())
 | 
			
		||||
    assert len(mds.keys()) == 560
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    test_swami_1()
 | 
			
		||||
    test_metadata_file()
 | 
			
		||||
 
 | 
			
		||||
@@ -18,14 +18,14 @@ def test_construct_0():
 | 
			
		||||
    url = sp.create_discovery_service_request("http://example.com/saml/disco",
 | 
			
		||||
                                              "https://example.com/saml/sp.xml")
 | 
			
		||||
 | 
			
		||||
    assert url ==  "http://example.com/saml/disco?entityID=https%3A%2F%2Fexample.com%2Fsaml%2Fsp.xml"
 | 
			
		||||
    assert url == "http://example.com/saml/disco?entityID=https%3A%2F%2Fexample.com%2Fsaml%2Fsp.xml"
 | 
			
		||||
 | 
			
		||||
def test_construct_1():
 | 
			
		||||
    sp = Saml2Client(config_file=dotname("servera_conf"))
 | 
			
		||||
    url = sp.create_discovery_service_request("http://example.com/saml/disco",
 | 
			
		||||
                                              "https://example.com/saml/sp.xml")
 | 
			
		||||
 | 
			
		||||
    assert url ==  "http://example.com/saml/disco?entityID=https%3A%2F%2Fexample.com%2Fsaml%2Fsp.xml"
 | 
			
		||||
    assert url == "http://example.com/saml/disco?entityID=https%3A%2F%2Fexample.com%2Fsaml%2Fsp.xml"
 | 
			
		||||
 | 
			
		||||
def test_construct_deconstruct_request():
 | 
			
		||||
    sp = Saml2Client(config_file=dotname("servera_conf"))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user