Class AbandonedCeremonyPolicy

java.lang.Object
io.jans.fido2.service.app.AbandonedCeremonyPolicy

public final class AbandonedCeremonyPolicy extends Object
Resolves the timing the abandonment sweep depends on.

The sweep and the code that writes pending ceremonies have to agree on two derived values, and they live in different classes. Deriving both here keeps the invariant in one place: a pending ceremony must survive long enough for at least one sweep to claim it after its window elapses, but no longer than necessary.

Author:
Janssen Project
  • Method Details

    • effectiveSweepInterval

      public static int effectiveSweepInterval(Fido2Configuration fido2Configuration)
      The interval the sweep actually runs at.

      A configured interval at or above unfinishedRequestExpiration is not usable: a ceremony could lapse and be deleted entirely between two passes. Such a value is capped rather than honoured, because silently sweeping too slowly loses data while running more often does not.

      Returns:
      a positive interval in seconds, strictly below the ceremony window whenever that window itself leaves room for one
    • isSweepIntervalOverridden

      public static boolean isSweepIntervalOverridden(Fido2Configuration fido2Configuration)
      True when the configured interval had to be overridden, so the caller can say so once at startup rather than on every pass.
    • pendingCeremonyRetention

      public static int pendingCeremonyRetention(Fido2Configuration fido2Configuration)
      How long a pending ceremony is retained.

      The row has to outlive its own ceremony window, otherwise it becomes eligible for deletion at the same instant the sweep becomes eligible to claim it and abandonment goes unrecorded. Two sweep intervals of grace guarantees a pass falls inside it. This does not widen the window in which an assertion is accepted — that is enforced against the ceremony's issue time when it is verified.

      With the sweep disabled the retention is exactly what it always was, so nothing changes for a deployment that has opted out.