This repository has been archived by the owner on Oct 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Return None instead of raising AuthenticationFailed #8
Comments
None
instead of raising AuthenticationFailed
Ah good point, I will try to get to this on Saturday, if you want to have it earlier feel free to make a PR 👊 |
I can take knock it out in the next day or two. |
it is pretty much just removing the exceptions.py file, and that exception, and returning None instead, updating tests. |
mshenfield
added a commit
to coreyar/swipe-for-rights-api
that referenced
this issue
Mar 8, 2018
This adds a UserVote model and API endpoint. To accomplish this required some extra scaffolding: * Factories to generate models * Making IsAuthRequired the default permission * Addressing audiolion/apistar-jwt#8 - see annotations.py and authentication.py * Passing JWT tokens to requests - see auth_utils.py I chose to keep UserVote in a separate collection istead of embedding in the user document or a subset of a Bill document. Can be convinced otherwise.
mshenfield
added a commit
to mshenfield/apistar-jwt
that referenced
this issue
Mar 10, 2018
This modifies the JWTAuthentication provider to return None instead of raising an Exception if the token cannot be created, or is invalid. This matches the expectations outlined in audiolion#8, and closes audiolion#8. ConfigurationErrors are special cased and allowed to bubble up. It seems better to have the server crash quickly then to silently not provide authentication for a static and fixable issue.
audiolion
pushed a commit
that referenced
this issue
Mar 12, 2018
JWTAuthentication properly returns None on auth failure. This modifies the JWTAuthentication provider to return None instead of raising an Exception if the token cannot be created, or is invalid. This matches the expectations outlined in #8, and closes #8. ConfigurationErrors are special cased and allowed to bubble up. It seems better to have the server crash quickly then to silently not provide authentication for a static and fixable issue. * Add test coverage for ConfigurationError bubbling up
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Based on the API Star Authorization documentation
This allows having multiple authentication mechanisms, and to globally set
JWTAuthentication
in theauthentication
setting w/out it requiring authorization for every endpoint. Right now, settingwill 401 if a JWT hasn't been set, which doesn't work well for public endpoints.
Version Info:
Thanks for creating this btw - it's been extremely handy for a side project.
The text was updated successfully, but these errors were encountered: