Skip to content

AgentTokenStore

Defined in: types.ts:53

Tracks issued agent-token ids so they can be revoked before their JWT’s natural expiry — the same problem RefreshTokenStore solves for refresh tokens, applied to short-lived, capability-scoped agent tokens instead. Methods are sync-or-async so a Redis-backed store can be injected without an interface change.

add(id, expiresAt): void | Promise<void>

Defined in: types.ts:55

Record an issued agent token. expiresAt is the JWT exp in epoch seconds.

string

number

void | Promise<void>


isValid(id): boolean | Promise<boolean>

Defined in: types.ts:57

True unless id was never issued on this store, or has since been revoked/reaped.

string

boolean | Promise<boolean>


revoke(id): void | Promise<void>

Defined in: types.ts:59

Revoke one agent token immediately, independent of its JWT expiry.

string

void | Promise<void>