1. Overview
Rule engine data model. Declares operator types, rule metadata, matching APIs and the rule/alias loader.
The original source path is:
include/bsc/rule/Rule.hpp
2. Role in the Daemon
This file participates in the privileged BastionGuard Secure Connection daemon. It uses the shared bsc models and follows the daemon-wide fallback strategy: optional high-fidelity backends are used when available, while portable polling or stub behavior preserves service startup.
3. Namespaces
bsc::rule
4. Dependencies and Included Interfaces
bsc/model/Connection.hppmapoptionalregexstringvector
5. Declared Types
enum class OperatorTypestruct Operatorstruct Ruleclass Loader
6. State and Data Members
The interface declares the following relevant state members:
std::string operandstd::string datastd::vector<Operator> liststd::string namestd::string descriptionOperator opstd::vector<Rule> rules_std::map<std::string, std::vector<std::string>> aliases_
7. API and Functions
The file declares or implements the following callable entry points:
public: void load_aliases(const std::string& path)void load_directory(const std::string& dir)bool save_rule(const Rule& rule, const std::string& dir) const
8. Rule Model
Operator represents recursive predicates. Rule adds action, duration, enablement, precedence and logging behavior. Loader owns aliases and the ordered rule collection.
9. External Resources and Protocol Values
Relevant paths, endpoints, command names or policy values referenced by this file include:
bsc/model/Connection.hppallow
10. Implementation Considerations
- The file follows the daemon-wide convention of returning status values or optional objects instead of making recoverable conditions fatal.
11. Source Metrics
| Metric | Value |
|---|---|
| File size | 1324 bytes |
| Lines | 49 |
| Detected API entries | 3 |
| Detected types | 4 |
