Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: MFA http contract parity fixes#2555

Merged
tusharpandey13 merged 14 commits into
mainfrom
fix/mfa-http-contract-parity-breaking
Apr 22, 2026
Merged

fix: MFA http contract parity fixes#2555
tusharpandey13 merged 14 commits into
mainfrom
fix/mfa-http-contract-parity-breaking

Conversation

@tusharpandey13
Copy link
Copy Markdown
Contributor

@tusharpandey13 tusharpandey13 commented Mar 13, 2026

Align MFA route handlers with Auth0 HTTP API contract.
Route handlers become transparent proxies: accept snake_case requests, return snake_case responses.
Camelization moves to SDK client boundary (ClientMfaClient, ServerMfaClient).

Changes

Wire Format

  • Token extraction: Authorization: Bearer header only (query param removed)
  • Camelization logic moved from business layer -> mfa client. This enables Auth0-like HTTP calls to and from the SDK's MFA proxy layer.
  • Renamed /auth/mfa/enroll/auth/mfa/associate (matches Auth0)

factorType: Added support for factorType instead of raw authenticatorTypes/oobChannels

Tests

888 pass, 0 fail (50 files)

…mfa_token in only headers; add support for factor_type; rename /auth/enroll to /auth/mfa/associate;
@tusharpandey13 tusharpandey13 requested a review from a team as a code owner March 13, 2026 10:13
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 79.18782% with 41 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.02%. Comparing base (4d58651) to head (0ac223f).

Files with missing lines Patch % Lines
src/utils/mfa-transform-utils.ts 70.27% 22 Missing ⚠️
src/server/mfa/server-mfa-client.ts 0.00% 8 Missing ⚠️
src/utils/mfa-validation-utils.ts 33.33% 3 Missing and 5 partials ⚠️
src/server/auth-client.ts 92.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2555      +/-   ##
==========================================
- Coverage   90.20%   90.02%   -0.18%     
==========================================
  Files          63       63              
  Lines        7606     7703      +97     
  Branches     1622     1647      +25     
==========================================
+ Hits         6861     6935      +74     
- Misses        733      756      +23     
  Partials       12       12              

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

@tusharpandey13 tusharpandey13 changed the title fix: MFA http contract parity fixes (breaking) fix: MFA http contract parity fixes Mar 13, 2026
@gyaneshgouraw-okta
Copy link
Copy Markdown
Contributor

@tusharpandey13 in the PR description we should highlight breaking changes for customers under a breaking change section.
That would help community members visiting this PR.

Comment thread src/client/mfa/index.ts Outdated
Comment thread src/utils/mfa-transform-utils.ts Outdated
Comment thread src/utils/mfa-transform-utils.ts Outdated
Comment thread src/utils/mfa-transform-utils.ts
@nandan-bhat
Copy link
Copy Markdown
Contributor

LGTM

@tusharpandey13 tusharpandey13 merged commit 3fae94f into main Apr 22, 2026
9 checks passed
@tusharpandey13 tusharpandey13 deleted the fix/mfa-http-contract-parity-breaking branch April 22, 2026 17:44
@tusharpandey13 tusharpandey13 mentioned this pull request Apr 22, 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.

4 participants