Files
moloapp/src/supplychain/policy/WolfPin.hpp
T
retoor 3c4334cec9 feat: implement MoloApp plans 01-15 with integration
Full C++23 framework tree: runtime, observability, security,
data, app, realtime, supervisor, clients, CLI, example plus
enterprise tenancy, audit, operability, governance,
supplychain. Postgres via docker compose for tests.
2026-10-23 18:20:04 +02:00

33 lines
920 B
C++

#pragma once
#include <string>
#include <string_view>
namespace molo::supply::policy {
// The pinned wolfSSL release: the sole third-party dependency. Parsed from
// the "wolfssl" object of supply.allow.json:
// {"wolfssl": {"version": "X.Y.Z", "sha256": "<64hex>", "source": "...",
// "license": "...", "receipt": "..."}}.
class WolfPin {
public:
struct Pin {
std::string version;
std::string sha256;
std::string source;
std::string license;
std::string receipt;
};
enum class Check { Ok, VersionMismatch, HashMismatch };
WolfPin() = delete;
static bool parse_pin(std::string_view text, Pin& out, std::string& error);
static bool load_file(const std::string& path, Pin& out, std::string& error);
static Check check(const Pin& pin, std::string_view version, std::string_view sha256);
static const char* to_string(Check c);
};
} // namespace molo::supply::policy