Skip to content

release: v0.1.25.7 — PATCH api-keys, Permission enum, spec polish, release prep#68

Merged
amavashev merged 7 commits into
mainfrom
fix/admin-write-wildcard-fallback
Apr 9, 2026
Merged

release: v0.1.25.7 — PATCH api-keys, Permission enum, spec polish, release prep#68
amavashev merged 7 commits into
mainfrom
fix/admin-write-wildcard-fallback

Conversation

@amavashev
Copy link
Copy Markdown
Collaborator

Summary

Completes v0.1.25.7: PATCH api-keys implementation, reusable Permission enum, full spec polish pass, and release prep.

Changes

New endpoint: PATCH /v1/admin/api-keys/{key_id}

  • Update permissions, scope_filter, name, description, metadata without secret rotation
  • Lua atomic update with status validation (409 on REVOKED/EXPIRED)
  • Emits api_key.permissions_changed only when permissions or scope_filter actually change
  • ApiKeyUpdateRequest DTO with @JsonIgnoreProperties(ignoreUnknown = false)

Spec polish (review feedback)

Fix Details
Permission enum Reusable schema, $ref in all 6 permission array fields
401 wording All 45 endpoints correct: 27 admin-only, 14 tenant-only, 4 dual-auth
Orphan YAML block Fixed parse-breaking 401 between audit/dashboard sections
Wildcard prose Replaced reservations:* etc. with concrete permission names
admin:*:* Replaced with "granular admin permissions like admin:tenants:read"
AuthIntrospectResponse permissions uses plain string[] (not Permission ref) — documented why
FROZEN semantics Centralized: includes funding block
Webhook/event opt-in Explicitly documented as NOT in default tenant permissions

Release prep

  • Docker tags: 0.1.25.60.1.25.7 (both prod compose files)
  • AUDIT.md: complete v0.1.25.7 entry with all changes
  • README: v0.1.25.7 changelog, PATCH api-keys in endpoint table

Test plan

  • mvn verify — 412 tests, 0 failures, 95%+ coverage
  • All 45 401 descriptions verified correct (script + manual)
  • Zero wildcard permission prose remaining
  • YAML parses clean (no orphan blocks)
  • All 43 implemented endpoints spec-compliant

…TCH api-keys

Review feedback fixes:
1. Add 401 to all 36 auth-gated endpoints missing it (now 45/45)
2. Document webhook/event permissions as opt-in (not in defaults)
3. Clarify createApiKey is tenant-key only (admin key is server config)
4. Centralize FROZEN semantics: now includes funding block
5. Add PATCH /v1/admin/api-keys/{key_id} for updating permissions,
   scope_filter, name, description, metadata without secret rotation
…ey guidance

Review feedback (4 items):
1. Extract reusable Permission enum schema — ApiKey, ApiKeyCreateRequest,
   and PATCH api-keys all use $ref. Add 400 to key update for invalid
   permission names.
2. Wildcard semantics (admin:read/admin:write) now documented in
   Permission schema description (normative, not just changelog).
3. Admin permissions on tenant keys: explicitly accepted for backward
   compat but SHOULD NOT be assigned to new keys.
4. 401 descriptions precise: 23 admin-only, 10 dual-auth, 12 tenant-only.
   Schema header comment v0.1.25.6 → v0.1.25.7.
New endpoint allows updating permissions, scope_filter, name,
description, metadata on existing API keys without rotating the
secret. Immutable: tenant_id, key_id, key_prefix, expires_at, status.

- ApiKeyUpdateRequest DTO with @JsonIgnoreProperties(ignoreUnknown=false)
- ApiKeyRepository.update() with atomic Lua script (validates ACTIVE status)
- 404 not found, 409 on revoked/expired keys
- Emits api_key.permissions_changed only when permissions or scope_filter
  actually change (change detection via old vs new comparison)
- Audit logging with tenantId and keyId
- Spec: Permission enum extracted, 401 precision, wildcard docs normative

Tests: 405 → 412 (7 controller + 5 repository)
… $ref cleanup

Review feedback (4 items):
1. Fix parse-breaking orphan 401 between audit logs and dashboard
   section — moved into audit endpoint responses block
2. Full 401 wording sweep: all admin-only say "admin API key",
   tenant-only say "API key", dual-auth say "API key / admin key"
3. Replace admin:*:* (not a real enum value) with "granular admin
   permissions like admin:tenants:read"
4. Permission $ref now used in all schemas: ApiKeyCreateResponse,
   ApiKeyValidationResponse, EventDataApiKey (was plain string)
- Fix 3 duplicate "API key / admin key / admin key" descriptions
  (regression from previous script run)
- Fix introspectAuth 401: "API key / admin key" → "admin API key"
  (admin-only endpoint)
- Document AuthIntrospectResponse.permissions as plain string (not
  Permission ref) because admin returns ["*"] which is not an enum value
- Admin permissions on tenant keys: kept as SHOULD NOT (permissive,
  for backward compatibility) per reviewer acknowledgment
- listEvents 401: "API key / admin key" → "admin API key" (admin-only)
- replayEvents 401: same fix
- Permission schema: replace wildcard shorthand (reservations:*, budgets:*)
  with concrete permission names (reservations:create/commit/..., budgets:read/write)
- Also fixed orphan blank line before listEvents 401 block
- AUDIT.md: added final spec polish table (Permission enum, 401
  precision, wildcard prose, introspect docs, PATCH 400)
- README: updated v0.1.25.7 changelog, added PATCH api-keys to
  endpoint table (3 → 4 API key operations)
- Docker tags: 0.1.25.6 → 0.1.25.7 in both prod compose files
@amavashev amavashev merged commit c4f21c6 into main Apr 9, 2026
2 checks passed
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.

1 participant