Spring Boot service that stores and validates configuration documents for FINT Flyt integrations. It exposes an internal API for creating, updating, versioning, and deleting configurations, persists state in PostgreSQL, validates payloads against integration metadata via Kafka, and serves Kafka request/reply endpoints so other Flyt services can fetch configurations and mappings on demand.
- RESTful configuration registry — Spring MVC controller under
/internal/api/konfigurasjonerfor paginated listings, detail fetch, create, patch, and delete operations. - Versioned persistence — JPA repository backed by PostgreSQL automatically increments a configuration version when a document is marked as completed.
- Kafka request/reply bridges — Consumers expose configuration and mapping lookups, while producers fetch integrations, integration metadata, and instance metadata used during validation.
- Context-aware validation — Custom Jakarta Bean Validation constraints ensure integration↔metadata consistency, key uniqueness, type compatibility, and value parsability before persisting.
- Audited updates —
AuditorScopebinds the calling principal from JWTs solastModifiedBy/lastModifiedAtfields are populated through Spring Data auditing.
| Component | Responsibility |
|---|---|
ConfigurationController |
Handles internal HTTP requests, binds auditing context, orchestrates validation, and enforces completion rules. |
ConfigurationService |
Wraps repository access, DTO ↔ entity mapping, and mapping persistence for CRUD flows. |
ConfigurationRepository & ObjectMappingRepository |
Spring Data JPA repositories storing configurations and nested object mappings with custom versioning logic. |
ConfigurationMappingService & mapping helpers |
Convert between DTO graphs and entity graphs for mappings, collections, and per-key values. |
ConfigurationValidatorFactory & constraints |
Build validators with integration + metadata payload to validate references, keys, types, and completion-specific rules. |
IntegrationRequestProducerService, MetadataRequestProducerService, InstanceMetadataRequestProducerService |
Perform Kafka request/reply lookups so validation has the latest integration and metadata context. |
ConfigurationRequestConsumerConfiguration |
Registers Kafka consumers that answer configuration and mapping fetch requests by configuration ID for other Flyt services. |
TokenParsingUtils, TokenAuditorAware |
Extract auditing data from OAuth2 tokens and plug into Spring Data’s @EnableJpaAuditing. |
Base path: /internal/api/konfigurasjoner
| Method | Path | Description | Request body | Response |
|---|---|---|---|---|
GET |
/?side&antall&sorteringFelt&sorteringRetning&integrasjonId&ferdigstilt&ekskluderMapping |
Paginated listing filtered by integration and completion status. ekskluderMapping=true removes heavy mapping payloads. |
– | 200 OK with Page<ConfigurationDto>. |
GET |
/{configurationId}?ekskluderMapping |
Fetch a single configuration, optionally omitting the mapping section. | – | 200 OK with ConfigurationDto, 404 when missing. |
POST |
/ |
Create a configuration draft. Validates that integration and metadata IDs exist and mapping content passes structural checks. | ConfigurationDto JSON (see below). |
200 OK with persisted ConfigurationDto; validation failures return 422. |
PATCH |
/{configurationId} |
Update metadata reference, comment, mapping, or mark as completed. Completed configurations become immutable. | ConfigurationPatchDto JSON. |
200 OK with updated ConfigurationDto, 404 when missing, 403 if already completed. |
DELETE |
/{configurationId} |
Remove a configuration that is still a draft (not completed). | – | 204 No Content, 403 when completed, 404 when missing. |
Example ConfigurationDto payload:
{
"integrationId": 42,
"integrationMetadataId": 1337,
"comment": "Draft mapping for elevmappe",
"mapping": {
"valueMappings": [
{
"toKey": "case.status",
"fromValue": "OPPRETTET"
}
]
}
}Validation errors return 422 Unprocessable Entity with aggregated constraint messages. When the resource-server permissions consumer is enabled, access to non-authorized orgs yields 403 Forbidden.
ConfigurationRequestConsumerConfigurationexposes request/reply consumers that return either the full configuration or just the mapping for a configuration ID.IntegrationRequestProducerServicefetches the owning integration by ID to validate configuration references.MetadataRequestProducerServiceandInstanceMetadataRequestProducerServicefetch structural metadata and instance metadata content used by validators to verify keys, types, and required fields.- All topics follow Flyt domain defaults, use per-tenant prefixes, retain requests for five minutes, and set reply timeouts to five seconds for outbound templates.
The service does not define scheduled jobs; validation and versioning happen inline with POST/PATCH requests.
Spring profiles include common Flyt layers: flyt-kafka, flyt-logging, flyt-web-resource-server, and flyt-postgres.
Key properties:
| Property | Description |
|---|---|
fint.application-id |
Used for Kafka client IDs, request/reply reply topics, and default topic prefixes. |
novari.kafka.topic.org-id |
Scoped per kustomize overlay to control Kafka ACLs and topic names. |
fint.database.url, fint.database.username, fint.database.password |
PostgreSQL connection parameters injected from secrets. |
spring.security.oauth2.resourceserver.jwt.issuer-uri |
Identity provider for validating OAuth2 JWTs. |
management.endpoints.web.exposure.include |
Actuator endpoints exposed (health, info, prometheus). |
novari.flyt.web-resource-server.security.api.internal.* |
Toggles the internal API and per-org authorization matrix. |
Secrets referenced by the base manifest must supply database credentials and OAuth client configuration.
Prerequisites:
- Java 25+
- Docker (used by
start-postgreshelper) - Local Kafka broker (e.g.,
docker composeor existing dev cluster)
Helpful commands:
./gradlew clean build # compile sources and run tests
./gradlew test # unit + validation tests
./gradlew bootRun # start with Flyt profiles
./start-postgres # launch PostgreSQL on localhost:5434 (Ctrl+C/docker stop to tear down)Use SPRING_PROFILES_ACTIVE=local-staging to pick up overrides in src/main/resources/application-local-staging.yaml. The profile expects PostgreSQL on jdbc:postgresql://localhost:5434/fint-flyt-configuration-service, username postgres, password password, and Kafka on localhost:9092.
Swagger UI is available at http://localhost:8082/swagger-ui/index.html when the application runs with the local profile.
Kustomize layout:
kustomize/base/— shared Application manifest, Flyt wiring, secrets, and Actuator configuration.kustomize/overlays/<org>/<env>/— tenant-specific patches (namespace, labels, Kafka topics, ingress paths).
Templates live under kustomize/templates/:
overlay.yaml.tpl— canonical template rendered per overlay.
Regenerate overlays whenever template logic changes:
./scripts/render-overlay.shThe script walks all overlay directories, injects org/env-specific values (namespace, Kafka topic prefixes, role maps, ingress paths), and rewrites kustomization.yaml files in place.
- OAuth2 resource server that validates JWTs against
https://idp.felleskomponent.no. - Internal API gated by
novari.flyt.web-resource-server.security.api.internalwith optional per-org role mappings. TokenAuditorAwareandAuditorScopetie JWT claims to Spring Data auditing so updates are traceable.
- Liveness/readiness probe:
/actuator/health. - Prometheus metrics:
/actuator/prometheus. - Spring Boot structured logging; leverage Flyt log conventions for correlation IDs.
- Validators call Kafka services to verify metadata; stub
IntegrationRequestProducerService,MetadataRequestProducerService, andInstanceMetadataRequestProducerServicein tests when asserting validation rules. - Flyway migrations live in
src/main/resources/db/migration; add new scripts for schema changes instead of altering existing ones. ConfigurationMappingServicecentralizes DTO/entity conversion—extend it instead of duplicating mapping logic in controllers or services.
- Create a topic branch for your change.
- Run
./gradlew testbefore opening a pull request. - If you touch kustomize content, run
./scripts/render-overlay.shand commit the regenerated overlays. - Add or update unit/integration tests that cover new functionality or bug fixes.
———
FINT Flyt Configuration Service is maintained by the FINT Flyt team. Reach out on the internal Slack channel or open an issue in this repository for questions or enhancement requests.