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

Async All the Way #621

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Async All the Way #621

wants to merge 6 commits into from

Conversation

padrepitufo
Copy link

@padrepitufo padrepitufo commented May 18, 2024

Changes

I am probably using this wrong and need guidance.

I want to use auth0-python asynchronously. My set up is close to this tutorial. I noticed it depends on PyJWT and I realized the library blocks. I have made an accompanying PR (that this PR points to) but I doubt I'm the first one to use this - I'm probably just using it wrong.

Main change in usage would be (using the tutorial example as my sample):

try:
    signing_key = self.jwks_client.get_signing_key_from_jwt(  # 👈 this lines changes
        token.credentials
    ).key
except jwt.exceptions.PyJWKClientError as error:
    raise UnauthorizedException(str(error))
except jwt.exceptions.DecodeError as error:
    raise UnauthorizedException(str(error))

becomes

try:
    payload  = await self.jwks_client.get_signing_key_from_jwt(  # 👈 this lines changes
        token.credentials
    )
    signing_key = payload.key
except jwt.exceptions.PyJWKClientError as error:
    raise UnauthorizedException(str(error))
except jwt.exceptions.DecodeError as error:
    raise UnauthorizedException(str(error))

References

... None

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • [ not yet ] This change adds unit test coverage
  • [ not yet ] This change adds integration test coverage
  • [ partially ] This change has been tested on the latest version of the platform/language or why not no test coverage added because I suspect I'm doing this wrong anyways

Checklist

@padrepitufo
Copy link
Author

Any guidance that @evansims @jpadilla @adamjmcgrath could lend would be much appreciated

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.

1 participant