@@ -48,56 +48,84 @@ def setup_class(self):
48
48
49
49
self ._resp_ = server .create_authn_response (
50
50
IDENTITY ,
51
- "id12" , # in_response_to
52
- "http://lingon.catalogix.se:8087/" ,
53
- # consumer_url
54
- "urn:mace:example.com:saml:roland:sp" ,
55
- # sp_entity_id
56
- name_id = name_id )
51
+ in_response_to = "id12" ,
52
+ destination = "http://lingon.catalogix.se:8087/" ,
53
+ sp_entity_id = "urn:mace:example.com:saml:roland:sp" ,
54
+ name_id = name_id ,
55
+ )
57
56
58
57
self ._sign_resp_ = server .create_authn_response (
59
58
IDENTITY ,
60
- "id12" , # in_response_to
61
- "http://lingon.catalogix.se:8087/" , # consumer_url
62
- "urn:mace:example.com:saml:roland:sp" , # sp_entity_id
59
+ in_response_to = "id12" ,
60
+ destination = "http://lingon.catalogix.se:8087/" ,
61
+ sp_entity_id = "urn:mace:example.com:saml:roland:sp" ,
63
62
name_id = name_id ,
64
- sign_assertion = True )
63
+ sign_assertion = True ,
64
+ )
65
65
66
66
self ._resp_authn = server .create_authn_response (
67
67
IDENTITY ,
68
- "id12" , # in_response_to
69
- "http://lingon.catalogix.se:8087/" , # consumer_url
70
- "urn:mace:example.com:saml:roland:sp" , # sp_entity_id
68
+ in_response_to = "id12" ,
69
+ destination = "http://lingon.catalogix.se:8087/" ,
70
+ sp_entity_id = "urn:mace:example.com:saml:roland:sp" ,
71
+ name_id = name_id ,
72
+ authn = AUTHN ,
73
+ )
74
+
75
+ self ._resp_issuer_none = server .create_authn_response (
76
+ IDENTITY ,
77
+ in_response_to = "id12" ,
78
+ destination = "http://lingon.catalogix.se:8087/" ,
79
+ sp_entity_id = "urn:mace:example.com:saml:roland:sp" ,
71
80
name_id = name_id ,
72
- authn = AUTHN )
81
+ )
82
+ self ._resp_issuer_none .issuer = None
73
83
74
84
conf = config .SPConfig ()
75
85
conf .load_file ("server_conf" )
76
86
self .conf = conf
77
87
78
88
def test_1 (self ):
79
89
xml_response = ("%s" % (self ._resp_ ,))
80
- resp = response_factory (xml_response , self .conf ,
81
- return_addrs = [
82
- "http://lingon.catalogix.se:8087/" ],
83
- outstanding_queries = {
84
- "id12" : "http://localhost:8088/sso" },
85
- timeslack = TIMESLACK , decode = False )
90
+ resp = response_factory (
91
+ xml_response , self .conf ,
92
+ return_addrs = ["http://lingon.catalogix.se:8087/" ],
93
+ outstanding_queries = {"id12" : "http://localhost:8088/sso" },
94
+ timeslack = TIMESLACK ,
95
+ decode = False ,
96
+ )
86
97
87
98
assert isinstance (resp , StatusResponse )
88
99
assert isinstance (resp , AuthnResponse )
89
100
90
101
def test_2 (self ):
91
102
xml_response = self ._sign_resp_
92
- resp = response_factory (xml_response , self .conf ,
93
- return_addrs = [
94
- "http://lingon.catalogix.se:8087/" ],
95
- outstanding_queries = {
96
- "id12" : "http://localhost:8088/sso" },
97
- timeslack = TIMESLACK , decode = False )
103
+ resp = response_factory (
104
+ xml_response ,
105
+ self .conf ,
106
+ return_addrs = ["http://lingon.catalogix.se:8087/" ],
107
+ outstanding_queries = {"id12" : "http://localhost:8088/sso" },
108
+ timeslack = TIMESLACK ,
109
+ decode = False ,
110
+ )
111
+
112
+ assert isinstance (resp , StatusResponse )
113
+ assert isinstance (resp , AuthnResponse )
114
+
115
+ def test_issuer_none (self ):
116
+ xml_response = ("%s" % (self ._resp_issuer_none ,))
117
+ resp = response_factory (
118
+ xml_response ,
119
+ self .conf ,
120
+ return_addrs = ["http://lingon.catalogix.se:8087/" ],
121
+ outstanding_queries = {"id12" : "http://localhost:8088/sso" },
122
+ timeslack = TIMESLACK ,
123
+ decode = False ,
124
+ )
98
125
99
126
assert isinstance (resp , StatusResponse )
100
127
assert isinstance (resp , AuthnResponse )
128
+ assert resp .issuer () == ""
101
129
102
130
@mock .patch ('saml2.time_util.datetime' )
103
131
def test_false_sign (self , mock_datetime ):
0 commit comments