Skip to content

Commit 3797d44

Browse files
committed
feat: use upstream setting for OIDC strict audience verification
1 parent c8cb3a4 commit 3797d44

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

‎backend/application/access_control/services/oidc_authentication.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ def _validate_jwt(self, token: str) -> Optional[User]:
6262
options = Options(
6363
verify_signature=True,
6464
verify_aud=True,
65-
# Stackable: audience verification is deliberately not strict, see f945bc9b.
66-
# Upstream made this configurable via settings.oidc_strict_audience (default True),
67-
# but flipping it on would break existing deployments, so it stays hardcoded.
68-
strict_aud=False,
65+
strict_aud=settings.oidc_strict_audience,
6966
require=["exp"],
7067
verify_iat=True,
7168
verify_exp=True,

‎backend/unittests/access_control/services/test_oidc_authentication.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def test_validate_jwt_message(self, get_signing_key_mock, pyjwkclient_mock, jwks
128128
options={
129129
"verify_signature": True,
130130
"verify_aud": True,
131-
"strict_aud": False,
131+
"strict_aud": True,
132132
"require": ["exp"],
133133
"verify_iat": True,
134134
"verify_exp": True,
@@ -221,7 +221,7 @@ def test_validate_jwt_user_not_found(
221221
options={
222222
"verify_signature": True,
223223
"verify_aud": True,
224-
"strict_aud": False,
224+
"strict_aud": True,
225225
"require": ["exp"],
226226
"verify_iat": True,
227227
"verify_exp": True,
@@ -275,7 +275,7 @@ def test_validate_jwt_user_found(
275275
options={
276276
"verify_signature": True,
277277
"verify_aud": True,
278-
"strict_aud": False,
278+
"strict_aud": True,
279279
"require": ["exp"],
280280
"verify_iat": True,
281281
"verify_exp": True,

0 commit comments

Comments
 (0)