feat!: replace get_user_info with get_user_by_id#1
Merged
Conversation
- Deprecate `get_user_info` and introduced `get_user_by_id` for fetching user details using Auth0 Management API. - Implement caching for user details with automatic cache invalidation on update. - Update test cases to use the new method and validated caching behavior. - Enhance session handling with a lightweight `get_user_info` for retrieving `userinfo` from the current session. - Updated documentation to reflect changes in API usage. BREAKING CHANGE: `get_user_info(user_id: str)` has been replaced with `get_user_by_id(user_id: str)`. Consumers should update their code to use the new method.
6a48e0d to
fc979b5
Compare
fc979b5 to
3793d94
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a significant refactor to the Auth0 OAuth client, focusing on improved clarity and caching for user profile retrieval. The main change is the split of user info retrieval into two distinct methods:
get_user_by_id(fetches and caches full user profiles from the Auth0 Management API) andget_user_info(returns the userinfo payload from the current session). This is accompanied by expanded type definitions, updated documentation, and comprehensive test coverage for the new caching logic.API and Functionality Changes
get_user_info(user_id)method withget_user_by_id(user_id), which now fetches and caches the full user profile from the Auth0 Management API for 24 hours, with cache invalidation on user updates. [1] [2] [3]get_user_info(request)method to return the userinfo payload from the current session, orNoneif no session exists. [1] [2]Type Definitions and Documentation
UserinfoPayloadand introduced new types (UserDetailsPayload,IdentityResponseBody,IdentityProfileData,AddressPayload) to more accurately represent Auth0's user and identity data structures. [1] [2]Codebase and Test Updates
get_user_by_idfor full user profile fetches, and updated mocks accordingly. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Versioning
0.4.0to reflect these breaking and additive changes.