Class AbandonedCeremonyPolicy
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 Summary
Modifier and TypeMethodDescriptionstatic inteffectiveSweepInterval(Fido2Configuration fido2Configuration) The interval the sweep actually runs at.static booleanisSweepIntervalOverridden(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.static intpendingCeremonyRetention(Fido2Configuration fido2Configuration) How long apendingceremony is retained.
-
Method Details
-
effectiveSweepInterval
The interval the sweep actually runs at.A configured interval at or above
unfinishedRequestExpirationis 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
True when the configured interval had to be overridden, so the caller can say so once at startup rather than on every pass. -
pendingCeremonyRetention
How long apendingceremony 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.
-