Repository navigation
Releases
v0.23.0
FOCA 0.23.0 hardens apps against clients that send large bodies or no tokens, and extends the plugin gateway for WES. Request bodies are limited by default (10 MiB, URL-encoded bodies 500 kB) and checked before requests are authenticated, and on operations with bearer tokens that FOCA validates, the token is checked before the body is read. Subjects are always namespaced by their issuer, also with a single trusted issuer, which changes the users that apps and FOCA store; existing deployments keep bare subjects with namespace: "" or rewrite them with the new command foca namespace-subjects. Plugins of WES gateways get runs in a defined shape, backend lists know WES, FOCA resolves the credentials of backends, and guarded HTTP clients and registry reads can trust private certificate authorities. Apps get helpers for lists paged with page tokens, patches of specifications can remove keys, the permissions API reports invalid fields, the plugin store limits the size of each namespace, and $ in patterns matches at the end only. Several changes need action in apps, deployments or clients: see the migration guide.
Breaking changes
- Subjects are namespaced by their issuer (
<namespace>|<subject>) also if only one issuer is trusted:get_current_subject(),get_on_behalf_of_user(),namespace_subject(), thePrincipalof gateway plugins, audit events, stored rules and roles (user:<namespace>|<subject>) and owner fields; stored bare users no longer apply, and apps refuse to start while configured rules name bare users. Setnamespace: ""for the issuer to keep subjects bare, or rewrite stored rules withfoca namespace-subjects(see Subjects are always namespaced by issuer) (#631, #773) - Request bodies larger than 10 MiB are rejected with
413by default (server.max_content_length, before without a limit), and URL-encoded bodies larger than 500 kB too (new settingserver.max_form_memory_size); bodies are checked before requests are authenticated. The configuration template no longer setsmax_content_length: null(#798, #813) - On operations that require bearer tokens validated by FOCA, the token is checked before the body is read: anonymous requests with too large bodies get
401instead of413,before_requesthooks run after this check, and apps that mock Connexion's security handler instead offoca.security.auth.validate_tokenmust replacevalidate_tokentoo (#814, #817) nullin patches of specifications removes keys (JSON Merge Patch, RFC 7396) instead of setting values tonull; files ofpathkeepnullvalues unlessmerge_null_removes: trueis set (#762, #763)- The permissions API (
/permissions) rejects invalid rules, identifiers and pages as invalid fields (problem typeinvalid-request, witherrorsand stable codes); its controllers raisefoca.errors.InvalidFieldsProbleminstead ofBadRequest(#760, #765) - The plugin store limits each namespace to
max_namespace_sizebytes (by default 16 MiB) and raisesfoca.plugins.StoreFullErrorbeyond it; store backends of their own must accept the new keyword argumentmax_sizeofset()andincrement(); with a database, sizes are kept in the new collectionplugin_store_sizes(#552, #774) - Plugins of WES gateways get runs (
POST /runs) in one shape, checked after each hook against the new limitsplugins.attachments(by default 256 files and 32 MiB per run); apps that pass payloads of another shape build them withfoca.plugins.wes.parse_run_request()(#781, #782) - A client's backend choice
{"type": "allow", ...}of identifiers only, none of which names a backend of the gateway, is refused with400(invalid-backends) byrun.route(); apps that route only some of their backends pass the others asknown(#808, #809) - A
$in apatternof a request body or parameter matches only at the end of the value, as in ECMA 262, so values with a trailing newline are refused with400(pattern-mismatch) (#797, #810)
Features
- Backend lists take WES instances (
type: ga4gh-wes, APIwes),ServiceEntryhas an optionalapi_path, andBackendList(entries, api=...)refuses entries of another API's type (#789, #791) - FOCA resolves the credentials of backends for TES and WES gateways:
ClientCredentialsConfig,TokenProvider(client credentials grant, cached per process),get_credentials(),check_backends(), and an optionalaudienceofServiceEntry(#794, #796) GuardedClienttakes aca_bundle(a file or directory of certificate authorities trusted instead of the public ones); TLS verification can't be turned off (#790, #792)fetch_json()takes aca_bundle, and registry entries of backend lists aregistry_ca_bundle, so that registries behind a private certificate authority can be read (#793, #795)foca.plugins.weswithparse_run_request(),check_run_request()andrun_request_form(), andhost.start()reads the tags of WES runs from the payload (#781, #782)merge_null_removesof specifications lets merged files ofpathremove keys withnull(#762, #763)foca.utils.paginationpages lists with page tokens (keyset pagination):get_page_size(),PageKeyandfind_page(), with invalid sizes and tokens as invalid fields (#799, #828)
Security
- Anonymous clients can no longer make apps parse request bodies of any size: bodies are limited by default and checked before authentication, and bearer tokens validated by FOCA are checked before bodies are read (#798, #813; #814, #817)
- Patterns ending in
$no longer accept a trailing newline, which let values past request validation that controllers then failed on (#797, #810) - The semgrep rules shared with the apps find disabled TLS checks in calls on any object (e.g.,
session.get(url, verify=False)) and more ways of decoding JWTs without verification or with algorithms from the token's header (#783, #784)
Fixes
- Choices of unknown backends are refused with
400instead of ending without a backend, which apps answered as an outage (#808, #809) - Page tokens that aren't strings (e.g., from JSON bodies) are refused with
400instead of failing with500, and page keys refuse fields that aren't a tuple of strings (#830, #829)
Documentation
- The migration guide covers every change that apps, deployments and clients may have to act on (#631, #773; #798, #813; #814, #817)
- Requests to backends discovered in registries go through
GuardedClient, which checks the address of each connection, notBackendSession, which is for the identity provider and configured backends (#824, #825) - The migration guide also names the stricter checks of backend lists (entries of another API's type,
audiencewithoutauth: client_credentials) and the limit of bare subjects containing|, and the API reference listsInvalidRuleError(#822, #823) - The docs of page tokens say when
find_page()raises, how items without sort fields are sorted, why to sort by values that the app sets, and how to accept empty tokens of generated clients (#830, #829) - The migration guide says that the endpoints for managing roles and the permissions API still accept bare users, which then apply to nobody (#822, #823)
- The examples no longer import Flask (#753, #764)
- The release commands of the contributing guide run in a worktree at the release commit (#756, #757)
Maintenance
- The release workflow checks that the tag is signed and that the version is not on PyPI or Docker Hub yet, and never moves image tags (#818, #819)
- The package and the library chart get separate generated release notes (#758, #759)
- CI cancels pull request runs only for new commits, and Dependabot labels all its pull requests (#761; #775, #776)
- The deadline tests of the HTTP client are deterministic (#815, #816)
- Release preparation for 0.23.0: citation metadata and release notes (#822, #823)
- Dependency updates (#766, #767, #768, #769, #770, #771, #777, #778, #800, #801, #802, #803, #804, #805, #806)
Commits
- docs: run release commands in a worktree by @uniqueg in #757
- ci: separate package and chart release notes by @uniqueg in #759
- ci: cancel PR runs only for new commits by @uniqueg in #761
- feat(spec): let null remove keys in spec patches by @uniqueg in #763
- docs: move the examples off Flask imports by @uniqueg in #764
- feat: report invalid fields in the permissions API by @uniqueg in #765
- feat(plugins): limit store namespace size by @uniqueg in #774
- ci: let Dependabot label all its pull requests by @uniqueg in #776
- feat(auth)!: always namespace subjects by issuer by @uniqueg in #773
- build(deps): Bump the github-actions group across 3 directories with 7 updates by @dependabot[bot] in #769
- feat(plugins): define the WES run request by @uniqueg in #782
- fix: catch disabled TLS checks in session calls by @uniqueg in #784
- build(deps): Bump the python-dependencies group across 1 directory with 7 updates by @dependabot[bot] in #770
- build(deps): Bump the ruff group across 2 directories with 1 update by @dependabot[bot] in #767
- build(deps): Bump the semgrep group across 2 directori...
v0.22.0
FOCA 0.22.0 prepares apps for FOCA's ASGI release, which moves to Connexion 3 AsyncApp and removes Flask and Flask-Cors. Nothing is removed in 0.22.0: FOCA warns about what the ASGI release removes where it can, and adds replacements that already work on Connexion 2: request and claims accessors (foca.context), framework-neutral errors (foca.errors), a test client (foca.testing) and an ast-grep rule that finds Flask imports. The functions that take a Flask app (get_app_config(), set_app_config(), enable_cors() and foca.factories.celery_app.create_celery_app()) emit a DeprecationWarning, and FOCA logs each deprecation once per process; exception maps with raw Werkzeug classes are logged as deprecated and stop working with the ASGI release. Some defaults change, which clients, tests and log checks may notice: the detail of responses to invalid requests and the INFO logs no longer quote values of clients, and routes that are not operations of the specifications are treated differently (see Breaking changes). Move your app now: see Preparing for the ASGI release and the migration guide. When work on the ASGI release starts, a 0.22.x branch is cut from the latest 0.22 release, for dependency and security fixes while apps migrate.
Breaking changes
- Deprecated, removed in the ASGI release:
get_app_config(),set_app_config(),enable_cors()andfoca.factories.celery_app.create_celery_app()emit aDeprecationWarningand are logged once per process; usefoca.get_config()(in scripts, withFoca.use_config()), thesecurity.corsconfiguration andFoca.create_celery_app()instead (#637, #731, #741, #742) - Also deprecated, removed in the ASGI release: reading, setting and deleting
app.config.foca(#716, #721),www_authenticateoffoca.errors.Unauthorized, whose challenges are now inheaders(#710, #714), exception maps with raw Werkzeug classes instead of those offoca.errors(#633, #709), andx-body-name: permissionin specifications that route operations to the controllers of the permissions API (#717, #722) - FOCA finds routes in its own route table of the operations of the specifications instead of Flask's
url_map; for routes that aren't operations (e.g., the Swagger UI,openapi.json, routes added to Flask directly),is_permitted_for()is nowFalse,me_pathis no longer checked, and ownership controllers refuse requests; the log fieldoperation_idis the specification'soperationId, or the one Connexion resolves if the specification has none (see Routes that aren't operations) (#632, #707; #718, #726) - By default, the
detailof responses to requests rejected by request validation names the invalid fields by location and code (e.g.,Invalid fields: #/name (too-long)), or, if none are listed, is the mappeddetailorThe request is invalid., instead of the validator's reason; this also replaces thedetailofBadRequestProblem(RequestValidationProblem) that apps raise, so raisefoca.errors.InvalidFieldsProblemto name the invalid fields of checks of your own. Clients and tests that checkdetailshould checkerrorsinstead, or setexceptions.validation_reasons: trueto keep the reasons (see Validation reasons without request values) (#732, #733, #736, #738) - Logs at
INFO: request logs (log_traffic) and denials of access control name the route (the path template of the operation, e.g.,GET /ga4gh/tes/v1/tasks/{id}, or<unknown route>) instead of the path, and requests rejected by request validation without invalid fields are logged with the mappeddetailor the title instead of the validator's reason; paths and reasons are logged atDEBUG, so log atDEBUG(e.g., for the loggerfoca) to keep them (see Validation reasons without request values) (#748, #750)
Features
- Request and claims accessors that keep their meaning on ASGI:
foca.context.current_request(), a read-only snapshot of the request, andcurrent_token_info()andcurrent_claims()offoca.security.auth; FOCA itself reads the request only through them (#634, #715, #720; #717, #722; #718, #726) foca.errors: framework-neutral error classes and stable names of Connexion's problems, which FOCA raises everywhere; challenges ofUnauthorizedgo in itsheaders(#633, #709; #710, #714)foca.api.routes, a route table of the operations of the registered specifications, withget_routes()andmatch()(#632, #707)foca.testing.Client, a test client with the API of httpx and Starlette'sTestClient,foca.testing.request_context()for unit tests of code that reads the accessors, and the pytest fixturesfoca_appandfoca_client(#635, #729)- FOCA logs each of its deprecations once per process at
WARNING, on the loggerfoca.deprecation, so that they show under Gunicorn, where Python hidesDeprecationWarning; apps can usefoca.deprecation.warn_deprecated()(#727, #728) - The ast-grep rule
flask-importin FOCA's repository finds the imports of Flask, Werkzeug and Connexion's Flask modules that apps still have to move before the ASGI release, and names the replacements (#636, #730) - Responses to invalid requests list the invalid fields (up to 100), of the body and the parameters together, in the new member
errorsof their problem details, with the problem type Invalid request;titleandstatusstay as before, anddetailchanges as described under Breaking changes. Raisefoca.errors.InvalidFieldsProblemto list the invalid fields of checks of your own the same way (#586, #711, #712, #734) Foca.use_config()lets scripts use a configuration and its collections (get_config(),get_collection()) without creating an app, without Flask and without writing to the database; it replacesset_app_config()for scripts (see Preparing for the ASGI release) (#741, #742)
Security
- Responses to invalid requests no longer quote the rejected values (and, for parameters, the schema) in
detail, which now names the invalid fields by location and code, e.g.,Invalid fields: #/name (too-long); they stay listed inerrors. Set the new optionexceptions.validation_reasons: trueto keep the validator's reasons, e.g., if clients depend on them. Names that clients choose are still named indetail: those of unknown query and form parameters and unknown keys of the body (#732, #733, #736, #738) - The plugin gateway's refusals of per-request pipelines and backends no longer quote the client's values; they name fields, settings and the positions of steps, e.g.,
Plugin not available in step 1(see Plugin gateway messages) (#739, #740) - Error messages and logs quote fewer client values:
GET /plugins/{plugin_id}names the parameter instead of the identifier, errors of the JSON parser on clients' pipelines get a fixed message unlessexceptions.validation_reasonsis on, an invalid user acted for in theauth.on_behalf_of_headeris listed as an invalid field of the header, so that clients learn what to fix, and rejected users acted for, invalid identifiers and values of policy rules and the roles and subjects of refused role grants are no longer logged atINFOor above (#743, #745) - Request logs, denials of access control and rejections by request validation no longer log values of clients at
INFO: request logs and denials name the route (the path template of the operation, e.g.,GET /ga4gh/tes/v1/tasks/{id}) instead of the path, and rejections without invalid fields the title or mappeddetailinstead of the validator's reason; paths and reasons are logged atDEBUG; theINFOrecordRequest rejectedstill names unknown parameters and body keys, whose names clients choose (see Migrating to 0.22.0) (#748, #750) - Errors for malformed MongoDB connection strings have a fixed message instead of PyMongo's, which could quote parts of the password (#701, #703)
- The FOCA images install the Debian updates available when they are built, instead of upgrading single packages, and so get the fixes Debian has released, e.g., for zlib1g (CVE-2026-76844, CVE-2026-85091, CVE-2026-27171), which their base images still lack; images built on FOCA's image get the fixes, too (#747, #749)
Fixes
- Apps are released when they are no longer used, also while objects of their APIs live on, e.g., in log records that a handler keeps; before, such objects kept the Flask app alive, which mattered for processes that build many apps, such as test suites (#735, #737)
- The database configurations and MongoDB clients of apps with background jobs are released with their apps; before, Celery's worker signals kept them alive, which mattered for processes that create many apps, such as test suites or scripts (#744, #746)
foca check-config,sync-policiesandexport-specno longer set up the plugin store of gateway apps without adbsection (#705, #706)- Query strings that aren't UTF-8 no longer fail pagination links or the check for unexpected query parameters; such bytes stay percent-encoded (#717, #722; #718, #726)
- Users acted for that can't be stored in policy rules (e.g., with a comma) are rejected as invalid fields of the
auth.on_behalf_of_headerwith400 Bad Requestinstead of failing with `500 Inter...
v0.21.0
FOCA 0.21.0 lets configuration files reference environment variables and takes credentials from files, gives every request an identifier in logs and responses, adds the foca command-line tool, an audit log of changes of access rights and helpers for testing apps, and makes Celery workers safe with MongoDB. Configurations, requests and responses are checked more strictly, so apps may need to change: see the migration guide. Discovery reads serviceId of Cloud Registry 1.0.0rc2. Apps with plugins of foca-plugins can't install this release until foca-plugins allows it.
Breaking changes
- Configuration files:
${...}now references an environment variable, an unset variable or an invalid form stops the app, and$$means a literal$; write$$for each literal$in these two cases (#625, #691) jobs.backendis now aSecretStr, as are thedb.client_optionsauthMechanismPropertiesandtlsCertificateKeyFilePassword, so code reading them must call.get_secret_value()(#625, #691)- Celery workers replace the MongoDB client before starting their pool and in each pool process, so clients, databases and collections kept from earlier raise
InvalidOperation(#659, #663) - Index conflicts and documents violating a unique index raise
IndexConflictError, aValueError; otherOperationFailures when creating indexes stay what they are (#622, #688) Foca.create_celery_app()stops on invalid access control settings, so such a worker doesn't start (#622, #688)- A
logsection naming filters or handlers that it doesn't configure stops the app, instead of falling back to the default logging (#620, #684) - Requests can now fail with
400for values that don't fit the formatsdate-time,dateoruri, for unpaired surrogates in JSON and, withstrict_validation, for query parameters of operations without parameters; withvalidate_responses, the same format checks answer500, also for stored data (#617, #686) is_admin()isFalsefor models with global and resource-scoped roles whose matcher doesn't start with exactlyg(r.sub, "admin") ||(#613, #682)- Gateway plugins:
request_id()followsserver.request_idinstead of taking any client'sX-Request-ID, so that by default the fieldrequest_idof pipeline runs and their records has a generated identifier (#620, #684; #695, #696) - MongoDB clients time out after 5 seconds when selecting a server and connecting, down from PyMongo's 30 and 20 seconds (#618, #675)
docker/Dockerfile: the build argumentPY_IMAGEonly takes3.11to3.15with-slim-trixie; images built on the published FOCA images aren't affected (#629, #685)
Features
- Configuration files reference environment variables with
${VAR},${VAR:-default}and${VAR:?message}, and FOCA's variables with credentials can come from files, with<name>_FILE(#625, #691) - Responses have the header
X-Request-ID, log records have the request's identifier, operation, subject and client, the formatterjsonwrites one JSON object per line, andlogtakes filters, loggers and more options (#620, #684) - The console script
foca, withcheck-config,create-indexes,sync-policiesandexport-spec, and the switchesdb.create_indexes_on_startupandsecurity.access_control.sync_policies_on_startup(#621, #690) - Changes of access rights go to the logger
foca.audit, with who made them; the permissions API no longer logsPolicy rule '...' added.,updated.ordeleted.on its own logger (#614, #689) foca.testing: a local OIDC issuer and a pytest plugin with a network guard and amongodbfixture, with the extrafoca[testing](#630, #679)GET /me, off by default, with a hook for fields of the app (#610, #687)- Access control:
api_enabledandapi_base_pathof the permissions API (#611, #678);required_roles,require_enforced, packaged models withmodel: foca:<file>andresource_roles_cover_custom_methods(#613, #682);is_permitted_for(),get_api_base_path(),get_resource_path()and{base_path}in policies (#606, #667) getResourceRolesofownership_servertakesq,limitandoffset(#609, #681)foca.utils.pagination,IdConfigfor identifiers andservice_info.locked_fields(#623, #676)db.client_optionsfor MongoDB clients, which also report a name to MongoDB (appname) (#618, #675)security.auth.userinfo_cache_ttl, for changes of groups read from user info to apply sooner (#615, #669)jobs.periodicfor the schedules of Celery beat, and hints for configuration keys removed in 0.14 (#622, #688)foca.gunicorn_configbinds to the port inPORT, by default 8080 (#619, #662)- Startup warnings for a service info with the placeholder version
0.0.0.dev0and for gateways without loop detection (#624, #664) - The release has
foca-image-requirements-py<version>.txtas assets, to install the same versions in images built on the FOCA image (#629, #685) - foca-common 0.5.0:
extraEnv,extraEnvFromandrolloutOnSecrets(#626, #672); autoscaling and topology spread constraints (#627, #677); gateway apps withplugins,backendsKeyandrequireAccessControl, and Flower (#628, #692)
Security
- By default, apps generate the request's identifier and ignore what clients send;
server.request_id.trust_incomingis for apps behind a proxy that replaces or rejects clients' values, as clients could otherwise choose the identifier in logs and audit events (#695, #696) security.auth.reject_invalid_tokens, off by default, answers401for invalid tokens on operations with optional authentication, and startup warns of functions it doesn't reach (#607, #668; #693, #694)- The repr of database and collection settings no longer shows the credentials of clients, and the log of new MongoDB clients has only hosts and ports as PyMongo understands them, as well as the database (#625, #691)
- The log no longer has the start of a password containing
#(#674, #675) - Logs of invalid responses no longer have the response body: Connexion's message is filtered out, and the logger
foca.errors.exceptionslogs the operation and the error (#616, #671) - The FOCA image installs its dependencies with their hashes and pins its base images by digest (#629, #685)
- The FOCA image upgrades apt for CVE-2026-109518, which its base images don't have the fix of yet (#697, #698)
Fixes
- MongoDB clients are no longer used across forks in Celery workers (#659, #663)
- Discovery reads
serviceId, which Cloud Registry 1.0.0rc2 has instead ofservice_idinGET /verifications, so that apps such as proTES no longer end up without backends;groupandartifactignore surrounding whitespace (#665, #670) - Revocations in
GET /verificationsapply to cached backends even ifGET /servicesfails (#673, #683) - Older pods no longer overwrite the configured rules of newer ones during rolling upgrades, with
policies_revisionandpolicies_force(#612, #680) - Admins can list the roles of resources without owners and assign their first owner, if the operation of
ownership_serveris passed an existence check (#608, #666)
Documentation
- The migration guide covers all changes of behaviour, and the docs explain
PORTand the limits of thefocacommand (#693, #694) - Links to the docs of Casbin, and a contributing note on upgrading system packages of the image (#697, #698; #699, #700)
NOTICEhas an entry for the Casbin adapter (#655, #657)
Maintenance
- A real gateway plugin runs in the live service tests (#656, #658)
- An integration test of the request ID through Gunicorn, and one pinned version of uv in the jobs of CI (#693, #694)
- Dependency updates (#660, #661)
- Release preparation for 0.21.0: citation metadata and release notes (#699, #700)
Commits
- docs: add NOTICE entry for the Casbin adapter by @uniqueg in #657
- test: run a real gateway plugin in live services by @uniqueg in #658
- build(deps): Bump astral-sh/uv from 0.13.6 to 0.13.7 in /examples/petstore by @dependabot[bot] in #660
- feat: read PORT in foca.gunicorn_config by @uniqueg in #662
- fix: open MongoDB clients after the Celery fork by @uniqueg in #663
- feat: warn on dev version and loop detection by @uniqueg in #664
- fix: let admins manage ownerless resources by @uniqueg in #666
- fix(plugins): read serviceId in discovery by @uniqueg in #670
- feat: add public path helpers by @uniqueg in #667
- feat: add option to reject invalid optional tokens by @uniqueg in #668
- feat(auth): add userinfo_cache_ttl option by @uniqueg in #669
- fix(errors): log invalid responses without bodies by @uniqueg in #671
- feat: add id config and pagination helpers by @uniqueg in #676
- feat(chart): add HPA and topology spread by @uniqueg in #677
- feat(db): add MongoDB client options by @uniqueg in #675
- feat(access-control): add API switch, base path by @uniqueg in #678
- feat(testing): add pytest plugin and test issuer by @uniqueg in #679
- fix: apply revocations when services can't load by @uniqueg in #683
- fix(access-control): let newest policies win by @uniqueg in https://gi...
foca-common 0.5.0
foca-common 0.5.0 adds extra environment variables and rollouts on changed Secrets, autoscaling and topology spread constraints, and the settings of gateway apps, and follows FOCA 0.21.0's credentials from files.
Features
extraEnv,extraEnvFromandrolloutOnSecrets(#626, #672)- Autoscaling (HorizontalPodAutoscaler) and topology spread constraints (#627, #677)
- Gateway apps:
plugins,backendsKeyandrequireAccessControl, and Flower (#628, #692) - The check of variables that the chart sets also covers their
_FILEforms, as FOCA refuses both at once (#625, #691)
Documentation
Maintenance
Commits
- test: run a real gateway plugin in live services by @uniqueg in #658
- feat(chart): add extraEnv and rollout on secrets by @uniqueg in #672
- feat(chart): add HPA and topology spread by @uniqueg in #677
- feat(chart): add gateway helpers by @uniqueg in #692
- fix: don't trust incoming request IDs by default by @uniqueg in #696
- feat(config)!: support secrets in config by @uniqueg in #691
Full Changelog: chart-v0.4.0...chart-v0.5.0
v0.20.0
FOCA 0.20.0 removes pip from the FOCA image, so that image scans of apps built on it no longer report the copies of packages that pip vendors, and closes a way for clients to overwrite records of failed runs. Gateway apps can key the hashes of the plugin store with a secret, and the Helm library chart foca-common 0.4.0 runs apps with several replicas and tunable probes. Apps whose images install packages with pip install on top of the FOCA image need to change, as do apps that read failure records by their _id: see the migration guide. Token exchange is not part of this release.
Breaking changes
- The FOCA image no longer contains pip, which vendors copies of other packages that image scans report in every image built on FOCA;
pip installin aDockerfilebased on the image now fails, so install packages with uv from a pinned stage, without copying uv into the image, and remove the entries for pip's vendored packages from.trivyignore.yaml(#556, #592) - Gateway plugins: records of failed runs (
ProvenanceStore.save_failure(), only withplugins.provenance.record_failed: true) are keyed (_id) byrun-and the server-generated run ID rather than the client'sX-Request-ID, which stays in the fieldrequest_id; lookups by request ID need to query that field, and also_idwhile records of 0.19.0 exist (#575, #587)
Features
- Gateway plugins: the setting
plugins.defaults.store.key_secretor the environment variableFOCA_PLUGINS_STORE_KEY_SECRETkeys the hashes ofctx.store.key_for()(HMAC-SHA256), and apps that keep such data in the database without it log a warning at startup; setting, changing or removing the secret makes entries keyed withkey_for()unreachable (#565, #589) - foca-common 0.3.0: app replicas (
replicas) and a PodDisruptionBudget (podDisruptionBudget); app charts need a template file for the budget (#584, #585) - foca-common 0.4.0: the value
pluginStore.existingSecretpasses the plugin store's key secret from an existing Secret to the app and the worker, and rendering fails if the config overlay sets it (#565, #589; #644, #650) - foca-common 0.4.0: overrides of the app's probes (
startupProbe,readinessProbe,livenessProbe) (#603, #642)
Security
- Gateway plugins: clients can no longer overwrite records of failed runs, or collide with those of others, by reusing a request ID (#575, #587)
GuardedClient: bodies of redirects are limited tomax_response_sizewithout reading them first, andauthor session hooks that read responses without limit (e.g.,HTTPDigestAuth) are refused (#640, #643)- Validation errors of the configuration no longer show the invalid input, including the plugins'
configand stepparamsand the custom configuration, as it may contain secrets (#565, #589; #646, #653) - FOCA requires urllib3 2.8 (CVE-2026-97688, CVE-2026-97689, which defeat the deadline and size limit of
GuardedClientagainst hostile servers) and pymongo 4.18.3 (CVE-2026-106435) (#645, #653) - A warning at the first token validation names trusted issuers reached without TLS, except on the loopback interface (#647, #652)
Fixes
GuardedClientdecides by whether sending has started if an error isRequestNotSentorRequestMaybeSent, not by the kind of error, so some errors change: see the migration guide (#640, #643)GuardedClientreports a header that can't be encoded as Latin-1 asinvalid_header, not asinvalid_url(#647, #652)- foca-common:
requireAudienceaccepts configurations in which each issuer has anaudienceof its own, as FOCA does (#604, #641) - Access control logs the warning about group subjects at the right level, and the plugin listing has the right media type (#577, #639)
Documentation
- Shutdown of Celery workers (#605, #638)
- The contributing guide is the organization's, without an override (#578, #582)
- The deprecated name ELIXIR Cloud is gone (#579, #581)
- The README and the docs index point to the guide for 0.20.0; the guides and the deployment docs cover the upgrade of app charts, configured rules during a rollout and the plugin store's warnings (#644, #650; #648, #651)
Maintenance
- CI pushes images in the environment
dev-imagesand releases inrelease(#574, #576) - CI checks the titles of pull requests under the gate (#580, #583)
- Release jobs have aligned names, and the README's images have absolute URLs on PyPI (#572, #573, #588)
- Releases require a successful CI run of the release commit (#590, #591)
- Tests of
GuardedClientover real TLS; an origin note on the Casbin adapter (#647, #652) - Dependency updates (#595, #596, #597, #600, #601, #602)
- Release preparation for 0.20.0: citation metadata and release notes (#649, #654)
Commits
- ci: push images in dev-images and release by @uniqueg in #576
- docs: drop the deprecated ELIXIR Cloud name by @uniqueg in #581
- docs: stop overriding the org contributing guide by @uniqueg in #582
- ci: check PR titles under the gate by @uniqueg in #583
- fix(plugins): key failure records by run ID by @uniqueg in #587
- feat(chart): add app replicas and a PDB by @uniqueg in #585
- ci: align release jobs, absolute README images by @uniqueg in #588
- ci: release only commits whose CI passed by @uniqueg in #591
- feat(plugins): key store hashes with a secret by @uniqueg in #589
- build!: remove pip from the FOCA image by @uniqueg in #592
- build(deps): Bump astral-sh/setup-uv from 10.3.2 to 10.3.3 in the github-actions group across 1 directory by @dependabot[bot] in #595
- build(deps): Bump types-pyyaml from 6.0.12.20260906 to 6.0.12.20261030 by @dependabot[bot] in #597
- build(deps): Bump types-requests from 2.33.0.20261006 to 2.33.0.20261030 in /requirements by @dependabot[bot] in #600
- build(deps): Bump types-requests from 2.33.0.20261006 to 2.33.0.20261030 by @dependabot[bot] in #598
- build(deps): Bump the python-dependencies group across 2 directories with 1 update by @dependabot[bot] in #596
- build(deps): Bump semgrep from 1.182.1 to 1.183.0 in the semgrep group across 1 directory by @dependabot[bot] in #601
- build(deps): Bump ruff from 0.17.2 to 0.17.3 in the ruff group across 1 directory by @dependabot[bot] in #602
- docs: describe Celery worker shutdown by @uniqueg in #638
- fix: group-subject warning, listing media type by @uniqueg in #639
- fix(chart): honour per-issuer audiences by @uniqueg in #641
- fix: bound redirect bodies, tell sent from unsent by @uniqueg in #643
- fix(chart): rename plugins.existingSecret by @uniqueg in #650
- docs: point upgraders to the 0.20.0 guide by @uniqueg in #651
- fix: small pre-release findings of 0.20.0 by @uniqueg in #652
- fix: hide plugin input, raise dependency floors by @uniqueg in #653
- build: prepare the 0.20.0 release by @uniqueg in #654
Full Changelog: v0.19.0...v0.20.0
foca-common 0.4.0
foca-common 0.4.0 passes the key secret of the gateway plugins' store from an existing Secret, allows overrides of the app's probes, and accepts per-issuer audiences, as FOCA 0.20.0 does.
Features
- The value
pluginStore.existingSecretpasses the plugin store's key secret from an existing Secret to the app and the worker, and rendering fails if the config overlay sets it (#565, #589; #644, #650) - Overrides of the app's probes (
startupProbe,readinessProbe,livenessProbe) (#603, #642)
Fixes
requireAudienceaccepts configurations in which each issuer has anaudienceof its own, as FOCA does (#604, #641)
Maintenance
- Releases require a successful CI run of the release commit (#590, #591)
- Release preparation, together with FOCA 0.20.0 (#649, #654)
Commits
- ci: release only commits whose CI passed by @uniqueg in #591
- feat(plugins): key store hashes with a secret by @uniqueg in #589
- fix(chart): honour per-issuer audiences by @uniqueg in #641
- feat(chart): allow app probe overrides by @uniqueg in #642
- fix(chart): rename plugins.existingSecret by @uniqueg in #650
- build: prepare the 0.20.0 release by @uniqueg in #654
Full Changelog: chart-v0.3.0...chart-v0.4.0
foca-common 0.3.0
foca-common 0.3.0 runs apps with several replicas and a PodDisruptionBudget, and uses a keep-alive longer than the idle timeouts of common proxies. App charts need a template file for the budget.
Features
- App replicas (
replicas) and a PodDisruptionBudget (podDisruptionBudget); app charts need a template file for the budget (#584, #585)
Fixes
- The petstore chart and the docs use a keep-alive of 100 s, longer than the idle timeouts of common proxies (#469, #478)
Documentation
- The Gunicorn settings of the chart take precedence over FOCA's default settings in the image (#458, #463)
- The chart version in the docs is taken from
Chart.yaml(#472, #481)
Maintenance
- CI workflow and job names are aligned with the other repositories (#480, #482)
- Releases of the chart need approval, in the protected environment
release(#449, #520; #563, #571) - Dependency updates (#484, #555)
Commits
- feat(config): add default Gunicorn settings by @uniqueg in #463
- fix(chart): use a keep-alive of 100 s by @uniqueg in #478
- docs: take the chart version from Chart.yaml by @uniqueg in #481
- ci: align workflow and job names by @uniqueg in #482
- build(deps): Bump the github-actions group across 3 directories with 4 updates by @dependabot[bot] in #484
- ci: approve library chart releases by @uniqueg in #520
- build(deps): Bump the github-actions group across 1 directory with 2 updates by @dependabot[bot] in #555
- ci: publish in the environment release by @uniqueg in #571
- feat(chart): add app replicas and a PDB by @uniqueg in #585
Full Changelog: chart-v0.2.0...chart-v0.3.0
v0.19.0
FOCA 0.19.0 gives gateway plugins a shared key-value store (ctx.store), e.g., for caches and per-user budgets of third-party APIs, kept in the app's MongoDB database for all processes and replicas, and shows what each plugin stores in the plugin listing. There is no migration guide, as nothing breaks, but operators of gateway apps should read the first two Features bullets before upgrading: gateways with a database create a collection and indexes at startup, and the plugin listing has new required fields.
Features
- Gateway plugins: a key-value store for plugins (
ctx.store:get,set,delete, atomicincrementwith limits, andkey_forto pseudonymize keys), with a namespace per plugin distribution and a TTL on every entry; new settingsplugins.defaults.storeandplugins.available.<id>.store(enabled,max_entry_size,max_ttl, by default 30 days). Withdb.dbs, gateway apps keep the entries in the collectionplugin_storeof the app's first database (not in the policy database that access control adds for apps without one) and create its indexes there at startup (a TTL index onexpires_at, one onns), so the database user needs the right to create indexes; if that fails, the app starts anyway with a warning (an error, with the cause, for conflicting indexes, failed authentication or missing rights), and writes to the store fail until the indexes exist. Each start also tries to cut the expiry of existing entries to the currentmax_ttl; if that fails (logged), they keep their expiry until a later start succeeds. Without database, each process keeps its entries in memory, without size limit (configure a shortmax_ttl), and the app warns at startup if plugins keep stored data there. Plugins that usectx.storerequirefoca>=0.19(#550, #557, #564, #568) - Gateway plugins: plugins declare what they keep in their store (
data_stored), and the plugin listing (GET /plugins,GET /plugins/{plugin_id}) shows it with the mode of the plugin's store (storage:shared,localoroff); both fields are new and required (the listing's specification is now version 1.1.0), so clients that validate listings need to know them, and plugins that declaredata_storedrequirefoca>=0.19(#551, #560, #564, #568)
Documentation
Maintenance
- The community files (code of conduct, contributing guidelines, security policy) are the organization's; the README and the docs link to them (#542, #544)
- CI passes in forks, without the upstream secrets (#546, #547), uses the organization's shared
scan-imageandgateactions (#548, #549, #553), pinned to their release v1.0.0 (#558, #559), and also scans the released Python 3.15 image (#540, #541) - Releases publish the package to PyPI and release the Helm library chart in one protected environment,
release(formerlypypiandchart-release) (#563, #571) - Curated release notes (
docs/releases/) are added to GitHub's generated notes of each release (#539, #543) - The image scan ignores an advisory of the setuptools that pip vendors, which the app doesn't use (#561, #562)
- Dependency updates (#554, #555)
- Release preparation for 0.19.0: citation metadata and release notes (#569, #570)
Commits
- ci: scan the released Python 3.15 image by @uniqueg in #541
- ci: prepend custom notes to generated notes by @uniqueg in #543
- docs: use the org-wide community files by @uniqueg in #544
- ci: make CI pass in forks by @uniqueg in #547
- ci: use the shared scan-image and gate actions by @uniqueg in #553
- build(deps): Bump the github-actions group across 1 directory with 2 updates by @dependabot[bot] in #555
- build(deps): Bump the ruff group across 2 directories with 1 update by @dependabot[bot] in #554
- feat(plugins): add plugin key-value store by @uniqueg in #557
- ci: pin the shared actions to v1.0.0 by @uniqueg in #559
- feat(plugins): list plugin storage by @uniqueg in #560
- build: accept setuptools advisory vendored by pip by @uniqueg in #562
- docs: replace the README logo by @uniqueg in #567
- fix(plugins): fix plugin store review findings by @uniqueg in #568
- ci: publish in the environment release by @uniqueg in #571
- build: prepare the 0.19.0 release by @uniqueg in #570
Full Changelog: v0.18.0...v0.19.0
v0.18.0
FOCA 0.18.0 adds a plugin engine for gateway apps such as proTES (plugins installed and pinned by operators, per-request pipelines, failover routing, provenance and a plugin test kit), an HTTP client for untrusted URLs guarded against SSRF, opt-in roles (e.g., for an admin mode), settings per trusted issuer and Python 3.15 support, and keeps one cached Casbin enforcer per app instance, so that requests cost about the same with many policy rules as with few. It contains breaking changes: please read Migrating to 0.18.0 before upgrading.
Breaking changes
- Access control: each app instance keeps one shared, cached Casbin enforcer, kept up to date via a record of changes (
<collection_name>_changes); rules changed in the database directly (e.g., withmongosh) no longer apply from the next request, but only aftermark_changed()or a restart; enforcer methods that FOCA's adapter can't store (update_policy(),remove_policies()) raiseNotImplementedError; during a rolling update from 0.17, upgrade all instances before changing rules (#450, #454). - Access control:
get_enforcer()is removed; use the context managerlocked_enforcer()(#468, #477). - Access control and errors: apps refuse to start if
group_mappingmaps groups but no group claim is set, or ifclaim_groupshas surrounding whitespace;exceptions.validation_detailsnow defaults totrue, so responses to invalid requests carry the validation reason asdetail(#467, #475). - Auth: with several trusted issuers, subjects are namespaced by issuer (
<namespace>|<subject>, by default the issuer URL), also in policies, resource roles, owners and on-behalf-of users; rules and grants stored for bare subjects no longer apply unless the issuer'snamespaceis set to""(#509, #512). - Auth: trusted issuers can be listed with settings of their own (
namespace,audience,claim_groups,userinfo_claims), which replace the global settings for their tokens;security.auth.issuersis typedSequence[str | IssuerConfig](useissuer_urlsfor the URLs) (#503, #510, #514). - Configuration: the top-level
pluginssection is now validated as FOCA's gateway plugin configuration, with unknown keys refused, also in apps that are no gateways; gateway apps refuse the keys of earlier middleware stacks (middlewares,custom.middlewares) (#486, #496).
Features
- Gateway plugins: a framework-free plugin engine (
foca.plugins) for gateway apps, declared withFoca(gateway=GatewayApp(...)): plugins from the entry point groupfoca.plugins, allowlisted and pinned inplugins.available, run in the phasesrequest,route,forwardandresponse, in steps with fallback alternatives, timeouts andon_failure(#486, #496). - Gateway plugins: clients choose presets, own pipelines (off by default) and backends per request in the reserved tags
gateway.pipelineandgateway.backends, within limits, roles and an admin frame (prepend,append); experimental (#487, #498). - Gateway plugins: provenance records of each run, with hashes of each plugin's changes and no secrets; optional records of failed runs with a TTL (#488, #499).
- Gateway plugins: typed backend lists for gateway apps (#493, #501), a default failover router
foca.routing.ordered(#491, #504), gateway tags that record the pipeline, plugins and backend of each task or run (#494, #505), a plugin listing API for clients (GET /plugins,GET /plugins/{plugin_id}) (#489, #506) and a plugin test kit (foca.plugins.testing) with contract checks and fakes (#492, #507). - Utilities:
GuardedClient(foca.utils.http) sends requests to untrusted URLs with SSRF guards (public addresses only, also after DNS resolution and on connect; redirects not followed; time and size limits); new dependenciesurllib3>=2.6,<3andpackaging>=23(#490, #500). - Access control: opt-in roles (
opt_in_roles, headeropt_in_header, defaultX-Request-Roles) that apply only to requests that ask for them, e.g., for an admin mode, withget_available_opt_in_roles()andget_active_opt_in_roles()(#502, #508). - Access control: ownership by document field (
set_owner_field(),owner_filter()) for resources that are never shared (#455, #456). - Configuration: startup checks that warn about settings that likely don't work as intended (e.g., no admins; placeholder service info), and
security.access_control.require_admin(#459, #466). - Configuration: public URLs behind proxies (
server.public_url,get_public_url()) and the typed custom configuration (get_custom_config()) (#460, #465). - Errors: request-specific details of validation errors (
exceptions.validation_details) (#461, #464). - Deployment: default Gunicorn settings for apps in containers (
foca.gunicorn_config) (#458, #463). - Python 3.15 is supported, with images tagged
-py3.15; the unsuffixed tags stay on Python 3.13 (#448, #457).
Security
- Gateway plugins: client pipelines are off by default and only accepted from authenticated callers, and the app warns on startup about policy steps of the default pipeline that client pipelines could skip (#518, #526).
- Gateway plugins: the caller (
Principal) passed to plugins is identified as by access control: on-behalf-of users, the roles of service clients and role rules (#519, #527). - The SSRF guard rejects IPv6 site-local addresses (
fec0::/10); the build context of the base image is an allowlist, so local files (e.g.,.env) can't end up in published images; the petstore-access-control example adds admins via the permissions API (#516, #522). - The
.dockerignorefiles of the examples are allowlists, so that local files stay out of example images (#511, #513).
Fixes
- Gateway plugins: the plugin listing API works in apps that set a controller for all operations (
add_operation_fieldswithx-openapi-router-controller) (#515, #521). - Gateway plugins: gateway settings are bound to their app: a later
Foca(...)withoutgateway=(e.g., in a Celery worker module) no longer clears them (#517, #525). - Access control: opt-in roles need no group mapping to them, so that an app's base config can make a role opt-in before its deployments map groups to it; apps warn of opt-in roles that no group is mapped to on startup, and opt-in roles must not be resource roles or start with a subject prefix (#530, #533).
- Releases are published only after their assets are uploaded (#451, #452).
- The petstore chart and the docs use a keep-alive of 100 s, longer than the idle timeouts of common proxies (#469, #478).
Documentation
- Migration guide for 0.18, linked from the README and the docs index; the README lists gateway plugins and the guarded HTTP client (#523, #531, #534, #535).
- Gateway plugins: the client-facing tags
gateway.pipelineandgateway.backendsand the settingsclient_pipelinesandclient_backendsare marked as experimental, as they may change with federated backend selection (#528) (#529, #532). - The version is taken from one source (#453, #462), and the chart version in the docs from
Chart.yaml(#472, #481). - Zenodo DOI and badge (#412, #476); the docs badge uses Shields.io (#473, #474, #479).
Maintenance
- CI workflow and job names are aligned with the other repositories, with a single required gate
CI passed(#480, #482). - Releases of the library chart need approval (#449, #520).
- Sourcery skips rule-test fixtures (#470, #471).
- Dependency updates (#484, #497).
- Citation metadata for 0.18.0 (#524, #536).
- A flaky timing test of the registry backend cache is fixed (#537, #538).
Commits
- fix: publish releases after uploading assets by @uniqueg in #452
- perf(access-control): cache the policy enforcer by @uniqueg in #454
- feat(access-control): add field-based ownership by @uniqueg in #456
- build: support Python 3.15 by @uniqueg in #457
- docs: take the version from one source by @uniqueg in #462
- feat(config): add default Gunicorn settings by @uniqueg in #463
- feat(errors): serve validation error details by @uniqueg in #464
- feat: add public URLs and typed custom config by @uniqueg in #465
- feat: add startup checks of the config by @uniqueg in #466
- ci: let Sourcery skip rule-test fixtures by @uniqueg in #471
- docs: fix the docs badge URL by @uniqueg in #474
- docs: add the Zenodo DOI and badge by @uniqueg in #476
- feat!: tighten group checks and error details by @uniqueg in #475
- refactor!: remove get_enforcer() by @uniqueg in #477
- fix(chart): use a keep-alive of 100 s by @uniqueg in #478
- docs: use Shields.io for the docs badge by @uniqueg in #479
- docs: take the chart version from Chart.yaml by @uniqueg in #481
- ci: align workflow and job names by @uniqueg in #482
- feat(plugins): add plugin engine by @uniqueg in #496
- feat(plugins): resolve per-request pipelines by @uniqueg in #498
- feat(plugins): record provenance by @uniqueg in #499
- feat...
v0.17.0
What's Changed
- docs: re-run failed releases, tags are protected by @uniqueg in #394
- ci: give Dependabot Docker Hub credentials by @uniqueg in #395
- feat(chart): Gateway API and ingress guides by @uniqueg in #404
- chore: add CODEOWNERS and .editorconfig by @uniqueg in #405
- docs: add code of conduct and contributing guide by @uniqueg in #406
- docs: add a security policy by @uniqueg in #410
- feat: patch specs and policies via config by @uniqueg in #409
- fix(access-control): replace roles atomically by @uniqueg in #413
- docs: add citation metadata by @uniqueg in #415
- ci: attest, sign and scan published images by @uniqueg in #414
- ci: add aggregate checks for tests and scans by @uniqueg in #421
- fix(access-control)!: replace policies atomically by @uniqueg in #423
- ci: add semgrep and ast-grep rules by @uniqueg in #416
- docs: address 0.17.0 pre-release review by @uniqueg in #424
- feat(chart): keep MongoDB data on uninstall by @uniqueg in #427
- docs: align the README with the other apps by @uniqueg in #429
- chore: use the service contact address by @uniqueg in #435
- fix(scripts): harden citation.py by @uniqueg in #431
- ci: sign and tag only the scanned image digest by @uniqueg in #432
- ci: upload only fixable scan findings by @uniqueg in #439
- fix(chart): drop ingress-nginx defaults by @uniqueg in #440
- fix(image): upgrade vulnerable Python packages by @uniqueg in #441
- docs: use generic identity provider examples by @uniqueg in #445
- fix: address 0.17.0 review findings by @uniqueg in #443
- chore: set citation metadata to 0.17.0 by @uniqueg in #447
Full Changelog: v0.16.0...v0.17.0