Brings main's `chore: release v1.6.3 (#9081)` commit into next after the
stable release. Conflict resolution:
- `packages/*/package.json`: keep next's `1.7.0-beta.0` (per the release
bot's standard rule: next is always ahead of main in version).
- `packages/*/CHANGELOG.md`: keep both version entries side-by-side. Next's
`1.7.0-beta.0` section stays on top; main's new `1.6.3` section slots in
below. Each entry describes its own branch's release.
- `.changeset/*.md`: restore the 14 changesets git auto-deleted. Next is in
pre-release mode (`.changeset/pre.json` `mode: "pre"`), so changesets
accumulate across beta cuts and are only consumed on `exit-pre`. Main's
release deleted them from main; next must keep them for its own pre-release
accumulator.
- packages/oauth-provider/src/types/zod.ts: make `state` optional in
`verificationValueSchema`. Main's PR #9118 hardened authorization code
validation with a required `state`, but CIMD (next, PR #9159) doesn't send
state in test flows. Per OAuth 2.0 §4.1.1 state is RECOMMENDED, not
REQUIRED. Fixes CIMD token exchange (`401 !== 200`) in ci test and smoke.
- docs/content/docs/plugins/sso.mdx: replace remaining `/sso/saml2/callback/`
references with `/sso/saml2/sp/acs/` to match the endpoint rename from
next's PR #9117. The merge took main verbatim here, regressing docs that
next had already updated.
Resolves conflicts in PR #9115 which the release bot cannot auto-merge.
Conflict resolutions:
- .github/workflows/release.yml: take main's hardened grep fallback (92256a2d0)
- docs/content/docs/plugins/sso.mdx: take main's named-exports refactor verbatim (#9144)
- packages/oauth-provider/src/token.ts: keep next's at_hash sequencing (#9079),
add main's customTokenResponseFields spread and credential helper rename (#9118)
- packages/oauth-provider/src/token.test.ts: keep both new describe blocks
(at_hash in id tokens from next, customTokenResponseFields from main)
Semantic fixes on auto-merged files where git silently dropped main's changes
around next's discriminated-response refactor:
- two-factor/index.ts: restore skipVerificationOnEnable handling in the totp
enablement path
- two-factor/types.ts: restore the skipVerificationOnEnable type field
- two-factor/two-factor.test.ts: narrow the discriminated enable response via
method === "totp" guard
grep -coP outputs "0" to stdout on no matches but exits 1, causing
the || echo 0 fallback to append a second "0". The resulting "0\n0"
value fails the -lt integer comparison. Use || true instead since
grep -c already outputs the correct count.
grep -coP outputs "0" to stdout on no matches but exits 1, causing
the || echo 0 fallback to append a second "0". The resulting "0\n0"
value fails the -lt integer comparison. Use || true instead since
grep -c already outputs the correct count.
- Add empty string fallback before .toLowerCase() to prevent TypeError
when both mapped email attribute and extract.nameID are falsy
- Use validated samlRedirectUrl instead of raw callbackUrl in error
redirect to maintain open-redirect and loop-protection guarantees
Use main's saml-pipeline.ts for SAML response processing, replacing
~1000 lines of duplicated inline code in sso.ts. Port the four
security fixes from #9055 into the pipeline:
- Fix InResponseTo field path (extract.response?.inResponseTo)
- Add Audience Restriction validation
- Fix SessionIndex stored as string, not object
- Fix allowIdpInitiated default to false
Delegate to validateInResponseTo/validateAudience from
response-validation.ts instead of reimplementing inline.
Graft private_key_jwt (RFC 7523) support from #8836 onto main's
pipeline-based sso.ts.