Skip to content

chore: upgrade ajv from v6 to v8#1301

Open
philsch wants to merge 1 commit intoauth0:masterfrom
philsch:feat/upgrade-ajv-v6-to-v8
Open

chore: upgrade ajv from v6 to v8#1301
philsch wants to merge 1 commit intoauth0:masterfrom
philsch:feat/upgrade-ajv-v6-to-v8

Conversation

@philsch
Copy link

@philsch philsch commented Feb 16, 2026

Upgrade ajv from 6.12.6 to 8.18.0 and add ajv-formats companion package for format keyword support extracted from core in v8. With this upgrade - although breaking - I try to address https://security.snyk.io/vuln/SNYK-JS-AJV-15274295.

🔧 Changes

  • Upgrade ajv to version 8.18.0
  • Update import path from 'ajv/lib/ajv' to 'ajv' (v8 package structure)
  • Using the constructor options strict: false, unicodeRegExp: false to be closer to the v6 behavior
    • Replace nullable constructor option with strict: false and convert schema-level nullable: true to standard type: ['string', 'null']
    • Add unicodeRegExp: false to avoid regex compilation errors with existing URI patterns in themes handler
  • Rewrite prompts customText schema to use propertyNames with enum constraints instead of enumerating 195k+ property nodes (81 languages x 36 prompts x 67 screens) which caused stack overflow in v8's code generator (⚠️ please check if this change is matching your expectations)
  • Update test assertions for v8 error message changes ("should" -> "must", minLength wording)

📚 References

🔬 Testing

The PR should not contain any change in business logic.

📝 Checklist

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

Upgrade ajv from 6.12.6 to 8.18.0 and add ajv-formats companion
package for format keyword support extracted from core in v8.

Key changes:
- Update import path from 'ajv/lib/ajv' to 'ajv' (v8 package structure)
- Replace removed `nullable` constructor option with `strict: false` and
  convert schema-level `nullable: true` to standard `type: ['string', 'null']`
- Add `unicodeRegExp: false` to avoid regex compilation errors with
  existing URI patterns in themes handler
- Rewrite prompts customText schema to use propertyNames with enum
  constraints instead of enumerating 195k+ property nodes
  (81 languages x 36 prompts x 67 screens) which caused stack overflow
  in v8's code generator.
- Update test assertions for v8 error message changes
  ("should" -> "must", minLength wording)
@philsch philsch requested a review from a team as a code owner February 16, 2026 16:37
@kushalshit27
Copy link
Contributor

Thank you for submitting this PR! We really appreciate your effort in helping us upgrade AJV from v6 to v8. We will review the changes shortly to verify the impact on auth0-deploy-cli and ensure a smooth transition without breaking changes. Thanks again for helping us keep the project secure!

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

Comments