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

Add AsyncAuth0 to share a session among many services #443

Merged
merged 3 commits into from
Oct 12, 2022

Conversation

adamjmcgrath
Copy link
Contributor

@adamjmcgrath adamjmcgrath commented Oct 11, 2022

Changes

Add feature to share a single session across multiple services in Auth0

async with Auth0('domain', 'mgmt_api_token') as auth0:
    user = await auth0.users.get_async(user_id)
    connection = await auth0.connections.get_async(connection_id)

# or

auth0 = Auth0('domain', 'mgmt_api_token');
session = SingletonAuth0AiohttpClientSession.get_aiohttp_client_session()
auth0.set_session(session)
user = await auth0.users.get_async(user_id)
connection = await auth0.connections.get_async(connection_id)
await session.close()

References

fixes #317

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.

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@adamjmcgrath adamjmcgrath added the review:medium Medium review label Oct 11, 2022
@adamjmcgrath adamjmcgrath requested a review from a team as a code owner October 11, 2022 14:21
@adamjmcgrath
Copy link
Contributor Author

Build is failing because keybase.io is down

image

Copy link
Contributor

@Widcket Widcket left a comment

Choose a reason for hiding this comment

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

LGTM, just fixed a Latin abbreviation in the API docs.

@adamjmcgrath adamjmcgrath merged commit f8be872 into master Oct 12, 2022
@adamjmcgrath adamjmcgrath deleted the auth0-async branch October 12, 2022 10:38
@adamjmcgrath adamjmcgrath mentioned this pull request Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:medium Medium review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AsyncIO - Allow providing an initial aiohttp session to the auth0 client
2 participants