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.
PS: This worked before IdentityPython/pyop#44 was merged because StorageBase.type used to return the ValueError object, which evaluated as not matching string "stateless". I also thought about changing StorageBase.type to return None for db_uri of value None, but I think it's cleaner to handle it this way and keep the StorageBase.type contract clear: Only valid values allowed.
All Submissions:
[X] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
[X] Have you added an explanation of what problem you are trying to solve with this PR?
[X] Have you added information on what your changes do and why you chose this as your solution?
[N/A] Have you written new tests for your changes?
[N/A] Does your submission pass tests?
[N/A] This project follows PEP8 style guide. Have you run your code against the 'flake8' linter?
With IdentityPython/pyop#44 merged, OpenIDConnectFrontend init fails when
db_uri
is not set, asStorageBase.type
now throws aValueError
for db_uri values that do not match one of the recognised storage types (including whendb_uri
isNone
).Fix this by guarding the
StorageBase.type
with a pythonic test whetherdb_uri
was provided.Same test already guards
StorageBase.from_uri
, add it also to theStorageBase.type
call made to determineself.stateless
.PS: This worked before IdentityPython/pyop#44 was merged because
StorageBase.type
used to return theValueError
object, which evaluated as not matching string"stateless"
. I also thought about changingStorageBase.type
to returnNone
fordb_uri
of valueNone
, but I think it's cleaner to handle it this way and keep theStorageBase.type
contract clear: Only valid values allowed.All Submissions: