Directory-backed store of the highest SRL epoch SEEN, namespaced by (plugin_id + revocation_pubkey_fpr + update_channel). More...
#include <revocation.hpp>
Public Member Functions | |
| EpochFloorStore (std::filesystem::path root) | |
| std::filesystem::path | path_for (std::string_view namespace_key) const |
| Absolute path of the file backing a namespace. | |
| SrlFloorState | read_floor (std::string_view namespace_key) const |
| Read the persisted floor for a namespace. | |
| std::optional< SignedRevocationList > | last_known (std::string_view namespace_key) const |
| The last-known accepted SRL for a namespace, if any (offline-last-known). | |
| SrlAcceptance | accept_srl (const SignedRevocationList &srl, std::string_view plugin_id, std::string_view revocation_pubkey_fpr, std::string_view update_channel) |
| Offer a (already signature-verified) SRL for the given namespace. | |
| SrlAcceptance | accept_srl (const SignedRevocationList &srl, std::string_view namespace_key) |
| Overload taking a pre-computed namespace key. | |
Static Public Member Functions | |
| static std::string | make_namespace (std::string_view plugin_id, std::string_view revocation_pubkey_fpr, std::string_view update_channel) |
| Canonical namespace key: length-prefixed so ("a","bc",...) can't collide with ("ab","c",...). | |
Directory-backed store of the highest SRL epoch SEEN, namespaced by (plugin_id + revocation_pubkey_fpr + update_channel).
Each namespace maps to one file named by the sha256 of a length-prefixed key (so plugin_id / channel strings can never collide or escape the directory via path characters). The file holds the full canonical SRL JSON — both the epoch floor AND the offline-last-known revocation content live in it.
Writes are atomic (temp file + rename). All methods are control-thread only.
|
inlineexplicit |
|
inline |
Overload taking a pre-computed namespace key.
|
inline |
Offer a (already signature-verified) SRL for the given namespace.
Accepts only if its epoch is STRICTLY greater than the stored floor; an epoch <= the floor is a rollback and is refused. On acceptance the SRL is persisted atomically as the new last-known. A corrupt existing floor is refused (fail-closed) rather than overwritten.
|
inline |
The last-known accepted SRL for a namespace, if any (offline-last-known).
Returns nullopt when Absent or Corrupt.
|
inlinestatic |
Canonical namespace key: length-prefixed so ("a","bc",...) can't collide with ("ab","c",...).
The revocation pubkey fingerprint is lowercased.
|
inline |
Absolute path of the file backing a namespace.
|
inline |
Read the persisted floor for a namespace.
A missing file → Absent (first-ever SRL, no floor to violate). A present-but-unparseable file → Corrupt (fail-closed — never silently treated as epoch 0, which would re-open the rollback window).