Skip to content

Configuration API

  • INTRODUCED BY: Initial architecture
  • IMPLEMENTED BY: Configuration Controller
  • Owner application: Configuration
  • Interface patterns: Architecture Patterns (Synchronous REST)
  • Security scenario: command-over-HTTP / internal authority

REST API providing endpoints for CRUD operations and bulk updates on dynamic configurations partitioned by namespace.

Method Path Required Role Description
GET /configurations CONFIGURATION_VIEW Search, filter, and paginate configurations across namespaces
GET /configurations/{key} CONFIGURATION_VIEW Fetch a single configuration entity by key
GET /configurations/namespace/{namespace} CONFIGURATION_VIEW Retrieve all configurations for a given namespace
POST /configurations CONFIGURATION_ADD Create a new dynamic configuration entity
PUT /configurations/{id} CONFIGURATION_EDIT Update an existing configuration by ID
PUT /configurations/bulk CONFIGURATION_EDIT Atomically bulk-update multiple configurations within a single transaction
DELETE /configurations/{id} CONFIGURATION_DELETE Delete a configuration entity by ID

POST /configurations, PUT /configurations/{id}, and PUT /configurations/bulk support polymorphic type: "TABLE" payloads (CreateTableConfigurationRequest, EditTableConfigurationRequest, TableConfigurationResponse):

  • Schema (columns): Non-empty list of TableColumn definitions (key, label, columnType, required, selectableValues). Supported TableColumnType values are INPUT, SWITCH, DROPDOWN, and MULTISELECT (nested MAPPING or TABLE columns are excluded). Column keys must be unique and match ^[a-zA-Z0-9\-_]*$. DROPDOWN and MULTISELECT columns must define non-empty selectableValues.
  • Matrix (rows): Optional list of TableRow entries, each containing cells (TableCell with columnKey, scalar value, or list values). Omitting rows (null) on PUT /configurations/{id} or PUT /configurations/bulk clears any previously stored rows.
  • Cell Exclusivity & Lenient Coercion: MULTISELECT cells must use values (rejecting scalar value), whereas INPUT, SWITCH, and DROPDOWN cells must use value (rejecting values). TableCell.LenientStringDeserializer coerces JSON strings, numbers, and booleans on value to strings and rejects non-scalar JSON objects ({}) or arrays ([]).
  • Validation Errors: TableConfigurationValidator rejects missing/duplicate columns, unknown columnKey references, invalid SWITCH values (non-true/false), out-of-range DROPDOWN/MULTISELECT options, or missing required cells with HTTP 400 Bad Request (ResponseCode.INVALID_REQUEST). In PUT /configurations/bulk, any validation failure rolls back the MongoDB transaction with zero events emitted.
{
"key": "pricing.ancillary-fee-matrix",
"namespace": "pricing",
"description": "Typed ancillary fee rules by channel and cabin",
"type": "TABLE",
"columns": [
{
"key": "channel",
"label": "Channel",
"columnType": "DROPDOWN",
"required": true,
"selectableValues": ["DIRECT", "NDC"]
},
{ "key": "feeAmount", "label": "Fee Amount", "columnType": "INPUT", "required": true },
{ "key": "active", "label": "Active", "columnType": "SWITCH", "required": true },
{
"key": "cabins",
"label": "Cabins",
"columnType": "MULTISELECT",
"required": false,
"selectableValues": ["Y", "C"]
}
],
"rows": [
{
"cells": [
{ "columnKey": "channel", "value": "NDC" },
{ "columnKey": "feeAmount", "value": 12.5 },
{ "columnKey": "active", "value": true },
{ "columnKey": "cabins", "values": ["Y", "C"] }
]
}
]
}

All incoming HTTP requests must include a valid Bearer JWT issued by Keycloak. Operations are authorized using fine-grained RBAC roles (CONFIGURATION_VIEW, CONFIGURATION_ADD, CONFIGURATION_EDIT, CONFIGURATION_DELETE). Consuming microservices using the util-configuration library authenticate via OAuth2 client credentials grant.

None

Initial Architecture Baseline — 2026-10-12

Section titled “Initial Architecture Baseline — 2026-10-12”

Reason: Interface introduced as primary internal REST management and client fetch API.

  • Is strictly confidential data (e.g., traveler PII, travel documents, payment data, PCI, credentials) excluded from event payloads and responses whenever unnecessary and feasible? Confirmed: Configurations manage runtime behavior, URLs, thresholds, and flags; no traveler PII or cardholder data is stored or returned.
  • Can the sender’s identity be verified? Verified via Keycloak OIDC Bearer token signature validation and internal service mesh mTLS.
  • Are there authorization checks preventing cross-application data access beyond what is needed? Enforced via Keycloak RBAC role validation on each controller endpoint and namespace validation.