Loading…
Loading…
Technical reference for managing system-wide configuration settings, including tenancy, secret management, and runtime tunables for the API platform.
The System Settings repository provides a centralized mechanism for managing and persisting system-wide configuration. It serves as the source of truth for operational parameters, feature flags, and tenant-specific customizations that need to be configurable without requiring a new deployment.
This component solves the problem of managing dynamic configuration by storing settings in a database table, s2r_system_setting. It provides services with a typed, tenant-aware API to read these settings. Key responsibilities include:
MUTABLE_KEYS) dictates which settings can be modified at runtime.Other services and components throughout the platform consume this repository to retrieve their configuration dynamically. API publishers with administrative privileges can modify these settings through the admin API.
The SystemSettingRepository manages settings as key-value pairs stored in the s2r_system_setting database table. The system's behavior is governed by the interaction of several core mechanisms: data storage and tenancy, reading and writing settings, and specialized handling for secrets.
System settings are stored with tenant affinity. The platform supports a two-tiered configuration model:
__platform__).When a setting is read, the system first looks for a value specific to the current tenant. If one exists, it is used. If not, the system falls back to the platform-default value. This overlay allows for both global configuration and per-tenant customization. SQL queries are explicitly scoped to ensure a tenant's request can only access its own settings or the platform defaults, never the settings of another tenant.
Settings are retrieved from the database using methods that respect the tenant-overlay model.
findEffectiveMap() method returns a map of all effective settings for the current tenant, with tenant-specific values shadowing platform defaults.getInt(), getString(), and getBoolean() retrieve a single setting value. They query for the tenant-specific value first, then the platform default, and finally return a caller-provided default if neither is found.All read operations for secret values are handled specially to avoid exposing sensitive data (see Secret Management).
Settings are modified via the patch() method, which accepts a map of key-value pairs to update. The process is as follows:
MUTABLE_KEYS allow-list. An attempt to modify a non-mutable key results in an IllegalArgumentException.install_profile must be one of a few allowed strings. Invalid values are rejected.SECRET_KEYS set), its value is encrypted using the CredentialsCipher service before being persisted. A blank or null value is ignored, preserving the existing secret.s2r_system_setting table using an UPSERT operation (INSERT ... ON CONFLICT ... DO UPDATE). This creates the setting if it's new for the tenant or updates the existing one. The user or process performing the update is recorded as the actor.To protect sensitive data, certain settings are designated as secrets.
SECRET_KEYS) like alert_smtp_password and f5_password are treated as secrets.patch(), the value is encrypted before being stored in the database. The stored value is a JSON object containing the encrypted data and algorithm details.findEffectiveMap(), any secret value is removed from the map. In its place, a boolean flag named <key>_set is added (e.g., f5_password_set). This confirms whether a value has been configured without exposing the value itself.getSecret(String key) method, which retrieves the encrypted value from the database and decrypts it.encryptLegacyPlaintextSecrets() method provides a way to find and encrypt any secrets that were stored in plain text before the encryption-at-rest feature was implemented. This is an idempotent operation designed to be run once per tenant.For a few critical, globally-used settings, the repository provides dedicated resolver methods that implement a multi-tiered fallback logic. This makes the system resilient to misconfiguration and provides flexible overrides. The standard resolution chain is:
s2r_system_setting table for the current tenant.This pattern is used for the following settings:
public_base_urlopenapi.primary_localeopenapi.supported_localeslocal.timezoneThe diagram below illustrates the resolution flow for the public_base_url setting.
flowchart TD
subgraph resolvePublicBaseUrl()
A[Read 'public_base_url' from DB] --> B{Value present?};
B -- Yes --> C[Use DB value];
B -- No / DB Error --> D[Read S2R_PUBLIC_BASE_URL env var];
D --> E{Value present?};
E -- Yes --> F[Use env var value];
E -- No --> G[Use empty string];
C --> H[Strip trailing slashes];
F --> H;
G --> I[Return final value];
H --> I;
endThe SystemSettingRepository exposes the following public methods for use by other platform services.
| Method | Description |
|---|---|
List<SystemSettingRecord> findAllEffective() | Returns a list of all effective setting records for the current tenant, including overrides and platform defaults. |
Map<String, Object> findEffectiveMap() | Returns a map of all effective settings for the current tenant. Tenant-specific values override platform defaults. Secret values are masked. |
Map<String, Object> patch(Map, String) | Applies a set of updates to the system settings for the current tenant. Validates keys and values, encrypts secrets, and persists the changes. The String parameter is the actor performing the change. |
String getSecret(String key) | Retrieves and decrypts the value of a secret setting. Throws IllegalArgumentException if the key is not in the SECRET_KEYS set. Returns null if the secret is not set. |
int getInt(String key, int defaultValue) | Retrieves the integer value for a key, falling back to defaultValue if not set or unparseable. |
long getLong(String key, long defaultValue) | Retrieves the long value for a key, falling back to defaultValue if not set or unparseable. |
boolean getBoolean(String key, boolean dv) | Retrieves the boolean value for a key, falling back to defaultValue if not set or unparseable. Recognizes "true", "1", "false", "0". |
String getString(String key, String dv) | Retrieves the string value for a key, falling back to defaultValue if not set or blank. |
String resolvePublicBaseUrl() | Resolves the public base URL for the platform using the DB → Env → Default resolution chain. |
String resolveOpenApiPrimaryLocale() | Resolves the primary locale (BCP-47 tag) for OpenAPI specifications using the DB → Env → Default (en-US) resolution chain. |
List<String> resolveOpenApiSupportedLocales() | Resolves the list of supported locales for OpenAPI specifications using the DB → Env → Default (primary locale) resolution chain. |
java.time.ZoneId resolveLocalZone() | Resolves the local timezone (IANA ID) for the platform using the DB → Env → Default (UTC) resolution chain. |
int encryptLegacyPlaintextSecrets() | Finds and encrypts any plaintext secret settings for the current tenant. Returns the number of settings migrated. |
The following table lists all system settings that are mutable at runtime via the Admin API.
NOTE
The license enforcement settings specaria_read_only_after_days, specaria_hard_stop_after_days, and specaria_latency_injection_ms were previously mutable here. They have been removed to prevent modification and are now managed via code defaults and environment variables.
| Name | Type | Default | Description |
|---|---|---|---|
max_sync_payload_mb | Integer | — | The maximum size in megabytes for a synchronization payload. |
default_timeout_ms | Integer | — | Default timeout in milliseconds for operations. |
default_retry_count | Integer | — | Default number of retries for failed operations. |
default_retention_days | Integer | — | Default retention period in days for audit and structured runtime data. |
public_base_url | String | "" | The public base URL where the platform is reachable. Used to generate absolute URLs in OpenAPI specs. Resolution order: DB setting → S2R_PUBLIC_BASE_URL environment variable → empty string. |
install_profile | String | — | Sets the installation profile, which gates features like F5 discovery. Must be one of: f5_modernization, generic_soap_to_rest, or both. |
dashboard_freshness_stale_minutes | Integer | 60 | The threshold in minutes after which a traffic source is marked as "stale" on the Operations Dashboard if its data has not been refreshed. |
openapi.primary_locale | String | en-US | The primary locale (BCP-47 tag) for generated OpenAPI documentation. Resolution order: DB → S2R_OPENAPI_PRIMARY_LOCALE env var → en-US. |
openapi.supported_locales | String | en-US | A separator-delimited list (e.g., he-IL;en-US) of supported locales. Resolution order: DB → S2R_OPENAPI_SUPPORTED_LOCALES env var → primary locale. |
local.timezone | String | UTC | The local timezone for the deployment, as an IANA zone ID (e.g., Asia/Jerusalem). Resolution order: DB → S2R_LOCAL_TIMEZONE env var → UTC. |
These settings control the platform's automatic update behavior.
| Name | Type | Default | Description |
|---|
update_channel | String | release | The update channel for the deployment. Valid values: internal, beta, early-access, release. The legacy aliases stable, early-release, and rc are also accepted on write. - |update_mode | String | operator_approved | The update mode. operator_approved requires manual approval for updates. auto allows automatic updates within the defined window. - |update_check_interval_hours | Integer | 24 | The interval in hours for checking for new updates. Must be between 1 and 168. - |update_window_utc_start_hour | Integer | 2 | The hour (in UTC, 0-23) when the automatic update window begins.