Skip to content

feat(core,auth): operator-facing extension activation warnings; auth warns when stored passkeys don't match the relying-party ID (#736) - #747

Merged
jimhoyd merged 4 commits into
mainfrom
claude/sleepy-shannon-xvazgl
Sep 25, 2026
Merged

jimhoyd merged 4 commits into
mainfrom
claude/sleepy-shannon-xvazgl

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Problem and change

Closes #736.

  • Core: activation warnings for extensions. ExtensionActivation.warn(message) emits {"event":"extension_warning","extension":"<name>","message":"…"} to the operator log, and core names no extension.
    • Bounds: each message is one line of at most 500 characters (new boundedLine() helper), with no stack. At most 20 warnings per extension per activation, followed by one "further warnings suppressed" line.
    • Activation-only: calls after activate() returns or throws are ignored.
    • Failure-safe: a throwing log sink never fails activation.
    • Never in HTTP responses.
    • Where it shows: validate and test print it, even without --verbose. dev/serve write it to the JSON log, and on a terminal show Extension "<name>" warning: …. AWS/Vercel send it to the function log via console.warn. Observers receive it too.
    • Docs: new card RIM-EXT-WARN-001, the "Activation warnings" section in docs/EXTENSIONS.md, the event in OBSERVABILITY and MONITORING, and LOCAL-DEVELOPMENT/AI-AUTHORING.
  • Auth: record each passkey's relying-party ID and warn on mismatch.
    • Storage: new passkeys store rpId on all three insert paths (account, signup and waitlist approval), which now share one insertPasskey helper. addPasskey accepts and validates it. The migration is additive: a nullable rp_id column.
    • Check: one aggregate query per activation (countPasskeysByRelyingParty) compares stored passkeys with the effective relying-party ID ([Request]: passkey sign-in on operator alias origins #729's passkeyRpId, or the canonical host).
      • Mismatch: one warning with counts only.
      • Passkeys stored before this change: they have no recorded relying-party ID and are assumed to be registered under the canonical host (documented). They produce a softer warning, and only when a non-default passkeyRpId is set.
      • Content: counts only; never user ids, emails or credential ids.
      • Query failure: gives one fixed-text warning.
    • Unchanged: passkey verification behaviour.
  • Budgets: auth unpacked raised from 900 to 910 KiB, and auth packed from 225 to 240 KiB. The latter measured 229986 bytes, 414 bytes under the old limit and inside the cross-Node gzip variance. The rationale is recorded next to each.

Verification

Run on Node v26.10.0 on this branch (latest main + these commits):

  • npm run verify: exit 0. Root 884 tests; workspaces 34, 97, 244 (auth), 35, 68 and 66; form-records 17; test:addons 4. All 0 failures, including build-addon-manifest --check and audit:packages.
    • The first run caught that docs/MONITORING.md didn't list extension_warning (test/monitoring.test.ts). The entry was added in the last commit.
  • npm run test:package: exit 0 (709705 packed, 2884821 unpacked bytes).
  • New tests:
    • test/extension-warnings.test.ts: bounding, the cap, the channel closing after activation, the startServer log, clean HTTP responses, the Lambda handler, and validate/test/dev as child processes.
    • test/logging.test.ts: the terminal line.
    • packages/auth/test/passkey-rp-id-record.test.ts: recording, refusal of malformed values, a mismatch warning with no ids or emails, no warning when matching or by default, the soft warning for older passkeys, and migrating an older database.
    • passkey-handler.test.ts and signup-http.test.ts assert that real registrations record rpId.

Compatibility and security

  • Additive: a new optional activation hook, a new log event and an additive database column.

  • Known limitation: an operator who already used --passkey-rp-id before upgrading may see one spurious soft warning, because older passkeys are assumed to be registered under the canonical host. This is documented in the auth README.

  • Not an independent security review.

  • Changes match the documented portable contract; docs/examples are updated where needed.

  • Relevant tests and package checks pass, or limitations are explained above.

  • No credentials, customer data or private project material are included.

  • Runtime/starter changes remain aligned where applicable.

🤖 Generated with Claude Code

https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP


Generated by Claude Code

Add a generic ExtensionActivation.warn(message) channel. Each call made
while an extension activates is written to the runtime's operator log as
{"event":"extension_warning","extension":"<name>","message":"..."}: one
line, at most 500 characters, no stack, at most 20 per extension per
activation followed by one "further warnings suppressed" record. Calls
after activate() settles are ignored, and warnings never reach an HTTP
response. validate, test (also without --verbose), dev and serve print
it; the hosted adapters write it to the function log.

Documented in EXTENSIONS.md (activation warnings), OBSERVABILITY.md
(event catalogue), LOCAL-DEVELOPMENT.md, AI-AUTHORING.md, FRAMEWORK.md
and a new RIM-EXT-WARN-001 card.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…p on mismatch (#736)

Every passkey insert path (account passkey, signup, waitlist approval)
now stores the RP ID the ceremony was verified under: `rpId` in the
credential JSON (StoredPasskey/AuthPasskey; addPasskey and the signup
passkey step accept and validate it) and a nullable `rp_id` column that
existing databases gain in place. Passkeys stored earlier stay
unrecorded.

At activation auth runs one aggregate query
(AuthService.countPasskeysByRelyingParty) against the effective RP ID
(operator passkeyRpId, otherwise the provider's canonical host) and
reports through core's activation warning channel, with counts only:
recorded passkeys under a different RP ID, and, only when a non-default
--passkey-rp-id is set, a softer warning for unrecorded passkeys, which
are assumed to be canonical-host passkeys. Verification is unchanged.

Docs: auth README/SECURITY/CHANGELOG, OPERATIONS.md, EXTENSIONS.md and
the operations skill. The auth unpacked-size budget rises from 900 to
910 KiB (measured 924773 bytes).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
@jimhoyd
jimhoyd merged commit 9489873 into main Sep 25, 2026
24 checks passed
@jimhoyd
jimhoyd deleted the claude/sleepy-shannon-xvazgl branch September 25, 2026 12:54
jimhoyd added a commit that referenced this pull request Sep 25, 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.

auth: record each passkey's RP ID and warn at startup when the operator RP ID differs

2 participants