Repository navigation
Switch prod II instance to the Phase-2 handshake protocol (same as beta) - #63
Merged
Merged
Conversation
Flip the production instance's default connect protocol from v1 (fetched
key) to the Phase-2 registration-delegation flow, matching beta. The deploy
config does not set MCP_REGISTRATION_DELEGATION_PROD, so the code default is
authoritative: change it from false to true.
- identities.rs: prod() now defaults registration_delegation to
env_flag("MCP_REGISTRATION_DELEGATION_PROD", true); operators can fall
back to v1 with MCP_REGISTRATION_DELEGATION_PROD=0. Doc comments on prod()
and the IiInstance::registration_delegation field updated (and the stale
provisional regkey/flow param name corrected to registration_key). The
instance_defaults_are_valid test now asserts prod defaults to the new
protocol.
- auth.rs: module docs and the per-instance test comments no longer describe
prod as pinned to v1.
- README.md: the Phase-2 section documents prod on by default, same as beta.
Enabling stays outbound-compatible with v1 — it only adds the
registration_key param to the II link and turns on the pinned callback +
redeem routes, while every v1 handler stays live — so a production II
frontend that has not yet shipped the new flow still completes v1 unchanged.
cargo test: 124 passing; no new build/clippy warnings.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VDK8zySPze2LZKqZxCB7Dc
There was a problem hiding this comment.
Pull request overview
This PR switches the production Internet Identity (II) instance to default to the Phase-2 registration-delegation handshake (matching beta), with corresponding updates to documentation and default-behavior tests.
Changes:
- Flip
IiInstance::prod()default forregistration_delegationtotrue(with env overrideMCP_REGISTRATION_DELEGATION_PROD=0to fall back to v1). - Update Phase-2 documentation in
src/auth.rsandREADME.mdto reflect prod’s new default. - Update the instance-defaults test to assert prod uses the Phase-2 protocol by default.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/identities.rs | Changes prod instance default to Phase 2 and updates related doc comments + default assertions. |
| src/auth.rs | Updates Phase-2 module/test comments to reflect prod being Phase 2 by default. |
| README.md | Updates public docs to describe prod as Phase 2 on by default and how to disable via env var. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
In auth_callbacks_declares_link_callbacks_verbatim, registration_delegation was derived from oauth_prefix (prefix.is_empty()), coupling the protocol flag to an unrelated value — confusing now that prod also defaults to Phase 2, and brittle if prefixes change or instances are added. Pass the flag explicitly to the `make` helper so the test's intent (cover one v1 and one v2 instance) is clear and independent of the prefix. Behavior is unchanged: the allow-list document is prefix-derived, and the per-instance link assertions already call ii_mcp_url_v2/ii_mcp_url explicitly. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01VDK8zySPze2LZKqZxCB7Dc
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.
What
Flip the production II instance's default connect protocol from v1 (fetched key) to the Phase-2 registration-delegation handshake, so prod now matches beta.
Why
Beta already defaults to the new registration-delegation handshake; this brings production in line. The deploy config (
deploy/native/mcp-poc.service) does not setMCP_REGISTRATION_DELEGATION_PROD, so the code default is authoritative — the switch is a one-line default change fromfalsetotrue, plus the docs/tests that asserted the old default.Changes
src/identities.rs—IiInstance::prod()now defaultsregistration_delegationtoenv_flag("MCP_REGISTRATION_DELEGATION_PROD", true). Operators can still fall back to v1 withMCP_REGISTRATION_DELEGATION_PROD=0. Updated theprod()andIiInstance::registration_delegationdoc comments (and corrected the stale provisionalregkey/flowparam name to the reconciledregistration_key). Theinstance_defaults_are_validtest now asserts prod defaults to the new protocol.src/auth.rs— module docs and the per-instance test comments no longer describe prod as pinned to v1.README.md— the Phase-2 section documents prod on by default, same as beta.Safety
Enabling Phase 2 for an instance is outbound-compatible with v1: it only adds the
registration_keyparam to the II link and turns on the pinned callback page + redeem routes, while every v1 handler (the callback POSTs,/oauth/finish) stays live. A production II frontend that has not yet shipped the new flow ignores the extra param and completes v1 unchanged./versioncontinues to reportregistration_delegation: { beta, prod }so operators can confirm the running protocol per instance.Testing
cargo test: 124 passing.cargo clippy --all-targets: no new warnings (pre-existing warnings only, in files this change does not touch).🤖 Generated with Claude Code
https://claude.ai/code/session_01VDK8zySPze2LZKqZxCB7Dc
Generated by Claude Code