0.8.0
proTES can now authenticate at TES instances with an API key (auth:
api_key, e.g., for Poiesis), pass the identity of the submitter of each task
on to TES instances for accounting and audit, let service clients name the
user they run a task for, and, with accounting, count usage per such user,
all opt-in. The permissions API, through which admins could make
themselves owners of the tasks of others, is off by default, and config
overlays that name its removed admin rules or the old rule
users-create-list-tasks (now split in two) stop the start; tags that
clients set under submitter. are no longer relayed, and tasks that their
TES instance no longer has end with SYSTEM_ERROR. RabbitMQ now holds
scheduled polls until they are due (new queue protes), so polls that
back off no longer hold up those of other tasks; external brokers need
RabbitMQ 3.10 or later and more permissions. Read the upgrade
notes
before upgrading, also for the rules stored through the permissions API.
This release was tested against Funnel 0.12.3 (TES 1.1, by label and from
its service info), TESP-API 0.2.0 with Pulsar 0.14.16 (TES 1.0) and
tesk-api 1.1.0 with the taskmaster and filer v0.10.6 (TES 1.0) in CI;
tesk-api 2.0.0 (TES 1.1) and Poiesis were not tested (CI checks the API
keys against a stand-in TES instance only). See the
documentation for details.
Breaking changes¶
- Permissions API off: FOCA's permissions API
(
/admin/access-control/permissions) is off by default (security.access_control.api_enabled: false, its paths get404), and its rulesadmins-list-add-permissionsandadmins-manage-permissionsare removed; overlays that remove them (null) stop the start; an overlay can turn the API on again, and proTES then warns on startup (see the upgrade notes) (#515, #539) - The rule
users-create-list-tasksis split intousers-create-tasks(POST /tasks, roleuser) andauthenticated-list-tasks(GET /tasks, any authenticated caller, who sees only their own tasks); proTES refuses to start if an overlay names the old rule or removes it withnull: rename it (to stop task creation, setusers-create-tasks: null) (#519, #518) - Tags of clients under
submitter.are no longer relayed to TES instances (they are still stored with the task and returned to its owner), so that nobody can pass another identity off as the one proTES sends; clients that use this prefix for tags of their own must rename them (#254, #540) - Tasks that their TES instance no longer has (
404 Not Foundor410 Goneon every poll) are set toSYSTEM_ERRORwith a system log aftercustom.controllers.post_task.polling.max_gone_timeseconds (default 3600) and no longer tracked; before, they becameUNKNOWNand were polled forever (see the upgrade notes) (#544, #547) - Polls go to proTES' own queue
protes(a quorum queue on the topic exchangeprotes), and RabbitMQ holds scheduled polls in delay queues (quorum queuescelery_delayed_0tocelery_delayed_27, Celery's native delayed delivery) until they are due. The bundled RabbitMQ of the Helm chart and of Docker Compose needs no change; an external broker must be RabbitMQ 3.10 or later and give proTES' user the permissions listed in Task tracking. A worker that can't set up these queues, or can't reach the broker for about 2 minutes when it starts, exits instead of losing polls (or retrying forever). Workers still read the old queuecelery, so polls scheduled by earlier versions run during a rolling upgrade (a later release stops reading it, #556; see the upgrade notes, also for downgrades) (#549, #555)
Features¶
- API keys for TES instances: an entry of
custom.tes.backendswithauth: api_keysends proTES' key at that TES instance, from the environment variableapi_key.key_env(or the file named in<key_env>_FILE), asAuthorization: Bearer <key>or in another header (api_key.header), when creating, getting and canceling tasks there, also by the Celery worker, and for its service info only withcustom.tes.probe_with_token(as for tokens); the app and the worker refuse to start without a usable key, keys never appear in the config, the logs, the database or plugins, and redirects to other hosts drop them. Configured TES instances only (not those of a service registry); the TES instance sees all tasks of proTES as tasks of the key's account (see API keys of TES instances). The Helm chart takesapiKey.keyEnvandapiKey.headerintes.backends(#529, #530) - User identity at TES instances: TES instances can get the identity of the
submitter of each task as tags (
submitter.iss,submitter.sub,submitter.sub_source,submitter.client_id), for accounting and audit; opt-in per TES instance or registry withidentity_tags(Helm chart:identityTagsintes.backends); the subject is personal data, so check your privacy notice before switching it on (see User identity at TES instances) (#254, #540) - Service clients acting for users: service clients with
on_behalf_of: true(refused at startup until now) can name the user a task is for in the header thatcustom.controllers.post_task.on_behalf_of_headernames; the user is stored with the task (acting_for) and passed on assubmitter.subto TES instances withidentity_tags, and the client stays the owner (see Acting for users) (#254, #540) - Usage per named user: with accounting on (
custom.accounting.enabled), usage records hold the user that a service client ran a task for (acting_for, personal data likeuser_id, with a new index ofusageonacting_forandfinished_at), andGET /usage(admins only) takesacting_for=<sub>to count only that user's tasks andgroup_by=acting_forto split the totals per owner and named user; the default response and execution reports are unchanged (see the upgrade notes) (#541, #546)
Security¶
- Admins can no longer make themselves owners of the tasks of others (and read and cancel them) through the permissions API, which accepts any rule, as long as it stays off (the default); deployments that turn it on again keep that risk. Rules stored through it earlier stay in effect: the upgrade notes show how to find and delete them (#515, #539)
- Execution reports (
GET /usage/reports) leave out the query, fragment and user info of TES URLs, and name no TES instance for malformed URLs, as a safeguard for records that hold them (e.g., imported or edited by hand); proTES itself records URLs without them (#524, #537) - Errors about API keys of TES instances name the TES instance by its URL,
no longer the variable in
key_env, so a key pasted there by mistake doesn't show in startup or request errors (#533, #534)
Fixes¶
- Owners who lost the role
user(e.g., whose group membership was revoked) can list their own tasks again, as they could already read and cancel them (#519, #518) - When a TES instance reports a final state that the view
FULLcontradicts (e.g., a TESK that briefly answersSYSTEM_ERRORwhile the Job of a task is finishing), proTES polls the task again, up to 5 times, until both agree, instead of storing the first state without logs; stored tasks get the fieldstracking.disagreementsandtracking.disagreed_poll(see Task tracking) (#527, #536) - Once a task has finished,
start_timeandend_timeof its task logs are those that its TES instance reports, in UTC, no longer when proTES received and forwarded the task;creation_timestill says when proTES received it (see Tasks) (#528, #538) - With RabbitMQ 4, two tasks whose polls backed off (e.g., while their TES
instance was down) no longer stop the polls of all other tasks, including
new ones, for up to
polling.max_waitseconds: RabbitMQ holds scheduled polls until they are due (see Breaking changes), and for polls in the old queuecelerythe worker reserves 32 messages per process (worker_prefetch_multiplier, was 1; the Helm chart'sworker.commandpasses--prefetch-multiplier=32) (see Task tracking) (#543, #548, #550, #549, #555) - No Pydantic serialization warning at startup of the app and the worker
with a TES instance on
auth: api_key, and config dumps keep the settings of proTES' TES instances (#533, #534)
Documentation¶
- Notes on Poiesis as a TES instance of proTES (see Notes on TES implementations), and how to create and rotate the Secret with an API key in the chart's README; the rotation command works for any release name (#529, #530, #533, #534)
Maintenance¶
- The release workflow registers the released image at Pubgrade (job
Notify Pubgrade), which notifies the subscribed deployments, if the variablePUBGRADE_URLis set (see Pubgrade) (#535, #542)