Class InMemoryWebAuthnStore

java.lang.Object
com.revetsec.webauthn.InMemoryWebAuthnStore
All Implemented Interfaces:
WebAuthnStore

@ThreadSafe @CheckReturnValue public final class InMemoryWebAuthnStore extends Object implements WebAuthnStore
Explicit bounded, volatile, single-process WebAuthn store. Restart loses ceremonies, credentials, ownership tombstones, account fences and every recovery/time fence. Use durable shared authoritative storage for established accounts or deployments with several nodes. No ordinary read, predicate barrier or refusal reclaims records. A successful mutating commit atomically reclaims expired ceremonies outside its predicate set using the same fresh admitted store time. Permanent records are never evicted to make room.

The first operational call establishes this store's own volatile UTC/elapsed projection and admission metadata. The relying party's worker Clock is never its time source. Each operation checks the projection against fresh host UTC. A discontinuity starts a new clock generation, fencing old work; after a backward step the store waits for the last published time before it resumes. Construction performs no I/O, random acquisition or time sampling. This demonstration does not qualify external UTC, restore, device durability, suspend/rate continuity or a shared deployment.

Since:
1.0.0
  • Method Details

    • fromLimits

      public static @NonNull InMemoryWebAuthnStore fromLimits(@NonNull Integer maximumEntries, @NonNull Long maximumSealedBytes)
      Creates empty volatile storage with explicit count and aggregate sealed-byte capacity. Expired ceremonies may be reclaimed by a later successful mutating commit; permanent records are never evicted. One record may be up to 262144 bytes.
      Parameters:
      maximumEntries - capacity from 1 to 65536
      maximumSealedBytes - aggregate capacity from 1 to 268435456 bytes
      Returns:
      a new empty process-local store
      Since:
      1.0.0
    • read

      Description copied from interface: WebAuthnStore
      Reads every requested key at one authoritative snapshot point. A missing key is represented by an explicit WebAuthnStoreEntry.Absent entry. Admission retirement is Fenced; a provider failure is Unavailable, never fabricated absence.
      Specified by:
      read in interface WebAuthnStore
      Parameters:
      keys - the complete bounded read set
      remainingBudget - the remaining positive operation budget
      Returns:
      a coherent complete snapshot, fenced result or unavailable result
    • compareAndCommit

      Description copied from interface: WebAuthnStore
      Compares all snapshot versions and absences at one linearization point and applies all changes or none. Fresh healthy authority time must satisfy the original inclusive floor and exclusive expiry after all waits and before mutations. An empty mutation set is a timed predicate barrier. A known late commit stays COMMITTED with timing; an uncertain mutation is never safe to retry.
      Specified by:
      compareAndCommit in interface WebAuthnStore
      Parameters:
      write - the complete predicate and mutation set
      remainingBudget - the remaining positive operation budget
      Returns:
      the actual commit outcome
    • toString

      Redacts stored records and admission metadata. @since 1.0.0
      Overrides:
      toString in class Object