Repository navigation
spec: admin-on-behalf-of dual-auth on reservations (list/get/release) - #37
Merged
Merged
Conversation
cycles-protocol-v0 revision 2026-04-13. Stage 2 of the dashboard ops
gap rollout — gives admin operators read access and force-release
capability against reservations, mirroring the dual-auth pattern
established for createBudget / createPolicy / updatePolicy in the
governance-admin spec v0.1.25.13.
Three reservation operations gain AdminKeyAuth as an alternative:
GET /v1/reservations (listReservations)
GET /v1/reservations/{id} (getReservation)
POST /v1/reservations/{id}/release (releaseReservation)
createReservation / commitReservation / extendReservation remain
ApiKeyAuth-only by design — admin acting on those is a footgun
(committing on behalf of a tenant takes from the tenant's budget but
the tenant's audit trail wouldn't show their key as the actor).
Force-release is the only legitimate admin lifecycle action.
Semantic delta on listReservations.tenant query param: REQUIRED as a
filter (not validation) under AdminKeyAuth; unchanged under
ApiKeyAuth. Same single-param dual-semantic shape as the
governance-admin admin reads (listBudgets, listPolicies). Omitting
under AdminKeyAuth MUST 400 INVALID_REQUEST.
Audit-log requirement (NORMATIVE) on admin-driven release:
actor_type=admin_on_behalf_of, matching the existing tag the server
emits for createBudget / createPolicy. Callers SHOULD populate the
optional `reason` body field with a structured tag for grep-ability.
New security scheme declaration: AdminKeyAuth (apiKey,
X-Admin-API-Key header) — same header the governance-admin spec
already uses, so admin operators authenticate with one key against
both planes. ReleaseRequest schema unchanged (already has optional
`reason` field — no body change needed).
Backward compatible: ApiKey-only callers see no behavior change.
Spectral lint: 0 errors on both the source spec and the regenerated
merged artifact (merged/cycles-openapi-protocol-merged.yaml). 44 pre-
existing warnings, none from this change.
This was referenced Apr 13, 2026
amavashev
added a commit
that referenced
this pull request
Apr 14, 2026
…ard-compat) Additive spec extension reserving the contract for tenant-role introspect. No server implementation required in this revision; no downstream repos touched. Purely forward-compatibility stake so future multi-role clients don't re-litigate the capability shape or drift across implementations. Changes (all additive, zero wire impact on existing admin callers): 1. Security block on GET /v1/auth/introspect gains ApiKeyAuth alongside existing AdminKeyAuth. Same dual-auth pattern used for budgets/policies (#36), reservations (#37), and webhooks (#40). 2. AuthIntrospectResponse schema gains three fields, populated only when auth_type=tenant: - tenant_id (REQUIRED under tenant auth; MUST be absent under admin) - scope_filter (OPTIONAL; non-empty when key has scope restrictions) - auth_type enum gains value "tenant" alongside existing "admin" 3. Also surfaces the optional manage_* / view_reservations capability flags that servers have been returning for several releases (pre- existing wire behavior, now formally documented in the schema). 4. NORMATIVE capability-derivation table added to the capabilities schema description. Servers MUST derive the capabilities map from a tenant key's permissions per the published rules. Guarantees any future server or client produces identical capability maps from identical permission sets. Admin-plane views (view_tenants, view_api_keys, view_audit, view_overview) only fire on admin:* permissions, so default tenant keys cannot accidentally access admin-only pages. 5. Scope-filtered keys documented as NOT altering the capability map — filters constrain which records are visible at each endpoint, not whether a page is accessible. Enforcement stays server-side. Non-goals (explicit to prevent scope creep when implementation lands): - No tenant-scoped /v1/admin/overview (admin-only). - No tenant-scoped /v1/admin/audit/logs (admin-only). - No admin-on-behalf-of introspect of a specific tenant key. Version: editorial 0.1.25.14 -> 0.1.25.15. semantic_base unchanged at 0.1.25.9 (no wire-breaking change). cycles-spec-index.yaml editorial pin bumped to match. Gates: - spectral lint: 0 errors (64 pre-existing warnings unchanged) - merge_specs.py: idempotent (rerun produces no further diff) - yaml.safe_load parses cleanly - ApiKeyAuth count: +1 (41 total, was 40) Implementation impact: none required. Compliant servers continue returning admin-only introspect until they explicitly extend to ApiKeyAuth. Rollout is opt-in; this revision just reserves the shape.
5 of 6 tasks
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.
Summary
Stage 2 of the dashboard ops gap rollout — gives admin operators read access and force-release capability against reservations. Mirrors the dual-auth pattern established for createBudget / createPolicy / updatePolicy in governance-admin v0.1.25.13.
Changes
Three reservation operations gain `AdminKeyAuth` as an alternative security scheme:
Plus: new `AdminKeyAuth` security-scheme declaration (X-Admin-API-Key header — same header the governance-admin spec already uses).
Deliberately NOT exposing
Force-release is the only legitimate admin lifecycle action.
Semantic delta on `listReservations.tenant`
Same single-param dual-semantic shape as governance-admin's admin reads (listBudgets, listPolicies). Avoids adding a parallel `tenant_id` and inconsistent naming.
Audit logging
Admin-driven `releaseReservation` MUST record `actor_type=admin_on_behalf_of` (existing audit field, value already used on createBudget/createPolicy). NORMATIVE in the spec text.
Backward compatibility
Purely additive. Existing ApiKey callers see zero behavior change. No schema modifications — `ReleaseRequest` already has the optional `reason` field.
Lint
`npx spectral lint cycles-protocol-v0.yaml` — 0 errors, 20 pre-existing warnings (none from this change).
`npx spectral lint merged/cycles-openapi-protocol-merged.yaml` — 0 errors, 44 pre-existing warnings.
`make merge` regenerated; merged artifact committed (drift check passes).
Downstream PRs (sequential)
Test plan