InMemoryGroupSecurityRollbackAnchor
Defined in: packages/core/src/group-security-rollback-anchor.ts:141
Reference implementation for tests and same-process development only. Keeping this object beside an in-memory store is not rollback-resistant.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InMemoryGroupSecurityRollbackAnchor():
InMemoryGroupSecurityRollbackAnchor
Returns
Section titled “Returns”InMemoryGroupSecurityRollbackAnchor
Methods
Section titled “Methods”advance()
Section titled “advance()”advance(
keyValue,expectedValue,nextValue):Promise<boolean>
Defined in: packages/core/src/group-security-rollback-anchor.ts:198
Install next while expected is current and clear every intent.
Parameters
Section titled “Parameters”keyValue
Section titled “keyValue”expectedValue
Section titled “expectedValue”GroupSecurityRollbackAnchorValue | undefined
nextValue
Section titled “nextValue”GroupSecurityRollbackAnchorValue
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”DurableGroupSecurityRollbackAnchor.advance
load()
Section titled “load()”load(
keyValue):Promise<GroupSecurityRollbackAnchorValue|undefined>
Defined in: packages/core/src/group-security-rollback-anchor.ts:148
Parameters
Section titled “Parameters”keyValue
Section titled “keyValue”Returns
Section titled “Returns”Promise<GroupSecurityRollbackAnchorValue | undefined>
Implementation of
Section titled “Implementation of”DurableGroupSecurityRollbackAnchor.load
loadIntents()
Section titled “loadIntents()”loadIntents(
keyValue):Promise<readonlyGroupSecurityRollbackIntent[]>
Defined in: packages/core/src/group-security-rollback-anchor.ts:158
Return the intents recorded beside the current value, oldest first.
Parameters
Section titled “Parameters”keyValue
Section titled “keyValue”Returns
Section titled “Returns”Promise<readonly GroupSecurityRollbackIntent[]>
Implementation of
Section titled “Implementation of”DurableGroupSecurityRollbackAnchor.loadIntents
poison()
Section titled “poison()”poison(
keyValue,forkPoisonValue,initialValue?):Promise<GroupSecurityRollbackAnchorValue>
Defined in: packages/core/src/group-security-rollback-anchor.ts:222
Atomically and irreversibly poison whichever active value is current and clear every intent.
Parameters
Section titled “Parameters”keyValue
Section titled “keyValue”forkPoisonValue
Section titled “forkPoisonValue”GroupSecurityRollbackForkPoison
initialValue?
Section titled “initialValue?”GroupSecurityRollbackAnchorValue
Returns
Section titled “Returns”Promise<GroupSecurityRollbackAnchorValue>
Implementation of
Section titled “Implementation of”DurableGroupSecurityRollbackAnchor.poison
prepare()
Section titled “prepare()”prepare(
keyValue,expectedValue,intentValue):Promise<boolean>
Defined in: packages/core/src/group-security-rollback-anchor.ts:167
Add intent beside the current value while expected is current
(undefined before the first anchor). The intent must extend expected.
An identical intent is kept once. Beyond
MAX_GROUP_SECURITY_ROLLBACK_INTENTS, the oldest is dropped. Return false
when expected is not current.
Parameters
Section titled “Parameters”keyValue
Section titled “keyValue”expectedValue
Section titled “expectedValue”GroupSecurityRollbackAnchorValue | undefined
intentValue
Section titled “intentValue”Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”DurableGroupSecurityRollbackAnchor.prepare
retire()
Section titled “retire()”retire(
keyValue,expectedValue,removalValue):Promise<boolean>
Defined in: packages/core/src/group-security-rollback-anchor.ts:262
Durably and atomically retire the exact active position after a verified removal. The caller authenticates the control and protocol Commit first. Retrying the identical expected position and marker is idempotent. A different current position returns false without changing state. Once written, the marker prevents every later active advance, including after store rollback, and every intent is cleared. Return true only after the exact terminal marker is durably retained.
Parameters
Section titled “Parameters”keyValue
Section titled “keyValue”expectedValue
Section titled “expectedValue”GroupSecurityRollbackAnchorValue
removalValue
Section titled “removalValue”Returns
Section titled “Returns”Promise<boolean>