Files
moloapp/src/cli/csp/csp_builder.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

32 lines
799 B
C++

#pragma once
#include <string>
#include "csp/csp_policy.hpp"
namespace molo::csp {
// Fluent builder. Default is deny-first per 09-cli-ops.md rule 10.
class CspBuilder {
public:
CspBuilder();
CspBuilder& default_src(const std::string& value);
CspBuilder& script_src(const std::string& value);
CspBuilder& style_src(const std::string& value);
CspBuilder& img_src(const std::string& value);
CspBuilder& connect_src(const std::string& value);
CspBuilder& frame_ancestors(const std::string& value);
CspBuilder& report_to(const std::string& value);
CspBuilder& script_nonce(const std::string& nonce_base64);
CspBuilder& enforce();
CspPolicy build() const;
private:
std::map<std::string, std::string> directives_;
bool report_only_ = true;
};
} // namespace molo::csp