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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InMemoryInvitationReplayGuard(
maxEntries?):InMemoryInvitationReplayGuard
Defined in: packages/core/src/invitation-replay-guard.ts:86
Parameters
Section titled “Parameters”maxEntries?
Section titled “maxEntries?”number = DEFAULT_INVITATION_REPLAY_GUARD_ENTRIES
Returns
Section titled “Returns”InMemoryInvitationReplayGuard
Properties
Section titled “Properties”maxEntries
Section titled “maxEntries”
readonlymaxEntries:number=DEFAULT_INVITATION_REPLAY_GUARD_ENTRIES
Defined in: packages/core/src/invitation-replay-guard.ts:87
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get size():
number
Defined in: packages/core/src/invitation-replay-guard.ts:102
Number of distinct one-time offers currently remembered.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”observeAcceptance()
Section titled “observeAcceptance()”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.
Parameters
Section titled “Parameters”request
Section titled “request”acceptance
Section titled “acceptance”nowMs?
Section titled “nowMs?”number = ...
Returns
Section titled “Returns”Promise<InvitationReplayDecision>
observeJoin()
Section titled “observeJoin()”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.
Parameters
Section titled “Parameters”request
Section titled “request”nowMs?
Section titled “nowMs?”number = ...
Returns
Section titled “Returns”Promise<InvitationReplayDecision>