Skip to content

InMemoryInvitationReplayGuard

Defined in: packages/core/src/invitation-replay-guard.ts:80

Bounded, fail-closed replay memory for one-time public invitations.

observeJoin lets an inviter claim an offer for exactly one signed join request. observeAcceptance additionally enforces every recipient, KEM-key, role, document, issuer, digest, and lifetime binding before it records a single acceptance. Byte-identical repeats return replay, so an integration can return or apply its cached result without repeating ACL or key mutations. Reuse of an identifier with different signed bytes, or a second request/acceptance for the same offer, fails closed.

This guard intentionally does not verify signatures. Callers MUST verify the offer, join request, and acceptance with their bound public identities before recording them here. The guard stores identifiers and SHA-256 digests only; it never retains sealed Welcomes, bootstrap ciphertext, or key material.

Live entries are never silently evicted because eviction would make an old invitation replayable. Records are retired only after the signed offer’s hard expiry, when the envelope can no longer be accepted.

new InMemoryInvitationReplayGuard(maxEntries?): InMemoryInvitationReplayGuard

Defined in: packages/core/src/invitation-replay-guard.ts:86

number = DEFAULT_INVITATION_REPLAY_GUARD_ENTRIES

InMemoryInvitationReplayGuard

readonly maxEntries: number = DEFAULT_INVITATION_REPLAY_GUARD_ENTRIES

Defined in: packages/core/src/invitation-replay-guard.ts:87

get size(): number

Defined in: packages/core/src/invitation-replay-guard.ts:102

Number of distinct one-time offers currently remembered.

number

observeAcceptance(offer, request, acceptance, nowMs?): Promise<InvitationReplayDecision>

Defined in: packages/core/src/invitation-replay-guard.ts:148

Record an issuer acceptance after checking its complete recipient binding.

A byte-identical acceptance is idempotent and returns replay. A second acceptance for the offer or reuse of an acceptance ID with other bytes is rejected. This method also records the matching join claim when called on a fresh recipient-side guard.

InvitationOfferV1

InvitationJoinRequestV1

InvitationAcceptanceV1

number = ...

Promise<InvitationReplayDecision>


observeJoin(offer, request, nowMs?): Promise<InvitationReplayDecision>

Defined in: packages/core/src/invitation-replay-guard.ts:113

Record a recipient’s signed request for a usable offer.

A byte-identical request is idempotent and returns replay. A different request for the same offer, including one that changes only recipient or KEM key, is rejected.

InvitationOfferV1

InvitationJoinRequestV1

number = ...

Promise<InvitationReplayDecision>