Skip to content

Commit

Permalink
Fix and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
baszoetekouw committed Jun 5, 2024
1 parent 5dcd630 commit 5154e7d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion server/test/api/test_user_saml.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,23 @@ def test_proxy_authz_no_aup(self):
self.assertEqual(res["status"]["result"], "interrupt")

network_service = Service.query.filter(Service.entity_id == service_network_entity_id).one()
parameters = urlencode({"service_id": network_service.uuid4, "service_name": network_service.name})
parameters = urlencode({"service_id": network_service.uuid4, "service_name": network_service.name, "status": 99})
self.assertEqual(f"{self.app.app_config.base_url}/service-aup?{parameters}", res["status"]["redirect_url"], )

def test_proxy_authz_free_ride(self):
network_service = Service.query.filter(Service.entity_id == service_network_entity_id).one()
network_service.non_member_users_access_allowed = True
self.save_entity(network_service)

# user unknown is SBS
res = self.post("/api/users/proxy_authz", response_status_code=200,
body={"user_id": "urn:gandalf", "service_id": service_network_entity_id,
"issuer_id": "issuer.com", "uid": "gandalf", "homeorganization": "lothlorien.middleearth",
"user_email": "[email protected]"})
self.assertEqual(res["status"]["result"], "interrupt")

network_service = Service.query.filter(Service.entity_id == service_network_entity_id).one()
parameters = urlencode({"service_id": network_service.uuid4, "service_name": network_service.name, "status": 97})
self.assertEqual(f"{self.app.app_config.base_url}/service-aup?{parameters}", res["status"]["redirect_url"], )

def test_proxy_authz_no_user(self):
Expand Down

0 comments on commit 5154e7d

Please sign in to comment.