Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove AssertionErrors #40

Merged
merged 5 commits into from
Nov 9, 2016
Merged

remove AssertionErrors #40

merged 5 commits into from
Nov 9, 2016

Conversation

leohemsted
Copy link
Contributor

replace AssertionErrors with new TokenDecodeError subclasses

if your provided JWT token is missing either the 'iss' or 'iat' fields,
we now raise TokenIssuerError or TokenIssuedAtError respectively,
rather than AssertionErrors

if your provided JWT token is missing either the 'iss' or 'iat' fields,
we now raise TokenIssuerError or TokenIssuedAtError respectively,
rather than AssertionErrors
replacing AssertionError with TokenDecodeError changes the signature
of our auth functions - if the user is expecting an AssertionError
this is a breaking change
quis
quis previously requested changes Nov 7, 2016
Copy link
Member

@quis quis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could do with a test for missing iat, otherwise 👍 .

@leohemsted
Copy link
Contributor Author

@quis iat test is found in admin app, since i wanted to make sure i was also capturing our authhandler's logic

alphagov/notifications-api@f089b75#diff-707b2a6eab3566cfd44abdb93239c959R67

in practice we get the issuer before we decode the token so a bad method invocation was not caught by notifications-api tests, so ensure that the decode_jwt_token method is well tested
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