Repository navigation
Increase maximum number of alternative origins to 100 - #4261
Merged
Merged
Conversation
Raise the limit on entries in `/.well-known/ii-alternative-origins` from 10 to 100 in the frontend validation, update the specification (including the JSON schema `maxItems`), and adjust the e2e test to list 101 origins so it still exceeds the limit. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xb4gLgdkcBhNJdByGQhiLc
|
✅ No security or compliance issues detected. Reviewed everything up to ceead54. Security OverviewDetected Code Changes
|
Contributor
There was a problem hiding this comment.
Pull request overview
Raises the alternative-origin limit from 10 to 100 across validation, documentation, and e2e coverage.
Changes:
- Increases the frontend validation limit to 100.
- Updates the specification accordingly.
- Adjusts the excessive-entry test fixture to 101 origins.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
validateDerivationOrigin.ts |
Raises the enforced limit. |
ii-spec.mdx |
Documents the new limit. |
alternativeOrigins.spec.ts |
Updates the rejection test to 101 entries. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The e2e rejection fixture never listed the requesting origin, so the sign-in it asserts on failed at the "origin not allowed" check and would have kept passing with the entry limit removed. List the requesting origin among the 101 entries so only the limit can reject it. Add unit cases for both sides of the boundary: exactly 100 entries are accepted and 101 are rejected with the "too many entries" message. The expected maximum is spelled out in the test rather than imported so that lowering the limit in the implementation fails the test instead of silently following along. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xb4gLgdkcBhNJdByGQhiLc
sea-snake
approved these changes
Aug 20, 2026
aterga
enabled auto-merge (squash)
August 20, 2026 14:44
3 of 7 tasks
marc0olo
pushed a commit
to dfinity/developer-docs
that referenced
this pull request
Aug 24, 2026
## Summary - Internet Identity raised the cap on entries in `/.well-known/ii-alternative-origins` from 10 to 100 (dfinity/internet-identity#4261, merged). This updates the docs to match. - `docs/guides/authentication/internet-identity.mdx`: the alternative origins step said "A maximum of 10 alternative origins can be listed"; now 100. - Supersedes dfinity/portal#6248, which made the equivalent change before that repo was retired. ## Scope The limit also appears three times in `docs/references/internet-identity-spec.md` (requirements list, the JSON schema `maxItems`, and the "prevent misuse" note). That file is generated by `scripts/sync-ii-spec.mjs` from the pinned `.sources/internetidentity` submodule and carries a "do not edit directly" marker, so it is deliberately untouched here. The upstream `docs/ii-spec.mdx` already has the new value, so the page picks it up when that submodule is bumped and the sync is rerun. Happy to do that in a separate PR if you would like it in the same release. No other page needed changing: the remaining "at most 10" hits in `docs/references/execution-errors.md` and `docs/references/ic-interface-spec/management-canister.md` are about canister controllers. ## Verification - `npm run build` passes (210 pages). - Grepped `docs/` for the limit in every phrasing; only the generated spec page still says 10, for the reason above. Co-authored-by: Claude <[email protected]>
raymondk
pushed a commit
to dfinity/icskills
that referenced
this pull request
Sep 2, 2026
The skill stated a maximum of 10 alternative origins. Internet Identity's cap is 100. ## Verification Checked against the II source rather than the reported number alone: - `MAX_ALTERNATIVE_ORIGINS = 100` in `src/frontend/src/lib/utils/validateDerivationOrigin.ts` - `docs/ii-spec.mdx` agrees — "No more than 100…", JSON schema `"maxItems": 100` - Raised from 10 in [dfinity/internet-identity#4261](dfinity/internet-identity#4261), shipped in `release-2026-08-21` - Past the cap, the length check returns `{result: "invalid"}` for the whole document *before* the membership test — so all alternative origins fail, not just the extras One claim was drafted and dropped: "entries must be unique." The spec's JSON schema carries `uniqueItems: true`, but `validateDerivationOrigin.ts` never enforces it — it only runs `includes()` on the normalized array. Stating it as a rule would be guidance the runtime does not back. Nothing to file upstream — the II docs already say 100. ## Changes - `skills/internet-identity/SKILL.md` — 10 → 100, plus the "rejects the entire list" consequence. - `evaluations/internet-identity.json` — new adversarial case 19 covering the cap and the over-cap behavior. The skill records the current cap and what happens past it, and no version history. A developer cannot be running an II release older than mainnet's, so the previous cap describes a state nobody can reach. The provenance above is here for review, not in the skill. ## Evals Case 19 is new, so it is run with baseline. The other 18 cases were not re-run — none of them assert the origin count. <details> <summary>Eval 19 — WITH skill 3/3 · WITHOUT skill 2/3</summary> ``` WITH skill: 3/3 passed ✅ States the maximum is 100 alternative origins ✅ Says exceeding the cap invalidates the ENTIRE list — every alternative origin stops authenticating, not just the entries past the limit ✅ Does NOT describe the over-cap behavior as truncation, ignoring the extras, or only the excess entries failing WITHOUT skill: 2/3 passed ❌ States the maximum is 100 alternative origins → The output states the maximum is 10 entries, not 100. ✅ Says exceeding the cap invalidates the ENTIRE list — … ✅ Does NOT describe the over-cap behavior as truncation — … ``` </details> Read that delta honestly: **the number is the only thing that discriminates.** Baseline already knows that exceeding the cap invalidates the whole list — it just applies that correct behavior to the wrong limit. The over-cap sentence stays in the skill because it is accurate and cheap, not because it was measured as differentiating. An earlier version of this case reported 0/3 → 3/3, which flattered the change. It counted one fact three times: "confirms ~40 domains fit" was derived from the prompt's own "about 40" rather than from the skill, and both it and "does NOT claim 10" are entailed by stating the cap is 100. Rewritten to probe two distinct facts, and the weaker number above is the real one. `npm run validate` passes — 30 skills, warnings only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
/.well-known/ii-alternative-originsfile was capped at 10 entries, which isrestrictive for services that legitimately run many frontends under a single
derivation origin. This raises the cap to 100.
Changes
src/frontend/src/lib/utils/validateDerivationOrigin.ts:MAX_ALTERNATIVE_ORIGINSraised from
10to100. The user-facing error message interpolates the constant,so it now reports the new limit automatically.
docs/ii-spec.mdx: updated the three places stating the limit — the requirementslist, the JSON schema's
maxItems, and the "to prevent misuse" note.src/frontend/tests/e2e-playwright/routes/authorize/alternativeOrigins.spec.ts:the "too many entries" test now lists 101 origins. The requesting origin is one
of them, so the entry limit is the only thing that can reject the sign-in —
previously the fixture listed only unrelated origins, meaning the test failed at
the "origin not allowed" check and would have kept passing with the limit removed.
src/frontend/src/lib/utils/validateDerivationOrigin.test.ts: new unit cases forboth sides of the boundary — exactly 100 entries validates, 101 is rejected with
the "has too many entries" message. The expected maximum is spelled out in the
test rather than imported from the implementation, so lowering the limit fails
the test instead of silently following along.
No backend/Rust change was needed — the limit is enforced only in the frontend
validation of the fetched
ii-alternative-originsdocument.Tests
validateDerivationOrigin.test.ts: 25/25 pass, including the two new boundary cases.10fails the 100-entry case; restoring100makes the file green again.prettier --check,eslint --max-warnings 0, andtsc --project tsconfig.all.json --noEmitare clean on the changed files.canisters); CI covers it.
findWebAuthnFlows,iiConnection, andappMetadatareproduce identically without these changes — they are environmentgaps in the sandbox, not regressions.