feat: migrate Auth0.ManagementApi from v7 to v8 (Fern SDK)#27
Merged
Conversation
- Bump Auth0.ManagementApi from 7.46.0 to 8.1.0 in Web.csproj - Add Microsoft.Bcl.AsyncInterfaces 9.0.6 to resolve IAsyncEnumerable type needed for Pager<T> iteration - Rewrite UserManagementHandler to use v8 API patterns: - Constructor: ManagementApiClient(token:, clientOptions:) - Users.ListAsync(ListUsersRequestParameters, cancellationToken:) - Users.Roles.ListAsync(userId, ListUserRolesRequestParameters, cancellationToken:) - Users.Roles.AssignAsync(userId, AssignUserRolesRequestContent, cancellationToken:) - Users.Roles.DeleteAsync(userId, DeleteUserRolesRequestContent, cancellationToken:) - Roles.ListAsync(ListRolesRequestParameters, cancellationToken:) - Iterate Pager<T> responses with await foreach - Add using Auth0.ManagementApi.Users for request/response types - Use user.Name instead of user.FullName (removed in v8 UserResponseSchema) - Bump ServiceDefaults and test project packages to latest versions Working as Sam (Senior Backend Engineer) Closes #26 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
SummarySummary
CoverageAppHost - 0%
Domain - 93.4%
ServiceDefaults - 0%
Web - 68.1%
|
Contributor
|
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.
Summary
Closes #26
Migrates
Auth0.ManagementApifrom v7 (7.46.0) to v8 (8.1.0, Fern-generated SDK) and rewritesUserManagementHandler.csto use the new API patterns.Working as Sam (Senior Backend Engineer)
Changes
src/Web/Web.csprojAuth0.ManagementApifrom7.46.0→8.1.0Microsoft.Bcl.AsyncInterfaces 9.0.6(required forPager<T>async enumeration in net10.0)src/Web/Features/UserManagement/UserManagementHandler.csComplete rewrite to use v8 API patterns:
new ManagementApiClient(token:, clientOptions: new ClientOptions { BaseUrl = ... })client.Users.ListAsync(new ListUsersRequestParameters(), cancellationToken: ct)→Pager<UserResponseSchema>iterated withawait foreachclient.Users.Roles.ListAsync(userId, new ListUserRolesRequestParameters(), cancellationToken: ct)→Pager<Role>client.Users.Roles.AssignAsync(userId, new AssignUserRolesRequestContent { Roles = [...] }, cancellationToken: ct)client.Users.Roles.DeleteAsync(userId, new DeleteUserRolesRequestContent { Roles = [...] }, cancellationToken: ct)client.Roles.ListAsync(new ListRolesRequestParameters(), cancellationToken: ct)→Pager<Role>using Auth0.ManagementApi.Users;for request/response typesuser.Nameinstead ofuser.FullName(removed in v8UserResponseSchema)Other
.csprojfilesServiceDefaults, test tooling packages to latest versionsTesting