Skip to content

refactor: migrate management SDK usage from go-auth0 v2 to v3 - #1597

Open
developerkunal wants to merge 1 commit into
mainfrom
feat/go-auth0-v3-migration
Open

refactor: migrate management SDK usage from go-auth0 v2 to v3#1597
developerkunal wants to merge 1 commit into
mainfrom
feat/go-auth0-v3-migration

Conversation

@developerkunal

Copy link
Copy Markdown
Contributor

🔧 Changes

Migrates the CLI's Management API usage from go-auth0 v2 to v3. v3 keeps v2's client initialization, package layout, and option pattern, so this is effectively an import-path change plus a naming refresh. It lays the groundwork for the upcoming priority-resource commands, which will be built on v3.

  • Updated every github.com/auth0/go-auth0/v2 import to github.com/auth0/go-auth0/v3 across the internal/cli, internal/auth0, and internal/display packages.
  • Renamed the v2-flavored identifiers to their v3 equivalents: the managementv2 import alias, the APIV2 struct and its AttackProtectionBotDetectionAPIV2 / EventsAPIV2 interfaces, the NewAPIV2 constructor, the apiv2 field on the cli struct, and initializeManagementClientV2.
  • Regenerated the phone-notification-template mock (make test-mocks) against the v3 interface.
  • Dropped go-auth0/v2 from go.mod; the repo now depends on v1 + v3.

No command surface, flags, or output behavior change. None of the tightened v3 types (connection attribute identifiers, role pagination, phone backoff enum, federated tokensets, session-transfer device-binding enum) are referenced in the CLI, so the migration required no type fixes.

📚 References

Part of the CLI Priority Resource Coverage effort. This is the first PR in a stack that will add Connections, Client Grants, Flows & Forms, and Sessions + Refresh Tokens commands on top of go-auth0 v3.

🔬 Testing

  • go build ./... and go vet ./... pass.
  • Unit tests pass for the affected packages (internal/cli, internal/auth0, internal/display).
  • make lint surfaces only pre-existing issues in files untouched by this change.
  • The generated command docs are unchanged, since no command surface was modified.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

Update all go-auth0/v2 imports to go-auth0/v3 and rename the v2-flavored
identifiers (APIV2, apiv2, managementv2 alias, NewAPIV2,
initializeManagementClientV2) to their v3 equivalents. Regenerate the
phone-notification-template mock and drop go-auth0/v2 from go.mod. No
command surface or behavior changes; v3 is a near drop-in for v2 and none
of the tightened v3 types are referenced.
@developerkunal
developerkunal requested a review from a team as a code owner August 5, 2026 14:37
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