Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Jwt auth #982

Merged
merged 7 commits into from
Sep 11, 2018
Merged

Jwt auth #982

merged 7 commits into from
Sep 11, 2018

Conversation

tmbo
Copy link
Member

@tmbo tmbo commented Sep 11, 2018

Proposed changes:

  • added possibility to specify jwt as an authentication source instead of tokens

Status (please check what you already did):

  • made PR ready for code review
  • added some tests for the functionality
  • updated the documentation
  • updated the changelog

@tmbo tmbo requested a review from ricwo September 11, 2018 18:15
Copy link
Contributor

@ricwo ricwo left a comment

Choose a reason for hiding this comment

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

Just one question, looks great otherwise 💯

"""Wraps a request handler with token authentication."""

def decorator(f):
@wraps(f)
def decorated(*args, **kwargs):
provided = request.args.get('token')
if token is None or provided == token:
# noinspection PyProtectedMember
Copy link
Contributor

Choose a reason for hiding this comment

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

should this still be in here?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes because of the access to _decode_jwt_from_headers - for some reason that function is private in the jwt library.

@tmbo tmbo merged commit 15a4c3c into master Sep 11, 2018
@tmbo tmbo deleted the jwt-auth branch September 11, 2018 20:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants