Repository navigation
[M2.2d4c2b] Expose secure API token management endpoints - #62
Merged
Merged
Conversation
4 tasks done
samuelmbabhazi
force-pushed
the
feat/m2.2d4c2a-bearer-http
branch
from
November 5, 2026 12:36
6e186d8 to
a189de2
Compare
samuelmbabhazi
changed the base branch from
feat/m2.2d4c2a-bearer-http
to
main
November 5, 2026 12:36
samuelmbabhazi
force-pushed
the
feat/m2.2d4c2b-token-management-http
branch
from
November 5, 2026 12:36
e067c3c to
df1810d
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
The first typed web consumer exposed two contract defects: token-list `limit` was generated as an object, and openapi-fetch's Readable/Writable helpers transformed readonly arrays into objects whose array methods were unusable. This blocked recovery-code and scope handling under strict TypeScript. The pagination DTO now explicitly declares an integer schema. A version-pinned pnpm patch corrects only the helper package's three TypeScript declaration entry points, using homomorphic array mapping to preserve mutable/readonly arrays and tuples. Runtime JavaScript is unchanged, and no dependency version is downgraded. This addresses the confirmed upstream issue: openapi-ts/openapi-typescript#2615. Remove the patch after an upstream fix passes these regressions. Validation: the new client typecheck failed before the fixes. API and client lint/typecheck/tests now pass (96 API tests, four client tests), API production build passes, and OpenAPI/client regeneration is current. Regression tests exercise numeric pagination, nested readonly response scopes and readonly request bodies; the HTTP OpenAPI test asserts the integer schema. Security: no authentication semantics or runtime dependency code changes; no casts weakening the generated contract. Stacked on #62; no merge requested. - [x] M2.2e1a criteria met - [x] Compile-time and runtime regressions covered - [x] Generated artifacts current - [x] Temporary patch reason and removal condition documented
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.
Users can now create, list and revoke API tokens through session-only HTTP endpoints. Creation requires password/MFA proof and returns the credential once; lists return only metadata with bounded cursor pagination. Revocation is owner-bound and idempotent. All mutations require Origin and session CSRF.
POST /api-tokens and /api-tokens/{id}/revoke support encrypted idempotent retries. A creation replay revalidates ownership, account security version, token lifecycle and owner authority before revealing the cached token. Revoked/expired/invalidated grants return 409. DTOs reject unknown scope fields, malformed hierarchy, wildcard permissions, unsafe labels, invalid dates/cursors and out-of-range page sizes. OpenAPI/client are regenerated.
Validation: all 84 real PostgreSQL/Docker integration tests pass, including five new HTTP acceptance cases for encrypted retries, pagination, session-only access, cross-owner denial, quota enforcement and rollback on audit failure. All 96 API unit tests, API/client lint/typecheck/build, client tests, Go tests and buf lint pass locally.
Security: only the explicit creation response exposes plaintext. Neither metadata lists nor audit events expose hashes/credentials. No dependency or shell invocation added. Tenant authority/project-owned credentials remain explicitly tracked under M2.3; before that integration only profile.read can be granted. Stacked on #61; do not merge automatically.