testing/cross_backend/token_lifetime.ts view source
(options: TokenLifetimeCrossTestOptions): void import {describe_token_lifetime_cross_tests} from '@fuzdev/fuz_app/testing/cross_backend/token_lifetime.js'; options
returns
void Cross-backend parity suite for the API token lifetime axis of
account_token_create — the round-trip that keeps a one-sided landing
impossible.
The action-manifest parity gate captures {method, side_effects, auth} and
no param schemas, while the TS spine validates params against a strict
object and the Rust spine hand-parses with params.get(...). So a
spine that silently ignored the lifetime field would answer the same mint
request with a 200 and an eternal token — same method, same status,
nothing red anywhere. The forcing function has to observe the *stored*
state: mint with a TTL, then read expires_at back off the wire.
account_token_create with
{kind:'ttl', days} returns a non-null expires_at (create output *and*
account_token_list), landing within a generous window around
now + days. A spine that dropped the field returns null and fails.{kind:'eternal'} yields
expires_at: null on both reads.lifetime is required; a mint
without it must 400 invalid_params on both spines. This is the direct
pin on the silently-ignoring-unknown-shapes hazard.days: 0 400s identically, so the
two hand-rolled bounds checks can't drift.name cap — the same blind spot on another field of the same
mint: a name of exactly API_TOKEN_NAME_LENGTH_MAX UTF-16 code units
mints and reads back whole, and one unit past it is invalid_params,
with an astral-plane name at each side of the boundary so the two spines
count the same unit.N methods, though Postgres prints it past the cap, and so does an
ASCII scope under the cap whose printed text is past it; one byte past the
cap, far under it in UTF-16 code units, is invalid_params with
ERROR_TOKEN_SCOPE_INVALID. A spine counting code units mints the one
past the cap, and one measuring the printed scope::text fails the
others closed — unreadable in the list, an anonymous bearer.last_used_at stays null. A spine resolving the bearer first (or both)
bumps it. The positive control is a second token used alone, read back
with a last_used_at — sent after the first request, so once its touch
is visible the first's would be too.2 declarations
testing/cross_backend/token_lifetime.ts view source
(options: TokenLifetimeCrossTestOptions): void import {describe_token_lifetime_cross_tests} from '@fuzdev/fuz_app/testing/cross_backend/token_lifetime.js'; optionsvoid testing/cross_backend/token_lifetime.ts view source
TokenLifetimeCrossTestOptions import type {TokenLifetimeCrossTestOptions} from '@fuzdev/fuz_app/testing/cross_backend/token_lifetime.js'; Options for the token-lifetime parity suite. Ungated — the mint + list pair
is on every spine's standard surface, so there is no capability flag (the
sibling of identity_parity.ts rather than the cell suites).
setup_testPer-test fixture-producing function (fresh keeper + db per call).
type (): Promise<TestFixture>
Promise<TestFixture>rpc_path?RPC endpoint path the methods are mounted on. Default /api/rpc.
type string