Repository navigation
Closed
Labels
priority: highHigh prioritystatus: triageHas not been triaged by admintype: featureNew feature or requestworkload: daysLikely takes days to resolve
Description
Problem
Operators of FOCA apps can't adapt an app's API specification or access control policies through configuration without forking them in their config:
api.specs[].pathalready merges several spec files in order (later files win), so a small operator file could, e.g., require a token for operations that an app makes public (security: []). But config overlays replace lists, andapi.specsand itspathare lists: to add one file, an operator must copy the app's wholeapi.specsentry (all spec paths, controller and Connexion options). When an upgrade adds a spec file or changes an option, the stale copy silently drops it.- The same holds for
security.access_control.policies: changing or adding one rule means copying the whole list.
Example (cloud-registry): an operator who wants all reads to require login, except GET /service-info, can't do that with an overlay that survives upgrades.
Expected
Generic, composable modding instead of one option per use case:
- Spec patches: a per-spec field (e.g.,
api.specs[].patches), a list of YAML/JSON files (paths relative to the config file declaring them, as forpath) or inline objects, deep-merged into the spec last, afterpathandappendand beforeadd_operation_fields/add_security_fields, with the same merge rules aspath(dicts merged, other values replaced). Apps leave it empty; operators set it. - Keyed overlays: config overlays can address a spec entry without restating it, e.g., an optional unique
nameonapi.specs[]entries, and overlay list entries with a matchingnameare merged into that entry instead of replacing the list (like Kubernetes strategic merge by key). Entries withoutnamekeep today's behaviour. - Named policies: a way to add, change or remove single access control rules from an overlay (e.g., policies as a mapping from rule name to rule, or named list entries merged by name), keeping today's list form working.
- Safety: validation at startup (unknown spec names, patches that make the spec invalid, policies that don't validate fail with a clear error); an INFO log listing which patches and named policies were applied; a warning in the logs when a patch removes
securityfrom an operation. - Docs: a section on modding specs and policies with a prominent warning banner (patches can weaken or remove authentication and access control; review them like code), and a recipe: "require login for all reads except
/service-info" (spec patch, plus the policies that allowGETfor any authenticated user). - Tests for merge order, keyed overlays, named policies, validation errors and the recipe.
Target: FOCA 0.17.0. Follow-up in cloud-registry: default GET policies for any authenticated user and the recipe in its docs (separate issue).
Metadata
Metadata
Assignees
Labels
priority: highHigh prioritystatus: triageHas not been triaged by admintype: featureNew feature or requestworkload: daysLikely takes days to resolve
Activity
fix: address Sourcery review findings
test: drop unused type ignore
uniqueg commentedon Oct 22, 2026
Done in #409.