ORE Studio 0.0.4
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
ores::variability::domain Namespace Reference

Domain types for system variability. More...

Classes

struct  feature_flags
 Represents a feature flag in the domain layer. More...
 
struct  system_flag_definition
 Metadata for a system flag including its default state and description. More...
 
struct  system_flags_cache
 POD containing cached values of well-known system flags. More...
 

Enumerations

enum class  system_flag { bootstrap_mode , user_signups , signup_requires_authorization , disable_password_validation }
 Enumeration of well-known system flags. More...
 

Functions

std::ostream & operator<< (std::ostream &s, const feature_flags &v)
 Dumps the feature flags object to a stream in JSON format.
 
std::string convert_to_table (const std::vector< feature_flags > &v)
 Converts feature flags to table format.
 
std::ostream & operator<< (std::ostream &s, const std::vector< feature_flags > &v)
 Dumps the feature flags object to a stream in table format.
 
std::string to_flag_name (system_flag flag)
 Converts a system_flag enum value to its database name.
 
std::optional< system_flagfrom_flag_name (std::string_view name)
 Attempts to parse a database flag name to a system_flag enum.
 
const system_flag_definitionget_definition (system_flag flag)
 Gets the definition for a system flag.
 
std::ostream & operator<< (std::ostream &os, system_flag flag)
 Stream output operator for system_flag.
 
void print_feature_flags_table (std::ostream &s, const std::vector< feature_flags > &v)
 
std::string convert_to_json (const feature_flags &v)
 Dumps the feature flags object to a stream in JSON format.
 
std::string convert_to_json (const std::vector< feature_flags > &v)
 

Variables

constexpr std::array system_flag_definitions
 Compile-time manifest of all system flags with their defaults.
 

Detailed Description

Domain types for system variability.

Contains core entity types for feature flags and system configuration including feature_flag and system_flags types with JSON I/O support.

Enumeration Type Documentation

◆ system_flag

enum class system_flag
strong

Enumeration of well-known system flags.

System flags are compile-time known feature flags that control core system behaviour. Unlike dynamic feature flags which can be created at runtime, system flags have predefined names, descriptions, and default values.

The flag names in the database use the "system." prefix followed by the snake_case enum name (e.g., system_flag::bootstrap_mode maps to "system.bootstrap_mode").

Enumerator
bootstrap_mode 

Indicates whether the system is in bootstrap mode.

When enabled, the system is waiting for the initial admin account to be created. Once an admin account exists, this flag should be disabled. Default: enabled (true)

user_signups 

Controls whether user self-registration is allowed.

When enabled, users can create their own accounts through the signup process. When disabled, only administrators can create accounts. Default: disabled (false)

signup_requires_authorization 

Controls whether new signups require admin authorization.

When enabled, newly signed-up accounts require administrator approval before they can be used. When disabled, accounts are immediately active. Note: This feature is not yet implemented - enabling this flag will cause signup to fail with an error. Default: disabled (false)

disable_password_validation 

Controls whether password policy validation is disabled.

When enabled, disables strict password validation requirements. This is intended for testing and development environments only. Default: disabled (false) - password validation is enforced.

Function Documentation

◆ to_flag_name()

std::string to_flag_name ( system_flag  flag)

Converts a system_flag enum value to its database name.

The database name uses the "system." prefix followed by the snake_case enum name.

Parameters
flagThe system flag enum value.
Returns
The database name string (e.g., "system.bootstrap_mode").
Here is the caller graph for this function:

◆ from_flag_name()

std::optional< system_flag > from_flag_name ( std::string_view  name)

Attempts to parse a database flag name to a system_flag enum.

Parameters
nameThe database name (e.g., "system.bootstrap_mode").
Returns
The system_flag if the name matches a known flag, std::nullopt otherwise.
Here is the caller graph for this function:

◆ get_definition()

const system_flag_definition & get_definition ( system_flag  flag)

Gets the definition for a system flag.

Parameters
flagThe system flag to look up.
Returns
The flag definition containing default state and description.
Here is the caller graph for this function:

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
system_flag  flag 
)

Stream output operator for system_flag.

Outputs the flag name in a human-readable format.

Variable Documentation

◆ system_flag_definitions

constexpr std::array system_flag_definitions
constexpr
Initial value:
= {
system_flag_definition {
.flag = system_flag::bootstrap_mode,
.default_enabled = true,
.description = "Indicates whether the system is in bootstrap mode "
"(waiting for initial admin account)."
},
.flag = system_flag::user_signups,
.default_enabled = false,
.description = "Controls whether user self-registration is allowed."
},
system_flag_definition {
.flag = system_flag::signup_requires_authorization,
.default_enabled = false,
.description = "Controls whether new signups require admin authorization. "
"NOT YET IMPLEMENTED - enabling will cause signup to fail."
},
system_flag_definition {
.flag = system_flag::disable_password_validation,
.default_enabled = false,
.description = "When enabled, disables strict password validation. "
"FOR TESTING/DEVELOPMENT ONLY."
}
}
Metadata for a system flag including its default state and description.
Definition system_flags.hpp:87

Compile-time manifest of all system flags with their defaults.

This array defines all well-known system flags, their default enabled state, and human-readable descriptions. The system_flags_seeder service uses this manifest to ensure all system flags exist in the database at startup.