Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

Auth0-python v5.0.0 introduces breaking changes in the Management API: responses are now Pydantic models instead of dicts, pagination uses a new SyncPager class, and the exception module location changed.

Changes

Management API Client

  • Auth0ManagementClient with updated initialization syntax
  • Auth0Error import moved from auth0 to auth0.authentication.exceptions

Pagination Refactor

  • Replaced dict-based pagination (response['users'], response['total']) with SyncPager API
  • Used pager.iter_pages() for iteration, pager.items for data, pager.response.total for counts
  • Added model_dump() to convert Pydantic models to dicts for backward compatibility with existing code

Test Infrastructure

  • Created MockItem and MockPager classes to mock v5 API structure
  • Updated all test mocks from dict returns to MockPager instances

Example

# Before (v4)
response = interface.users.list(q=query, fields=fields, page=0, per_page=50)
users.extend(response["users"])
total = response["total"]

# After (v5)
pager = interface.users.list(q=query, fields=fields, page=0, per_page=50)
for page in pager.iter_pages():
    users.extend([user.model_dump() for user in page.items])
total = pager.response.total

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits February 10, 2026 10:04
Co-authored-by: pylipp <10617122+pylipp@users.noreply.github.com>
- Updated imports: Auth0 -> ManagementClient, Auth0Error location
- Updated pagination to use SyncPager with .items and .response
- Convert Pydantic models to dicts with model_dump() for backward compatibility
- Updated test mocks to return MockPager objects

Co-authored-by: pylipp <10617122+pylipp@users.noreply.github.com>
Co-authored-by: pylipp <10617122+pylipp@users.noreply.github.com>
- Simplified pagination logging to show page number correctly
- Refactored MockItem to use dedicated class instead of lambda

Co-authored-by: pylipp <10617122+pylipp@users.noreply.github.com>
Copilot AI changed the title [WIP] Update auth0-python dependency to version 5.0.0 Migrate backend to auth0-python v5.0.0 Feb 10, 2026
Copilot AI requested a review from pylipp February 10, 2026 10:15
@sentry
Copy link

sentry bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.99%. Comparing base (3e6b6d9) to head (dd84b2c).

Additional details and impacted files
@@                           Coverage Diff                           @@
##           dependabot/pip/back/auth0-python-5.0.0    #2576   +/-   ##
=======================================================================
  Coverage                                   77.99%   77.99%           
=======================================================================
  Files                                         281      281           
  Lines                                       20098    20098           
  Branches                                     2029     2029           
=======================================================================
  Hits                                        15676    15676           
  Misses                                       4376     4376           
  Partials                                       46       46           
Flag Coverage Δ
frontend 70.03% <ø> (ø)
sharedComponents 61.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- still waiting for one issue with users.create and default fields to be
  resolved in 5.1.0
@pylipp pylipp marked this pull request as ready for review February 10, 2026 11:50
@pylipp pylipp merged commit c6ffc4b into dependabot/pip/back/auth0-python-5.0.0 Feb 10, 2026
8 of 10 checks passed
@pylipp pylipp deleted the copilot/sub-pr-2568 branch February 10, 2026 11:50
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