Skip to content

Conversation

@vladimir-mencl-eresearch
Copy link
Collaborator

Fix an issue where invalid config might lead to an ValueError object being used as a databasse object, leading to application errors later.

Rather fail fast by properly raising the exception.

Fix an issue where invalid config might lead to an ValueError object
being used as a databasse object, leading to application errors later.

Rather fail fast by properly raising the exception.
@c00kiemon5ter c00kiemon5ter merged commit 970abcb into IdentityPython:master Nov 8, 2022
@c00kiemon5ter
Copy link
Member

Thanks! I guess this slipped through by mistake.

@vladimir-mencl-eresearch vladimir-mencl-eresearch deleted the fix-raise-invalid-uri branch November 8, 2022 13:50
vladimir-mencl-eresearch added a commit to REANNZ/SATOSA that referenced this pull request Nov 9, 2022
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`.
c00kiemon5ter pushed a commit to IdentityPython/SATOSA that referenced this pull request Nov 9, 2022
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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants