-
Notifications
You must be signed in to change notification settings - Fork 432
Remove unneeded contrib.appengine exceptions #533
Conversation
|
||
|
||
class InvalidXsrfTokenError(Exception): | ||
class InvalidXsrfTokenError(Error): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@nathanielmanistaatgoogle interested to see your thoughts on this breaking change. |
class InvalidClientSecretsError(Exception): | ||
"""The client_secrets.json file is malformed or missing required fields.""" | ||
class Error(Exception): | ||
"""Base error for this module.""" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I like the change, mostly. What valid use cases would we be breaking if we were to just incorporate this now? Do we think that developers have written code that catches |
Probably not, this is likely something experienced when first developing and is uncaught and just manually addressed, if I had to guess. It's not exactly a "recoverable" exception.
Same, but even still we'll probably make the next release 3.0.0. |
After doing some testing, this may not be considered a breaking change after all. Since we are importing |
Cool. I'll likely make the next release 3.0.0 anyways because of the other changes. |
clientsecrets.py class InvalidClientSecretsError(Exception):
"""Main error""" appengine.py class InvalidClientSecretsError(Exception):
"""Duplicated error""" appengine2.py from clientsecrets import InvalidClientSecretsError >>> import appengine
>>> appengine.InvalidClientSecretsError
<class 'appengine.InvalidClientSecretsError'>
>>> import appengine2 as appengine
>>> appengine.InvalidClientSecretsError
<class 'clientsecrets.InvalidClientSecretsError'> |
@@ -477,15 +469,15 @@ def _parse_state_value(state, user): | |||
user: google.appengine.api.users.User, The current user. | |||
|
|||
Raises: | |||
InvalidXsrfTokenError: if the XSRF token is invalid. | |||
ValueError: if the XSRF token is invalid. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
24621b5
to
03db57e
Compare
if xsrfutil.validate_token(xsrf_secret_key(), token, user.user_id(), | ||
action_id=uri): | ||
return uri | ||
return |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Updated |
@nathanielmanistaatgoogle does this look good to merge? |
Hold on @jonparrott , I need to add in @nathanielmanistaatgoogle's last suggestions. I've been working on moving this to py.test today (you mentioned that at the meetup last month) |
* Duplicated InvalidClientSecretsError - Removed * Internal only InvalidXsrfTokenError - Removed
Ok. I amended the commit to include explicitly returning |
@jonparrott: to me this now looks ready to merge. |
Woot. Waiting on |
Thanks, @pferate this is a great change. :D |
Resolving issue #465.
Possible breaking change, so probably wait to add in next major release.