Class WebAuthnStoreWrite.Mutation
java.lang.Object
com.revetsec.webauthn.WebAuthnStoreWrite.Mutation
- Enclosing class:
WebAuthnStoreWrite
A typed insertion, replacement or deletion of a key from the read set.
- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe three atomic write operations. -
Method Summary
Modifier and TypeMethodDescriptionDeletes a versioned record.Returns the ceremony reclamation deadline, if supplied.getKey()Returns the changed key.getKind()Returns the mutation kind.Returns a defensive copy of the sealed payload, or empty for deletion.insert(@NonNull WebAuthnStoreKey key, byte @NonNull [] sealedBytes) Inserts a sealed record only if the read set confirms absence.insertExpiring(@NonNull WebAuthnStoreKey key, byte @NonNull [] sealedBytes, @NonNull Instant expiresAt) Inserts a ceremony with a store-visible reclamation deadline.replace(@NonNull WebAuthnStoreKey key, byte @NonNull [] sealedBytes) Replaces a versioned sealed record.replaceExpiring(@NonNull WebAuthnStoreKey key, byte @NonNull [] sealedBytes, @NonNull Instant expiresAt) Replaces a ceremony while retaining its store-visible reclamation deadline.toString()Redacts the key and payload.
-
Method Details
-
insert
public static @NonNull WebAuthnStoreWrite.Mutation insert(@NonNull WebAuthnStoreKey key, byte @NonNull [] sealedBytes) Inserts a sealed record only if the read set confirms absence.- Parameters:
key- the absent keysealedBytes- the new sealed record- Returns:
- the insertion
- Since:
- 1.0.0
-
insertExpiring
public static @NonNull WebAuthnStoreWrite.Mutation insertExpiring(@NonNull WebAuthnStoreKey key, byte @NonNull [] sealedBytes, @NonNull Instant expiresAt) Inserts a ceremony with a store-visible reclamation deadline. Core also checks the authenticated expiry in the sealed record before accepting a completion.- Parameters:
key- the absent ceremony keysealedBytes- the sealed ceremonyexpiresAt- the deadline after which the store may remove the ceremony- Returns:
- the insertion
- Since:
- 1.0.0
-
replace
public static @NonNull WebAuthnStoreWrite.Mutation replace(@NonNull WebAuthnStoreKey key, byte @NonNull [] sealedBytes) Replaces a versioned sealed record.- Parameters:
key- the versioned keysealedBytes- the new sealed record- Returns:
- the replacement
- Since:
- 1.0.0
-
replaceExpiring
public static @NonNull WebAuthnStoreWrite.Mutation replaceExpiring(@NonNull WebAuthnStoreKey key, byte @NonNull [] sealedBytes, @NonNull Instant expiresAt) Replaces a ceremony while retaining its store-visible reclamation deadline.- Parameters:
key- the versioned ceremony keysealedBytes- the new sealed ceremonyexpiresAt- the deadline after which the store may remove the ceremony- Returns:
- the replacement
- Since:
- 1.0.0
-
delete
Deletes a versioned record. Retain a replay tombstone where protocol rules require it.- Parameters:
key- the versioned key- Returns:
- the deletion
- Since:
- 1.0.0
-
getKey
-
getKind
Returns the mutation kind.- Returns:
- the kind
- Since:
- 1.0.0
-
getSealedBytes
Returns a defensive copy of the sealed payload, or empty for deletion.- Returns:
- the payload, if any
- Since:
- 1.0.0
-
getExpiresAt
Returns the ceremony reclamation deadline, if supplied. It is an exact projection of the authenticated expiry, not authority to delete during reads or a no-effect refusal. A successful mutating commit may reclaim an expired ceremony outside its predicate set after rechecking it against current healthy admitted time. Other record kinds are never reclaimed by this hint.- Returns:
- the optional maintenance deadline
- Since:
- 1.0.0
-
toString
-