Repository navigation
feat: per-owner store limits and reassign, user-linked API keys, shared passkey domain, include-aware authoring tools (#731, #732, #729, #733) - #737
Merged
Conversation
An owned collection may declare maxRecordsPerOwner (at most its maxRecords; refused on a shared collection). A create by a principal already holding that many records answers 409 owner_quota_exceeded with a fixed message that states no count, limit or collection total; maxRecords stays the collection-wide ceiling. Per-owner counts are derived from the loaded records on activation and after every commit, so they stay correct across restart and after ownerless-assign/ownerless-delete; ownerless records count toward no owner. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…ncludes (#733) Project mode (urlcode fixtures suggest, urlcode diff with a directory side, MCP suggest_fixtures without yaml and summarize_yaml_change without after) now reads the project's YAML through loadDocument, so include resolution, root containment and the nesting/duplicate/size rules are the loader's own. loadDocument({sources: true}) additionally returns the file each route and extension declaration came from. Included routes are analysed like entry routes (no blanket include gaps or include-shadowing), and every entry names its file. urlcode diff takes a YAML file or a project directory on either side. Project sides report each route's file and movedFrom for routes that moved; a mixed comparison sets aside project-side routes from includes the text side lists but does not read (routes.unresolved) instead of guessing. Text mode (the agent-context SDK and MCP with supplied YAML) is unchanged: text only, includes reported as gaps, same result shape. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
… origins (#729) Operators can set one shared WebAuthn RP ID beside --origin/--alias-origin: --passkey-rp-id on dev/serve/validate/test/routes/audit/benchmark, passkeyRpId on createRuntime/startServer/runProjectTests and the AWS/Vercel handlers, or URLCODE_PASSKEY_RP_ID. Never project YAML. Core refuses it before loading the project (ConfigError invalid-passkey-rp-id) unless it is a lowercase ASCII DNS name, not an IP address, not a single label (localhost only for a localhost canonical host), not in a short documented public-suffix list (Node ships no PSL; browsers enforce the full list), and the host or a label-boundary parent domain of the canonical and every alias origin. Activations receive it as passkeyRpId only when set. Auth rebinds its passkey provider with the new withSite({rpId, origins}): options carry the shared RP ID and verification accepts any site origin. Unset, nothing changes (canonical host, canonical origin only). Auth does not record per- credential RP IDs, so no startup warning is possible yet (#736); docs warn that changing the RP ID strands existing passkeys. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…rotation (#732) issueApiKey({name, scopes, quota?, userId?}) and the api-key-issue JSON accept an optional userId naming an existing, active account (an unknown, locked, pending- deletion or purged user is refused with invalid_api_key_user, checked in the insert's transaction). A user-linked key sets the request principal to that user's id instead of apikey:<key id>, so records it creates in an owned store collection belong to the user and survive rotating the key; it still acts only within its own scopes, never the user's roles. The key authenticates only while its user is active: locking the account or starting its deletion disables it on the next request (unlocking or cancelling re-enables it), and purgeDeleted revokes a purged account's keys. authenticateApiKey returns userId, listApiKeys/api-key-list return userId and userDisabled, and the auth-principal context header carries userId for a linked key. Keys without userId are unchanged; existing databases gain a nullable auth_api_keys.user_id column (and index) in place. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…ipals (#732) urlcode-store reassign --directory <dir> --project <app> --from <principal id> --to <principal id> [--collection <name>] [--dry-run] moves every record one principal owns to another, for example a rotated service API key's apikey:<id> records to its replacement. It reads the project through core's loader to find the ownership: owner collections and their maxRecordsPerOwner (only those are touched; --collection limits it to one, a shared or undeclared name is refused), validates both ids with core's principalIdPattern, takes the directory lock like the ownerless commands (so it refuses while the server runs) and prints per- collection counts; --dry-run writes nothing. When the move would put --to over any affected collection's maxRecordsPerOwner the whole operation is refused, naming the collection, and no file is written. Exported as reassignOwner. The store package's unpacked budget rises from 140 to 150 KiB for it and #731. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…oring follow-ups (#731, #733, #729, #732) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
Collaborator
Author
|
Blocked: CodeQL reports 1 new high-severity alert in code changed by this PR. All other CI checks are green. The alert's location isn't reachable from the tooling in this session: the check output only links to the code-scanning page, and annotations aren't exposed. I checked the likely causes in the diff:
None of these is conclusive. I'm not merging until the alert is identified and fixed. Needed: the rule ID and file:line from https://github.com/jimhoyd-com/urlcode/security/code-scanning?query=pr%3A737+tool%3ACodeQL+is%3Aopen Generated by Claude Code |
) CodeQL's incomplete-URL-substring rule read the array membership check passkeyPublicSuffixes.includes('co.uk') as a host substring match; a Set lookup states the intent and clears the false positive. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
4 tasks done
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.
Problem and change
maxRecordsPerOwner, from 1 up to the collection'smaxRecords.create, in the collection's one-at-a-time write sequence.409 owner_quota_exceededwith no counts in the body.maxRecordsis still the collection-wide ceiling.ownerlessoperations. Ownerless records count toward no owner, and an idempotent replay is refused before anything is counted.issueApiKey({…, userId?})and the CLI accept an optionaluserId, which must be an existing active user. A user-linked key sets the principal to that user id, so owned records belong to the user and survive key rotation. It still acts only within the key's scopes.apikey:<id>principal.user_idcolumn.urlcode-store reassign --directory --project --from --to [--collection] [--dry-run]andreassignOwner()._owner.--passkey-rp-id <domain>, thepasskeyRpIdoption, orURLCODE_PASSKEY_RP_ID. Operator-only, never YAML.PasskeyProvider.withSite()uses the shared relying-party ID and accepts any site origin.urlcode fixtures suggest,urlcode diffwith a directory side, and MCP without an explicityaml), includes are resolved throughloadDocument(project, {sources: true}), so the loader's own containment and limits apply. Results then carryfile,movedFrom,sidesandroutes.unresolved(mixed mode only). The text-mode public API (@jimhoyd/urlcode/agent-context) is unchanged and still text-only.Verification
Run on Node v26.10.0:
npm run verifyon [Request]: per-owner record limit for owned store collections #731 + [Request]: fixture suggestions and change summaries should follow project includes #733 + [Request]: passkey sign-in on operator alias origins #729 on the latestmain: exit 0. Root 876 tests; workspaces 34, 97, 237, 29, 59 and 66;test:addons4. All 0 failures.npm run lint,typecheckandcheckpass.npm run verify:workspacesexits 0: 34, 97, 240 (auth), 29, 63 (store) and 66, plus manifest check, audit andtest:addons4.extensions,extension-principalandsite-originstests: 74/74.npm run test:package: exit 0 on this branch.npm run audit:packagesandlintpass.runProjectTests, plus containment refusal and a cross-directory diff.Compatibility and security
All opt-in or additive. Behaviour is unchanged unless
maxRecordsPerOwner,userId,--passkey-rp-idor project mode is used.Known limits:
reassignreplaces files one at a time, so a disk error between collections can leave a partial move; re-running completes it. This is documented.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