Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::format::reload::EpochFloorStore Class Reference

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",...).

Detailed Description

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.

Constructor & Destructor Documentation

◆ EpochFloorStore()

pulp::format::reload::EpochFloorStore::EpochFloorStore ( std::filesystem::path root)
inlineexplicit

Member Function Documentation

◆ accept_srl() [1/2]

SrlAcceptance pulp::format::reload::EpochFloorStore::accept_srl ( const SignedRevocationList & srl,
std::string_view namespace_key )
inline

Overload taking a pre-computed namespace key.

◆ accept_srl() [2/2]

SrlAcceptance pulp::format::reload::EpochFloorStore::accept_srl ( const SignedRevocationList & srl,
std::string_view plugin_id,
std::string_view revocation_pubkey_fpr,
std::string_view update_channel )
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.

◆ last_known()

std::optional< SignedRevocationList > pulp::format::reload::EpochFloorStore::last_known ( std::string_view namespace_key) const
inline

The last-known accepted SRL for a namespace, if any (offline-last-known).

Returns nullopt when Absent or Corrupt.

◆ make_namespace()

std::string pulp::format::reload::EpochFloorStore::make_namespace ( std::string_view plugin_id,
std::string_view revocation_pubkey_fpr,
std::string_view update_channel )
inlinestatic

Canonical namespace key: length-prefixed so ("a","bc",...) can't collide with ("ab","c",...).

The revocation pubkey fingerprint is lowercased.

◆ path_for()

std::filesystem::path pulp::format::reload::EpochFloorStore::path_for ( std::string_view namespace_key) const
inline

Absolute path of the file backing a namespace.

◆ read_floor()

SrlFloorState pulp::format::reload::EpochFloorStore::read_floor ( std::string_view namespace_key) const
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).


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/format/include/pulp/format/reload/revocation.hpp