@@ -43,10 +43,12 @@ def test_metadata():
43
43
conf = config .Config ()
44
44
conf .load_file ("idp_conf_mdb" )
45
45
UMU_IDP = 'https://idp.umu.se/saml2/idp/metadata.php'
46
+ # Set up a Metadata store
46
47
mds = MetadataStore (ONTS .values (), ATTRCONV , conf ,
47
48
disable_ssl_certificate_validation = True )
48
49
49
- mds .imp ({"local" : [full_path ("swamid-1.0.xml" )]})
50
+ # Import metadata from local file.
51
+ mds .imp ({"local" : [full_path ("swamid-2.0.xml" )]})
50
52
assert len (mds ) == 1 # One source
51
53
52
54
export_mdstore_to_mongo_db (mds , "metadata" , "test" )
@@ -63,23 +65,29 @@ def test_metadata():
63
65
'https://idp.umu.se/saml2/idp/SSOService.php' ]
64
66
65
67
_name = name (mds [UMU_IDP ])
66
- assert _name == u'Umeå University (SAML2) '
68
+ assert _name == u'Ume \xe5 University'
67
69
certs = mds .certs (UMU_IDP , "idpsso" , "signing" )
68
70
assert len (certs ) == 1
69
71
70
72
sps = mds .with_descriptor ("spsso" )
71
- assert len (sps ) == 108
73
+ assert len (sps ) == 356
72
74
73
- wants = mds .attribute_requirement ('https://connect8.sunet.se/shibboleth' )
74
- lnamn = [d_to_local_name (mds .attrc , attr ) for attr in wants ["optional" ]]
75
+ wants = mds .attribute_requirement ('https://connect.sunet.se/shibboleth' )
76
+ assert wants ["optional" ] == []
77
+ lnamn = [d_to_local_name (mds .attrc , attr ) for attr in wants ["required" ]]
75
78
assert _eq (lnamn , ['eduPersonPrincipalName' , 'mail' , 'givenName' , 'sn' ,
76
- 'eduPersonScopedAffiliation' ])
79
+ 'eduPersonScopedAffiliation' , 'eduPersonAffiliation' ])
77
80
78
- wants = mds .attribute_requirement ('https://beta.lobber.se/shibboleth' )
79
- assert wants ["required" ] == []
81
+ wants = mds .attribute_requirement (
82
+ "https://gidp.geant.net/sp/module.php/saml/sp/metadata.php/default-sp" )
83
+ # Optional
80
84
lnamn = [d_to_local_name (mds .attrc , attr ) for attr in wants ["optional" ]]
81
- assert _eq (lnamn , ['eduPersonPrincipalName' , 'mail' , 'givenName' , 'sn' ,
82
- 'eduPersonScopedAffiliation' , 'eduPersonEntitlement' ])
85
+ assert _eq (lnamn , ['displayName' , 'commonName' , 'schacHomeOrganization' ,
86
+ 'eduPersonAffiliation' , 'schacHomeOrganizationType' ])
87
+ # Required
88
+ lnamn = [d_to_local_name (mds .attrc , attr ) for attr in wants ["required" ]]
89
+ assert _eq (lnamn , ['eduPersonTargetedID' , 'mail' ,
90
+ 'eduPersonScopedAffiliation' ])
83
91
84
92
if __name__ == "__main__" :
85
93
test_metadata ()
0 commit comments