diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2020-09-29 12:27:22 +0300 |
---|---|---|
committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2020-10-28 00:01:45 +0200 |
commit | 59913a155ce06c6fe4e43ea1b15586e3d59bafb3 (patch) | |
tree | 8accb74f2350925b0593a806c481b767bd432203 /tests/test_50_server.py | |
parent | 524b70d3ef4523b40b999ee2cd0008f41a31c437 (diff) | |
download | pysaml2-59913a155ce06c6fe4e43ea1b15586e3d59bafb3.tar.gz |
Return the ResponseLocation before falling back to Locationfeature-logout-response-location
ResponseLocation [Optional]
Optionally specifies a different location to which response messages sent as part of
the protocol or profile should be sent. The allowable syntax of this URI depends on
the protocol binding.
The ResponseLocation attribute is used to enable different endpoints to be specified for
receiving request and response messages associated with a protocol or profile, not as a
means of load-balancing or redundancy (multiple elements of this type can be included
for this purpose). When a role contains an element of this type pertaining to a protocol
or profile for which only a single type of message (request or response) is applicable,
then the ResponseLocation attribute is unused. [E41]If the ResponseLocation attribute is
omitted, any response messages associated with a protocol or profile may be assumed to
be handled at the URI indicated by the Location attribute.
ArtifactResolutionService, SingleSignOnService and NameIDMappingService MUST omit the
ResponseLocation attribute. This is enforced here, but metadata with such service
declarations and such attributes should not have been part of the metadata store in the
first place.
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Diffstat (limited to 'tests/test_50_server.py')
-rw-r--r-- | tests/test_50_server.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/test_50_server.py b/tests/test_50_server.py index 93fbc6c6..2aee6d8a 100644 --- a/tests/test_50_server.py +++ b/tests/test_50_server.py @@ -2297,19 +2297,19 @@ def _logout_request(conf_file): class TestServerLogout(): - def test_1(self): with closing(Server("idp_slo_redirect_conf")) as server: req_id, request = _logout_request("sp_slo_redirect_conf") print(request) bindings = [BINDING_HTTP_REDIRECT] response = server.create_logout_response(request, bindings) - binding, destination = server.pick_binding("single_logout_service", - bindings, "spsso", - request, response=True) - http_args = server.apply_binding(binding, "%s" % response, destination, - "relay_state", response=True) + binding, destination = server.pick_binding( + "single_logout_service", bindings, "spsso", request + ) + http_args = server.apply_binding( + binding, "%s" % response, destination, "relay_state", response=True + ) assert len(http_args) == 4 assert http_args["headers"][0][0] == "Location" @@ -2322,18 +2322,20 @@ class TestServerLogout(): print(request) bindings = [BINDING_HTTP_POST] response = server.create_logout_response(request, bindings) - binding, destination = server.pick_binding("single_logout_service", - bindings, "spsso", - request, response=True) - http_args = server.apply_binding(binding, "%s" % response, destination, - "relay_state", response=True) + binding, destination = server.pick_binding( + "single_logout_service", bindings, "spsso", request + ) + http_args = server.apply_binding( + binding, "%s" % response, destination, "relay_state", response=True + ) assert len(http_args) == 4 assert len(http_args["data"]) > 0 assert http_args["method"] == "POST" assert http_args['url'] == 'http://lingon.catalogix.se:8087/slo' + if __name__ == "__main__": ts = TestServer1() ts.setup_class() |