Skip to content

Conversation

@kushalshit27
Copy link
Contributor

@kushalshit27 kushalshit27 commented Nov 18, 2025

🔧 Changes

Upgrading node-auth0 from v4 to v5. This is a necessary upgrade because all new Auth0 features and dependency patches will be released on v5 in future.

Requires Node.js ^20.19.0, ^22.12.0, or ^24.0.0.

🔖 Note:

This is an internal package update that should not impact any existing operations.

📚 References
https://github.com/auth0/node-auth0/releases/tag/v5.0.0

🔬 Testing

Deploy CLI commands like import, export

📝 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)

- package.json: update auth0 from ^4.30.0 to ^5.0.0
- package-lock.json: update auth0 from 4.30.0 to 5.0.0
- .gitignore: add .github/chatmodes/* and .github/prompts/*
- Updated ClientHandler to utilize Management.Client type and adjusted client retrieval methods.
- Refactored ConnectionsHandler to replace deprecated methods with Management API equivalents, including pagination and client updates.
- Modified CustomDomainsHandler to align with Management.CustomDomain type and updated API calls.
- Adjusted DatabaseHandler to use Management API for connections and clients, ensuring compatibility with new methods.
- Enhanced EmailProviderHandler to utilize Management API for email provider operations.
- Updated EmailTemplateHandler to reflect changes in email template retrieval and updates using Management API.
- Refactored FlowVaultHandler to streamline flow connection management with Management API.
- Simplified FlowHandler to improve flow retrieval and connection mapping using Management API.
- Revised FormsHandler to utilize Management API for forms and flows, enhancing data retrieval.
- Updated GuardianFactorProvidersHandler to align with Management API for factor provider operations.
- Refactored GuardianFactorTemplatesHandler to utilize Management API for managing factor templates.
- Adjusted GuardianFactorsHandler to use Management API for factor management.
- Updated GuardianPhoneFactorMessageTypesHandler to align with Management API for message types.
- Refactored GuardianPhoneFactorSelectedProviderHandler to utilize Management API for selected provider operations.
- Updated GuardianPoliciesHandler to align with Management API for policy management.
- Refactored HooksHandler to utilize Management API for hook management and secret handling.
- Adjusted LogStreamsHandler to use Management API for log stream retrieval.
- Updated NetworkACLsHandler to utilize Management API for network ACL management, including creation and deletion.
- src/tools/auth0/handlers/clientGrants.ts: export ClientGrant type for external usage
- src/tools/auth0/handlers/organizations.ts: refactor organization client grants handling and improve method calls
- src/tools/auth0/handlers/pages.ts: refactor client calls to use Management API
- src/tools/auth0/handlers/phoneProvider.ts: update phone provider methods to use Management API
- src/tools/auth0/handlers/prompts.ts: refactor prompts to utilize Management API
- src/tools/auth0/handlers/resourceServers.ts: change resource server methods to use Management API
- src/tools/auth0/handlers/roles.ts: update roles handling to use Management API
- src/tools/auth0/handlers/rules.ts: replace Rule import with Management and update rules retrieval method
- src/tools/auth0/handlers/rulesConfigs.ts: change rulesConfigs retrieval method to list
- src/tools/auth0/handlers/scimHandler.ts: replace ConnectionCreate import with Management and update SCIM methods
- src/tools/auth0/handlers/selfServiceProfiles.ts: replace custom text enums with Management and update self-service profile methods
- src/tools/auth0/handlers/tenant.ts: refactor Tenant type to use Management API response
- src/tools/auth0/handlers/themes.ts: refactor Theme type to use Management API response and update theme handling methods
- src/tools/auth0/handlers/triggers.ts: update trigger methods to use new Management API structure
- src/context/directory/handlers/clientGrants.ts: replace getAll with list for resource servers and clients
- src/context/directory/handlers/resourceServers.ts: replace getAll with list for clients
- src/context/index.ts: comment out retry configuration in ManagementClient
- src/context/yaml/handlers/clientGrants.ts: replace getAll with list for clients
- src/context/yaml/handlers/resourceServers.ts: replace getAll with list for clients
- src/keywordPreservation.ts: handle undefined string in doesHaveKeywordMarker
- src/tools/auth0/handlers/actions.ts: extend Action type with deployed property
- src/tools/auth0/handlers/resourceServers.ts: define ResourceServer type
- src/tools/constants.ts: update email template type to Management.EmailTemplateNameEnum
- src/tools/utils.ts: handle undefined input in keywordReplace function
- src/types.ts: update resourceServers type to Management.ResourceServer[]
- src/utils.ts: handle undefined input in sanitize and convertClientIdToName functions
- src/tools/auth0/client.ts: improve getEntity function to handle array responses and legacy object structures
- src/tools/auth0/client.ts: update checkpointPaginator and pagePaginator to handle zero total cases
- src/tools/auth0/client.ts: refactor pagedClient to use Object.create for client inheritance
- src/tools/auth0/handlers/default.ts: rename getAll method to list for consistency in APIHandler
- src/tools/auth0/client.ts: add JSONApiResponseWithPage type for improved response structure
- src/tools/auth0/client.ts: set default page size for checkpoint pagination
- src/tools/auth0/client.ts: streamline fetching logic for checkpoint pagination
- src/tools/auth0/client.ts: update total response handling for pagePaginator
- src/tools/auth0/handlers/organizations.ts: refactor update logic for enabled connections
- src/tools/auth0/handlers/organizations.ts: streamline addition of enabled connections
- src/tools/auth0/handlers/organizations.ts: simplify deletion of enabled connections
- src/tools/auth0/handlers/organizations.ts: replace list call with custom method for fetching enabled connections
- src/tools/auth0/handlers/organizations.ts: add method to retrieve all enabled connections with pagination
…use class context

feat(src/tools/auth0/handlers/forms.ts): add getForms method for fetching form details
- src/keywordPreservation.ts: format function parameters for readability
- src/tools/auth0/handlers/branding.ts: format updateUniversalLogin call for consistency
- src/tools/auth0/handlers/connections.ts: simplify connection listing syntax
- src/tools/auth0/handlers/customDomains.ts: format delete and update functions
- src/tools/auth0/handlers/default.ts: standardize spacing in function definitions
- src/tools/auth0/handlers/emailProvider.ts: format create call for clarity
- src/tools/auth0/handlers/flowVaultConnections.ts: format type declaration
- src/tools/auth0/handlers/flows.ts: add update function to flow handler
- src/tools/auth0/handlers/forms.ts: add update function to forms handler
- src/tools/auth0/handlers/guardianFactorTemplates.ts: format setTemplates calls
- src/tools/auth0/handlers/guardianPhoneFactorMessageTypes.ts: format getMessageTypes call
- src/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.ts: format getSelectedProvider call
- src/tools/auth0/handlers/hooks.ts: format hook retrieval logic
- src/tools/auth0/handlers/pages.ts: format update client call
- src/tools/auth0/handlers/prompts.ts: format promise handling in generator
- src/tools/auth0/handlers/resourceServers.ts: format enum declarations and add update function
- src/tools/auth0/handlers/themes.ts: format delete and update theme calls
…r action updates

feat(src/tools/auth0/handlers/actions.ts): add update function to ActionHandler
feat(src/tools/auth0/handlers/clients.ts): add update function to ClientHandler for client updates
…or client grants

feat(src/tools/auth0/handlers/databases.ts): fix parameter handling in update method
…destructure client_id parameter

feat(src/tools/auth0/handlers/default.ts): change let to const for data variable in update payload processing
fix: unit test handler 2

fix: unit test 3

fix: unit test 4

fix: unit test final
… src/context/index.ts

refactor(index): define explicit type for cliCommands in src/index.ts
fix(default): remove unused import from src/tools/auth0/handlers/default.ts
feat(networkACLs): add objString method to format NetworkACL objects in src/tools/auth0/handlers/networkACLs.ts
fix(prompts): remove maxRetries parameter from prompts API calls in src/tools/auth0/handlers/prompts.ts
feat(themes): add read_only_background property to theme schema in src/tools/auth0/handlers/themes.ts
refactor(tools): define explicit type for tools export in src/tools/index.ts
refactor(utils): specify return type for stripIdentifiers function in src/utils.ts
chore(tsconfig): update target and module settings in tsconfig.json
src/tools/auth0/handlers/prompts.ts: replace conditional assignment with nullish coalescing

fix(auth0): ensure stage function is a valid function
src/tools/auth0/index.ts: add type check for stage function

refactor(userAttributeProfiles.tests): rename getAll to list for consistency
test/tools/auth0/handlers/userAttributeProfiles.tests.js: update method names in tests

refactor(utils): rename getAll to list for userAttributeProfiles
test/utils.js: update mock implementation for consistency
…on options

- src/tools/auth0/handlers/selfServiceProfiles.ts: simplify fetching of getStartedText
- src/tools/auth0/handlers/selfServiceProfiles.ts: remove unnecessary pagination options
- src/tools/auth0/handlers/scimHandler.ts: update scimConfiguration assignment to use response directly
- src/tools/auth0/handlers/scimHandler.ts: add check for connection_id before setting scimConfiguration
- src/tools/auth0/handlers/scimHandler.ts: update getScimConfiguration return type for better type safety
- test/tools/auth0/handlers/prompts.tests.ts: change rendering.list to return array directly
- test/tools/auth0/handlers/prompts.tests.ts: remove unused _getRestClient mock
feat(scimHandler.tests.js): streamline stub response
- test/tools/auth0/handlers/scimHandler.tests.js: simplify getScimConfiguration stub response
feat(selfServiceProfiles.tests.js): enhance mock responses and method names
- test/tools/auth0/handlers/selfServiceProfiles.tests.js: adjust promise resolution for empty data
- test/tools/auth0/handlers/selfServiceProfiles.tests.js: rename getAll to list for consistency
- package.json: bump auth0 version to ^5.1.0
- package.json: bump js-yaml version to ^4.1.1
- package-lock.json: update auth0 version to 5.1.0
- package-lock.json: update js-yaml version to 4.1.1
…ttackProtection mock methods

- Updated botDetection, breachedPasswordDetection, captcha, and suspiciousIpThrottling to use 'get' and 'update' methods.
- Simplified error handling for fetching configurations.
- Adjusted test cases to reflect new method structure for attack protection settings.
feat(test/tools/auth0/handlers/organizations.tests.js): refactor organization handler methods to use new pagination response
…st for consistency

feat(test/tools/auth0/handlers/customDomains.test.ts): rename getAll to list for consistency
feat(test/tools/auth0/handlers/databases.tests.js): rename getAll to list for consistency
…ePaginatedResponse with mockPagedData for consistency

feat(test/utils.js): refactor mockPagedData to include total count in response
…nagementClient

feat(src/tools/auth0/handlers/guardianFactorProviders.ts): remove TODO comment regarding validation of changes
feat(src/tools/auth0/handlers/guardianFactorTemplates.ts): remove TODO comment regarding validation of changes
- test/e2e/recordings/should-dump-without-throwing-an-error.json: change client_id from p6AdI4eB3aIQ90CHsBP4rSo7KS0oeKmg to wIkGgCzD5FjG37vxaj11fUPbUw83iTj7
- test/e2e/recordings/should-dump-without-throwing-an-error.json: update connection ID from con_85Lq3efegcuZcVni to con_YQIQ8h72LqqSXD75
- test/e2e/recordings/should-dump-without-throwing-an-error.json: modify path for connections API to include take=50
- test/e2e/recordings/should-dump-without-throwing-an-error.json: change email template paths and responses
- test/e2e/recordings/should-dump-without-throwing-an-error.json: update brute-force protection and bot detection API responses
- test/e2e/recordings/should-dump-without-throwing-an-error.json: adjust pagination parameters for various API calls
- test/e2e/recordings/should-dump-without-throwing-an-error.json: remove deprecated user attribute profiles from response
@kushalshit27 kushalshit27 changed the title migration to node auth v5 [draft] migration to node auth v5 Nov 18, 2025
@kushalshit27 kushalshit27 changed the title [draft] migration to node auth v5 [draft] migration to node auth0 v5 Nov 18, 2025
- package.json: change Node.js version requirement from >=20.19.0 to >=22.12.0
- package-lock.json: change Node.js version requirement from >=20.19.0 to >=22.12.0
…or e2e_test_as_node_module

- .circleci/config.yml: change Node.js image from 22.4.1 to 22.12.0 for e2e_test_as_cli
- .circleci/config.yml: change Node.js image from 22.4.1 to 22.12.0 for does_typescript_compile
- .circleci/config.yml: update unit_test to use Node.js version 22.12.0
- .circleci/config.yml: add deploy_beta job and test_and_deploy_beta workflow
- package.json: update Node.js engine requirement to >=20.19.0
- package-lock.json: update Node.js engine requirement to >=20.19.0
- package.json: change Node.js version from >=20.19.0 to >=22.12.0
- package-lock.json: change Node.js version from >=20.19.0 to >=22.12.0
- package.json: update eslint and typescript-eslint packages to latest versions
- package.json: simplify linting scripts by removing ignore patterns
- package.json: update node engine requirement to >=20.19.0
- test/tools/auth0/handlers/customDomains.test.ts: rename args to _args for clarity
- test/tools/auth0/handlers/prompts.tests.ts: rename options to _options for clarity
- test/tools/auth0/handlers/actions.tests.js: change expected type from object to string
- test/tools/auth0/handlers/clientGrants.tests.js: change expected type from object to string
- test/tools/auth0/handlers/clients.tests.js: change expected type from object to string
- test/tools/auth0/handlers/connections.tests.js: change expected type from object to string
- test/tools/auth0/handlers/databases.tests.js: change expected type from object to string
- test/tools/auth0/handlers/flows.tests.js: change expected type from object to string
- test/tools/auth0/handlers/forms.tests.js: change expected type from object to string
- test/tools/auth0/handlers/logStreams.test.ts: update delete function to expect string
- test/tools/auth0/handlers/resourceServers.tests.js: change expected type from object to string
- test/tools/auth0/handlers/userAttributeProfiles.tests.js: change expected type from object to string
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 75.05669% with 110 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.35%. Comparing base (4b2d31c) to head (b17915f).

Files with missing lines Patch % Lines
src/tools/auth0/handlers/default.ts 57.14% 23 Missing and 1 partial ⚠️
src/tools/auth0/client.ts 50.00% 12 Missing and 3 partials ⚠️
src/tools/auth0/handlers/themes.ts 80.48% 3 Missing and 5 partials ⚠️
...rc/tools/auth0/handlers/guardianFactorProviders.ts 22.22% 7 Missing ⚠️
src/tools/auth0/handlers/organizations.ts 88.37% 4 Missing and 1 partial ⚠️
src/tools/auth0/handlers/hooks.ts 20.00% 4 Missing ⚠️
src/tools/auth0/handlers/networkACLs.ts 60.00% 2 Missing and 2 partials ⚠️
src/tools/auth0/handlers/phoneProvider.ts 55.55% 2 Missing and 2 partials ⚠️
src/tools/auth0/handlers/prompts.ts 81.81% 2 Missing and 2 partials ⚠️
src/tools/auth0/handlers/scimHandler.ts 60.00% 3 Missing and 1 partial ⚠️
... and 18 more
Additional details and impacted files
@@            Coverage Diff             @@
##             beta    #1207      +/-   ##
==========================================
+ Coverage   80.04%   80.35%   +0.30%     
==========================================
  Files         134      134              
  Lines        5293     5268      -25     
  Branches     1080     1069      -11     
==========================================
- Hits         4237     4233       -4     
- Misses        592      603      +11     
+ Partials      464      432      -32     

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

@kushalshit27 kushalshit27 changed the title [draft] migration to node auth0 v5 [draft] Upgrading node-auth0 from v4 to v5 Nov 19, 2025
@kushalshit27 kushalshit27 marked this pull request as ready for review November 20, 2025 04:07
@kushalshit27 kushalshit27 requested a review from a team as a code owner November 20, 2025 04:07
@kushalshit27 kushalshit27 changed the title [draft] Upgrading node-auth0 from v4 to v5 Upgrading node-auth0 from v4 to v5 Nov 20, 2025
@kushalshit27 kushalshit27 changed the title Upgrading node-auth0 from v4 to v5 Upgrading node-auth0 from v4 to v5 - beta Nov 20, 2025
@kushalshit27 kushalshit27 changed the title Upgrading node-auth0 from v4 to v5 - beta Upgrading node-auth0 from v4 to v5 [beta] Nov 20, 2025
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