@@ -242,7 +242,7 @@ def test_create_attribute_query_3(self):
242
242
req_id , req = self .client .create_attribute_query (
243
243
"https://aai-demo-idp.switch.ch/idp/shibboleth" ,
244
244
"_e7b68a04488f715cda642fbdd90099f5" ,
245
- format = saml . NAMEID_FORMAT_TRANSIENT ,
245
+ format = NAMEID_FORMAT_TRANSIENT ,
246
246
message_id = "id1" )
247
247
248
248
assert isinstance (req , samlp .AttributeQuery )
@@ -253,12 +253,15 @@ def test_create_attribute_query_3(self):
253
253
assert req .issue_instant
254
254
assert req .issuer .text == "urn:mace:example.com:saml:roland:sp"
255
255
nameid = req .subject .name_id
256
- assert nameid .format == saml . NAMEID_FORMAT_TRANSIENT
256
+ assert nameid .format == NAMEID_FORMAT_TRANSIENT
257
257
assert nameid .text == "_e7b68a04488f715cda642fbdd90099f5"
258
258
259
259
def test_create_auth_request_0 (self ):
260
260
ar_str = "%s" % self .client .create_authn_request (
261
- "http://www.example.com/sso" , message_id = "id1" )[1 ]
261
+ "http://www.example.com/sso" ,
262
+ message_id = "id1" ,
263
+ nameid_format = NAMEID_FORMAT_TRANSIENT ,
264
+ )[1 ]
262
265
263
266
ar = samlp .authn_request_from_string (ar_str )
264
267
assert ar .assertion_consumer_service_url == ("http://lingon.catalogix"
@@ -270,7 +273,7 @@ def test_create_auth_request_0(self):
270
273
assert ar .issuer .text == "urn:mace:example.com:saml:roland:sp"
271
274
nid_policy = ar .name_id_policy
272
275
assert nid_policy .allow_create is None
273
- assert nid_policy .format == saml . NAMEID_FORMAT_TRANSIENT
276
+ assert nid_policy .format == NAMEID_FORMAT_TRANSIENT
274
277
275
278
node_requested_attributes = None
276
279
for e in ar .extensions .extension_elements :
@@ -892,7 +895,7 @@ def test_sign_then_encrypt_assertion(self):
892
895
subject = factory (saml .Subject , text = "_aaa" ,
893
896
name_id = factory (
894
897
saml .NameID ,
895
- format = saml . NAMEID_FORMAT_TRANSIENT )),
898
+ format = NAMEID_FORMAT_TRANSIENT )),
896
899
attribute_statement = do_attribute_statement (
897
900
{
898
901
("" , "" , "sn" ): ("Jeter" , "" ),
@@ -976,7 +979,7 @@ def test_sign_then_encrypt_assertion2(self):
976
979
self .client .config .entityid ,
977
980
self .server .config .attribute_converters ,
978
981
self .server .config .getattr ("policy" , "idp" ),
979
- name_id = factory (saml .NameID , format = saml . NAMEID_FORMAT_TRANSIENT ),
982
+ name_id = factory (saml .NameID , format = NAMEID_FORMAT_TRANSIENT ),
980
983
issuer = self .server ._issuer (),
981
984
authn_class = INTERNETPROTOCOLPASSWORD ,
982
985
authn_auth = "http://www.example.com/login" ,
@@ -1037,7 +1040,7 @@ def test_sign_then_encrypt_assertion_advice_1(self):
1037
1040
'in_response_to' : "_012345" ,
1038
1041
'subject_confirmation_method' : saml .SCM_BEARER
1039
1042
}
1040
- name_id = factory (saml .NameID , format = saml . NAMEID_FORMAT_TRANSIENT )
1043
+ name_id = factory (saml .NameID , format = NAMEID_FORMAT_TRANSIENT )
1041
1044
1042
1045
farg = add_path (
1043
1046
{},
@@ -1149,7 +1152,7 @@ def test_sign_then_encrypt_assertion_advice_2(self):
1149
1152
farg ['assertion' ]['subject' ]['subject_confirmation' ],
1150
1153
['subject_confirmation_data' , 'recipient' ,
1151
1154
"http://lingon.catalogix.se:8087/" ])
1152
- name_id = factory (saml .NameID , format = saml . NAMEID_FORMAT_TRANSIENT )
1155
+ name_id = factory (saml .NameID , format = NAMEID_FORMAT_TRANSIENT )
1153
1156
1154
1157
assertion_1 = asser_1 .construct (
1155
1158
self .client .config .entityid ,
@@ -1796,7 +1799,7 @@ def test_create_attribute_query_3(self):
1796
1799
req_id , req = self .client .create_attribute_query (
1797
1800
"https://aai-demo-idp.switch.ch/idp/shibboleth" ,
1798
1801
"_e7b68a04488f715cda642fbdd90099f5" ,
1799
- format = saml . NAMEID_FORMAT_TRANSIENT ,
1802
+ format = NAMEID_FORMAT_TRANSIENT ,
1800
1803
message_id = "id1" )
1801
1804
1802
1805
assert isinstance (req , samlp .AttributeQuery )
@@ -1807,12 +1810,15 @@ def test_create_attribute_query_3(self):
1807
1810
assert req .issue_instant
1808
1811
assert req .issuer .text == "urn:mace:example.com:saml:roland:sp"
1809
1812
nameid = req .subject .name_id
1810
- assert nameid .format == saml . NAMEID_FORMAT_TRANSIENT
1813
+ assert nameid .format == NAMEID_FORMAT_TRANSIENT
1811
1814
assert nameid .text == "_e7b68a04488f715cda642fbdd90099f5"
1812
1815
1813
1816
def test_create_auth_request_0 (self ):
1814
1817
ar_str = "%s" % self .client .create_authn_request (
1815
- "http://www.example.com/sso" , message_id = "id1" )[1 ]
1818
+ "http://www.example.com/sso" ,
1819
+ message_id = "id1" ,
1820
+ nameid_format = NAMEID_FORMAT_TRANSIENT ,
1821
+ )[1 ]
1816
1822
1817
1823
ar = samlp .authn_request_from_string (ar_str )
1818
1824
assert ar .assertion_consumer_service_url == ("http://lingon.catalogix"
@@ -1824,7 +1830,7 @@ def test_create_auth_request_0(self):
1824
1830
assert ar .issuer .text == "urn:mace:example.com:saml:roland:sp"
1825
1831
nid_policy = ar .name_id_policy
1826
1832
assert nid_policy .allow_create is None
1827
- assert nid_policy .format == saml . NAMEID_FORMAT_TRANSIENT
1833
+ assert nid_policy .format == NAMEID_FORMAT_TRANSIENT
1828
1834
1829
1835
node_requested_attributes = None
1830
1836
for e in ar .extensions .extension_elements :
@@ -2464,7 +2470,7 @@ def test_sign_then_encrypt_assertion(self):
2464
2470
subject = factory (saml .Subject , text = "_aaa" ,
2465
2471
name_id = factory (
2466
2472
saml .NameID ,
2467
- format = saml . NAMEID_FORMAT_TRANSIENT )),
2473
+ format = NAMEID_FORMAT_TRANSIENT )),
2468
2474
attribute_statement = do_attribute_statement (
2469
2475
{
2470
2476
("" , "" , "sn" ): ("Jeter" , "" ),
@@ -2548,7 +2554,7 @@ def test_sign_then_encrypt_assertion2(self):
2548
2554
self .client .config .entityid ,
2549
2555
self .server .config .attribute_converters ,
2550
2556
self .server .config .getattr ("policy" , "idp" ),
2551
- name_id = factory (saml .NameID , format = saml . NAMEID_FORMAT_TRANSIENT ),
2557
+ name_id = factory (saml .NameID , format = NAMEID_FORMAT_TRANSIENT ),
2552
2558
issuer = self .server ._issuer (),
2553
2559
authn_class = INTERNETPROTOCOLPASSWORD ,
2554
2560
authn_auth = "http://www.example.com/login" ,
@@ -2609,7 +2615,7 @@ def test_sign_then_encrypt_assertion_advice_1(self):
2609
2615
'in_response_to' : "_012345" ,
2610
2616
'subject_confirmation_method' : saml .SCM_BEARER
2611
2617
}
2612
- name_id = factory (saml .NameID , format = saml . NAMEID_FORMAT_TRANSIENT )
2618
+ name_id = factory (saml .NameID , format = NAMEID_FORMAT_TRANSIENT )
2613
2619
2614
2620
farg = add_path (
2615
2621
{},
@@ -2722,7 +2728,7 @@ def test_sign_then_encrypt_assertion_advice_2(self):
2722
2728
farg ['assertion' ]['subject' ]['subject_confirmation' ],
2723
2729
['subject_confirmation_data' , 'recipient' ,
2724
2730
"http://lingon.catalogix.se:8087/" ])
2725
- name_id = factory (saml .NameID , format = saml . NAMEID_FORMAT_TRANSIENT )
2731
+ name_id = factory (saml .NameID , format = NAMEID_FORMAT_TRANSIENT )
2726
2732
2727
2733
assertion_1 = asser_1 .construct (
2728
2734
self .client .config .entityid ,
0 commit comments