Repository navigation
feat: per-key quota, relative form date bounds, store-owned CRUD screen, capability-only extension installs (#703, #705, #709, #711) - #727
Merged
Conversation
…responses (#703) An API key can carry its own quota (issueApiKey({name, scopes, quota}), or quota in the api-key-issue JSON), stored in new auth_api_keys columns added in place; existing keys have none. A key's own quota replaces the route's auth.bearer.quota for that key on every bearer route; keys without one use the route's. Core policies.throttle is unchanged. The auth extension now implements middleware(): an allowed, counted bearer response carries RateLimit-Policy/RateLimit under "credential", ahead of core throttle's "default" member. Core already forces Cache-Control: no-store on auth-protected routes and refuses a cache strategy other than no-store on them, so these per-credential values are never cached; tests assert both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…ne (#705) minimum/maximum on date and datetime-local fields now accept `today` or `{from: today, add: <signed ISO 8601 years/months/days duration>}`. Today is the date in the flow's new IANA `timeZone` (UTC when absent), never the host zone, and is resolved per request for the authoritative server check and the rendered min/max. Years and months move first and clamp to the month end, then days. A relative datetime-local minimum is 00:00 and a maximum the end of that day. Activation refuses unknown zones, durations with weeks or time parts, and relative windows that are empty on some day. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…ng store config (#709) ui no longer loads the project document or reads extensions.store. A data screen now reaches ui through the owning extension's contributes.ui.screens (UiScreenSource: resolves {<path>: {title, collection, columns?}} once at ui activation). extensions.ui.config.screens is removed; screens are declared under extensions.store.config.screens, and the store scaffold (not ui's) adds the /todos screen and its extension: ui route when ui is installed. The optional store -> ui edge is visible: urlcode.json descriptors record `contributes`, store declares ui an optional peer, and workspace ordering builds a contribution target first. Core still imports no package. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…mos (#711) `urlcode extensions add <name>` (and `init --with`) now writes only what an extension needs to function. The extension contract gains an optional `example(request)` beside `scaffold`; one generic `--example` flag writes it on top (config deep-merged, colliding routes refused, lists appended), keeps acknowledgements and no-overwrite behavior, and refuses when nothing added ships an example. Core still knows no package names. - store: blank = empty collections, no mount, no ack; example = todos on /api/todos (+ /todos screen with ui), ack without auth. - forms: blank = CSRF key + empty flows; example = /contact flow. - auth: blank = /account/* mount, operator service with the documented {member, admin} role model, keys; example = /private. - admin, ui, mcp: capability only, no example (admin notes that auth's mount is a configurable default, admin({authMount})). Starter, getting-started docs, package READMEs, llms, skills, CI and pack-addons pass --example where a working demo is expected. Integration and unit tests cover blank vs --example. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…rud recipe (#711) The recipe test matches the flag as one phrase; the #711 rewording had wrapped it across two lines. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…ges (#709) store now contributes its CRUD screen to ui and its screens test imports @jimhoyd/urlcode-ui/extension, so the store workspace-verify job must build ui first (it failed with TS2307), and a ui change must select store as a reverse dependency. 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
Four decided issues, one commit each, plus a small recipe fix.
issueApiKey({name, scopes, quota})and the CLI's stdin JSON accept an optionalquota: {requests, window}, stored in new nullableauth_api_keyscolumns (additive migration, same pattern as existing ones). The bounds are the same as the route quota.auth.bearer.quota. It is one counter per key and applies on every bearer route the key authenticates on, so a plan-tier key is limited everywhere. Keys without a quota use the route's.middleware(). On quota'd bearer routes, allowed responses carryRateLimit-Policy/RateLimitwith the"credential"member, next to core throttle's"default"member when both apply.Cache-Control: no-store, and a cache strategy other thanno-storeis refused at startup. Tests assert both. The misleading wording of that refusal is filed separately as [Bug]: cache refusal on an extension-protected route says "conditional routing requires cache disabled or no-store" #725.minimum/maximumondate/datetime-localaccepttodayor{from: today, add: <±PnYnMnD>}.timeZone, an IANA name validated at load, or UTC when it is absent, never the host's zone.datetime-local: a relative minimum is 00:00 of that day and a relative maximum is the end of that day.min/maxcan go stale across midnight, and the README documents that.extensions.ui.config.screensmoves toextensions.store.config.screens.UiScreenSourcethroughcontributes: {ui: {screens}}. ui never loads the project document or reads store config, and a test scanspackages/ui/srcto enforce that.contributes(validated inparseDescriptor), so the store→ui edge is visible.urlcode extensions add <name>andinit --withinstall only the capability. The new generic--exampleflag writes each extension's example, from anexample()hook besidescaffold, reproducing the old output.collections, no mount. The example is/api/todos, plus/todoswhen ui is present.flows. The example is/contact./account/*mount and{member, admin}role model, which are capability configuration. The example is/private.--example.Verification
Run on Node v26.10.0, on this stack before it was moved onto
main. The files are identical tomain+ these commits, because #726 was squash-merged from the same tree.npm run verify:--ack store:public-writeacross two lines. Fixed in the last commit; store is now 42 of 42.npm run verify:workspacesexited 0: every workspace suite,build-addon-manifest --check,audit:packagesandtest:addons(4 of 4).npm run check: exit 0.npm run test:package: exit 0 from the main checkout ("Packed installation and starter/cookbook checks passed"). An earlier run from a linked git worktree failed while cloning, which is an artefact of that setup, not of this change.Compatibility and security
Breaking (Decouple UI data screens from the store extension's private configuration #709): projects with
extensions.ui.config.screensmust move that block toextensions.store.config.screens. The ui and store CHANGELOGs describe the migration.Default behaviour change (Separate application examples from extension installation scaffolds #711):
extensions addno longer writes sample endpoints. Pass--examplefor the previous result. Adding ui in a separate, later command no longer produces the/todosscreen; add both together with--example.[Request]: bearer quota follow-ups: per-key budget override and RateLimit fields on allowed responses #703: additive DB migration, and additive
quotafields in API key results. Per-credential RateLimit values are only ever sent onno-storeresponses.[Request]: relative date bounds for forms date and datetime-local fields #705: new optional
timeZoneflow key. Existing absolute bounds are unchanged.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