8000 feat!: Consolidate types to root package with consistent naming by fern-api[bot] · Pull Request #692 · auth0/go-auth0 · GitHub
[go: up one dir, main page]

Skip to content

feat!: Consolidate types to root package with consistent naming#692

Merged
developerkunal merged 2 commits intomainfrom
fern-bot/2026-02-05T13-29Z
Feb 5, 2026
Merged

feat!: Consolidate types to root package with consistent naming#692
developerkunal merged 2 commits intomainfrom
fern-bot/2026-02-05T13-29Z

Conversation

@fern-api
Copy link
Contributor
@fern-api fern-api bot commented Feb 5, 2026

🔧 Changes

This PR consolidates all types into the root management package and standardizes naming conventions across the SDK for a better developer experience. While this introduces breaking changes, it simplifies imports and provides consistent, predictable type names.

Why These Breaking Changes?

  • Single import location: All types now available from github.com/auth0/go-auth0/v2/management - no more hunting through sub-packages
  • Consistent naming: Standardized type names that clearly indicate their purpose (e.g., ListFlowsRequestParameters instead of FlowsListRequest)
  • Better discoverability: IDE autocomplete now shows all available types from one package

New Features

Enhanced Password Authentication Controls:

  • ConnectionAPIBehaviorEnum - Control whether passwords are required or optional for API authentication
  • ConnectionSignupBehaviorEnum - Control whether password signups are allowed or blocked
  • ConnectionPasswordAuthenticationMethod.APIBehavior - New field for API behavior configuration
  • ConnectionPasswordAuthenticationMethod.SignupBehavior - New field for signup behavior configuration

Improved Proof-of-Possession Configuration:

  • ResourceServerProofOfPossessionRequiredForEnum - Specify which client types require PoP: public_clients, confidential_clients, or all_clients
  • ResourceServerProofOfPossession.RequiredFor - New granular control over PoP requirements

Job Execution Summaries:

  • GetJobSummary - New type providing execution statistics
  • GetJobResponseContent.Summary - Access job execution metrics (failed, updated, inserted, total operations)

Self-Service Profile Enhancements:

  • Added support for auth0-samlp and okta-samlp strategies

Type Consolidation (Breaking Changes → Better DX)

Type Consolidation (Breaking Changes → Better DX)

All types have been moved to the root management package with consistent naming:

Flows & Executions - Now follow standard <Action><Resource>RequestParameters pattern:

  • FlowsListRequestListFlowsRequestParameters
  • ExecutionsListRequestListFlowExecutionsRequestParameters
  • ExecutionsGetRequestGetFlowExecutionRequestParameters
  • FlowsListRequestHydrateItemListFlowsRequestParametersHydrateEnum
  • ExecutionsGetRequestHydrateItemGetFlowExecutionRequestParametersHydrateEnum

Actions - Consistent naming with other request types:

  • DeployActionVersionRequestBodyParamsDeployActionVersionRequestContent

Attack Protection - Moved from attackprotection sub-package to management:

  • attackprotection.UpdateBruteForceSettingsRequestContentModemanagement.BruteForceProtectionModeEnum
  • attackprotection.UpdateBruteForceSettingsRequestContentShieldsItemmanagement.BruteForceProtectionShieldsEnum

Tenant Settings - Moved from tenants sub-package to management:

  • tenants.UpdateTenantSettingsRequestContentEnabledLocalesItemmanagement.TenantSettingsSupportedLocalesEnum

Result: One import (github.com/auth0/go-auth0/v2/management), consistent naming, easier discovery.

Test Improvements

Updated actions_versions_test.go to follow the project's standard testing pattern:

  • Replaced custom WireMock setup with standardized helper functions (ResetWireMockRequests, VerifyRequestCount)
  • Removed manual stub creation - tests now use centralized WireMock mappings
  • Added request verification to ensure correct API calls
  • Improved test consistency across the codebase

📚 References

  • Auth0 Management API v2 Updates
  • Related to improved authentication controls and client configuration options

🔬 Testing

  • All tests pass with the new type definitions
  • WireMock-based tests updated and verified
  • Linting passes without errors (make lint)
  • No vulnerabilities detected (make check-vuln)

📝 Checklist

  • All new/changed/fixed functionality is covered by tests
  • Documentation updated in reference.md with new types and methods

⚠️ Breaking Changes (With Silver Lining)

Yes, this PR has breaking changes - but they make the SDK significantly better to use. We're consolidating scattered types into one place and fixing inconsistent naming patterns.

The Good News

  • Before: Types scattered across management, management/flows, management/attackprotection, management/tenants
  • After: Everything in management - one import to rule them all
  • Before: Inconsistent naming (FlowsListRequest vs ExecutionsGetRequest)
  • After: Consistent pattern (List<Resource>RequestParameters, Get<Resource>RequestParameters)

What You Need to Update

1. Simplify Your Imports

Before - Multiple imports for types:

import (
    "github.com/auth0/go-auth0/v2/management"
    "github.com/auth0/go-auth0/v2/management/flows"
    "github.com/auth0/go-auth0/v2/management/attackprotection"
    "github.com/auth0/go-auth0/v2/management/tenants"
)

After - One import for everything:

import "github.com/auth0/go-auth0/v2/management"

2. Update Type Names (Following New Consistent Pattern)

Flows - Now consistently named:

// Before
request := &management.FlowsListRequest{
    Page: management.Int(1),
}

// After - follows List<Resource>RequestParameters pattern
request := &management.ListFlowsRequestParameters{
    Page: management.Int(1),
}

Flow Executions:

// Before
request := &management.ExecutionsGetRequest{}

// After - follows Get<Resource>RequestParameters pattern  
request := &management.GetFlowExecutionRequestParameters{}

Action Deployment:

// Before
request := &management.DeployActionVersionRequestBodyParams{}
client.Actions.Versions.Deploy(ctx, actionID, versionID, &request)

// After - consistent with other request content types
request := &management.DeployActionVersionRequestContent{}
client.Actions.Versions.Deploy(ctx, actionID, versionID, request)

3. Use Consolidated Enums (No More Sub-Package Imports)

Attack Protection:

// Before - required attackprotection import
import "github.com/auth0/go-auth0/v2/management/attackprotection"
mode := attackprotection.UpdateBruteForceSettingsRequestContentModeCountPerIdentifier

// After - all from management package
import "github.com/auth0/go-auth0/v2/management"
mode := management.BruteForceProtectionModeEnumCountPerIdentifier

Tenant Locales:

// Before - required tenants import
import "github.com/auth0/go-auth0/v2/managemen
8000
t/tenants"
locales := []*tenants.UpdateTenantSettingsRequestContentEnabledLocalesItem{
    tenants.UpdateTenantSettingsRequestContentEnabledLocalesItemEn.Ptr(),
}

// After - all from management package
import "github.com/auth0/go-auth0/v2/management"
locales := []*management.TenantSettingsSupportedLocalesEnum{
    management.TenantSettingsSupportedLocalesEnumEn.Ptr(),
}

Quick Migration Steps

  1. Remove sub-package imports - Keep only github.com/auth0/go-auth0/v2/management
  2. Update type names - Use your IDE's find & replace with these mappings:
    • FlowsListRequestListFlowsRequestParameters
    • ExecutionsListRequestListFlowExecutionsRequestParameters
    • ExecutionsGetRequestGetFlowExecutionRequestParameters
    • DeployActionVersionRequestBodyParamsDeployActionVersionRequestContent
    • attackprotection.Update prefix → management.BruteForceProtection prefix
    • tenants.UpdateTenantSettingsRequestContentEnabledLocalesItemmanagement.TenantSettingsSupportedLocalesEnum
  3. Let your IDE help - Type management. and let autocomplete show you all available types
  4. Run your tests - Compiler will catch anything missed

The result: Cleaner code with fewer imports and more predictable type names.

@fern-api fern-api bot requested a review from a team as a code owner February 5, 2026 13:30
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 8.08824% with 125 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.70%. Comparing base (705b2a9) to head (8928523).

Files with missing lines Patch % Lines
management/jobs.go 15.49% 58 Missing and 2 partials ⚠️
management/connections.go 0.00% 34 Missing ⚠️
management/resource_servers.go 0.00% 19 Missing ⚠️
management/flows.go 0.00% 8 Missing ⚠️
management/self_service_profiles.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #692      +/-   ##
==========================================
+ Coverage   20.68%   20.70%   +0.01%     
==========================================
  Files         318      315       -3     
  Lines      130123   130090      -33     
==========================================
+ Hits        26918    26929      +11     
+ Misses     101238   101192      -46     
- Partials     1967     1969       +2     

☔ 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.

@developerkunal developerkunal changed the title 🌿 Fern Regeneration -- February 5, 2026 feat!: Consolidate types to root package with consistent naming Feb 5, 2026
@developerkunal developerkunal enabled auto-merge (squash) February 5, 2026 14:21
@developerkunal developerkunal merged commit ec77ef0 into main Feb 5, 2026
4 checks passed
@developerkunal developerkunal deleted the fern-bot/2026-02-05T13-29Z branch February 5, 2026 14:30
@developerkunal developerkunal mentioned this pull request Feb 11, 2026
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.

3 participants

0