Skip to content

Commit f9f54bf

Browse files
committed
Raise exception when no allowed issuers have been configured
Instead of warning & allowing all issuers.
1 parent 27e8d57 commit f9f54bf

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "inuits_policy_based_auth"
9-
version = "9.4.2"
9+
version = "9.5.0"
1010
description = "Module for securing API endpoints based on policies."
1111
readme = "README.md"
1212
authors = [{ name = "Inuits", email = "developers@inuits.eu" }]

src/inuits_policy_based_auth/authentication/policies/token_based_policies/authlib_flask_oauth2_policy.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,7 @@ def authenticate_token(self, token_string):
222222
try:
223223
issuer = self.__get_issuer_from_token_string(token_string)
224224
if not self.allowed_issuers:
225-
self.logger.warning(
226-
"No allowed issuers configured, allowing all issuers!"
227-
)
225+
raise Exception(f"No allowed issuers configured")
228226
elif issuer not in self.allowed_issuers:
229227
raise Exception(f"Issuer {issuer} not allowed")
230228
jwks = self.__get_jwks(issuer)

0 commit comments

Comments
 (0)