Skip to content

Commit

Permalink
Minox fix in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-woelfle committed May 15, 2024
1 parent 9c26bd8 commit 9f7bcca
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions source/tests/service/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,8 @@ def _generate_payload(self, issuer, audience, extra=None):

def test_endpoints_protected(self, openid_like_test_idp):
"""
Check that the endpoints are protected, this test is especially
important as `validate_jwt` is not responsible for rejecting requests
without a JWT, this is done automatically by FastAPI as we depend
on a OpenIdConnect instance. However, it might not be obvious in future
how crucial this dependency is, hence we check it here explicitly.
Check that the endpoints are protected, i.e. that calls without
a header are rejected.
"""

test_issuer = openid_like_test_idp[1]
Expand All @@ -696,7 +693,7 @@ def test_endpoints_protected(self, openid_like_test_idp):
with patch.dict(os.environ, envs):
with APIInProcess(API_DEFAULT_KWARGS) as base_url_root:
self.call_and_check_status_code(
base_url_root, expected_status_code=403
base_url_root, expected_status_code=401
)

def test_valid_token_accepted(self, openid_like_test_idp):
Expand Down

0 comments on commit 9f7bcca

Please sign in to comment.