def test_allow_one_requester(self, target_context): rules = { TARGET_ENTITY: { "allow": ["test_requester"], } } decide_service = self.create_decide_service(rules) req = InternalRequest(None, "test_requester", None) assert decide_service.process(target_context, req) req.requester = "somebody else" with pytest.raises(SATOSAError): decide_service.process(target_context, req)
def test_allow_takes_precedence_over_deny_all(self, target_context): requester = "test_requester" rules = { TARGET_ENTITY: { "allow": requester, "deny": ["*"], } } decide_service = self.create_decide_service(rules) req = InternalRequest(None, requester, None) assert decide_service.process(target_context, req) req.requester = "somebody else" with pytest.raises(SATOSAError): decide_service.process(target_context, req)