Skip to content

config_update

config_update is implemented by handleConfigUpdate in src/api/handlers/server/config_update.osl.

Deep-merges updates into config.json. Sensitive keys cannot be written, hosted paths can be locked, and only the owner role may change top-level DB, websocket, auth_mode, or cracked. Listener changes require restart.

Gate Requirement
Authentication Required by the central API gate.
Central permission manage_config
Broadcast Not marked global directly by this adapter. A helper may emit focused or server-wide updates.

Every request includes cmd: "config_update" and may include an opaque listener correlation value.

Field Validation / meaning
updates schema.record(schema.any()).minLen(1)

The handler and shared validation path use these OSL schema definitions before normalization:

*schema.Schema schemaConfigUpdate = schema.object({
updates: schema.record(schema.any()).minLen(1)
})
  1. handleCmd enforces authentication and the manage_config permission.
  2. dispatchCmd routes config_update to handleConfigUpdate.
  3. The adapter validates and normalizes input, then calls its domain collaborators.
  4. Durable mutations complete before the response or event is returned.
  5. onMessage adds the request listener to direct responses and performs any marked broadcast.

Direct collaborators visible in the handler: userFromId, configApply, auditRecord, getKeys

Response/event command names visible in this adapter: config_update.

Validation and domain failures use:

{
"cmd": "error",
"val": "<message>",
"src": "config_update",
"listener": "<copied from request>"
}