Lazy Load Provider Config#173
Open
infohash wants to merge 2 commits intozamzterz:mainfrom
Open
Conversation
Adds lazy loading of provider config to allow blueprint views to be decorated by auth decorators
|
I just tested. If endpoints are decorated before the call to endpoints.py:108: in <module>
@auth.oidc_auth("default")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <flask_pyoidc.flask_pyoidc.OIDCAuthentication object at 0x7a2fdbe79ad0>, provider_name = 'default'
def oidc_auth(self, provider_name: str):
> if provider_name not in self._provider_configurations:
E TypeError: argument of type 'NoneType' is not iterable |
Contributor
Author
|
Thanks for noticing. I'll explore a better approach. |
Contributor
Author
|
@azmeuk All it needed was a check to see if |
|
👌 This works great! |
|
@zamzterz Any chance of a new release with this PR, to pypi? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds lazy loading of provider config to allow blueprint views to be decorated by auth decorators without initializing auth first. This will provide flexibility to import
authinstance in blueprint modules before the Flaskappinstance becomes ready.Fixes:
init_app#171