Skip to content

Commit c629dd5

Browse files
fix: OpenIDConnectFrontend: check for empty db_uri (#420)
With IdentityPython/pyop#44 merged, OpenIDConnectFrontend init fails when `db_uri` is not set, as `StorageBase.type` now throws a `ValueError` for db_uri values that do not match one of the recognised storage types (including when `db_uri` is `None`). Fix this by guarding the `StorageBase.type` with a pythonic test whether `db_uri` was provided. Same test already guards `StorageBase.from_uri`, add it also to the `StorageBase.type` call made to determine `self.stateless`.
1 parent 7b37f69 commit c629dd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/satosa/frontends/openid_connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __init__(self, auth_req_callback_func, internal_attributes, conf, base_url,
7272
)
7373

7474
db_uri = self.config.get("db_uri")
75-
self.stateless = StorageBase.type(db_uri) == "stateless"
75+
self.stateless = db_uri and StorageBase.type(db_uri) == "stateless"
7676
self.user_db = (
7777
StorageBase.from_uri(db_uri, db_name="satosa", collection="authz_codes")
7878
if db_uri and not self.stateless

0 commit comments

Comments
 (0)