Repository navigation
Description
Why?
proTES is the gateway in the M4.4 chain, and the M&Ds doc requires OAuth2-based access control "at least to the gateway". It is also the single entry point to the TES network for Conquest (elixir-cloud-aai/generic-issues#28), and it discovers backends dynamically from the Cloud Registry (#202, done in elixir-cloud-aai/TESK#260).
State when this issue was opened (for reference):
pro_tes/config.yamlwired FOCA bearer validation, but haddisable_auth: Truefor the TES API.- Incoming credentials were handled as HTTP Basic (
parse_basic_auth()inpro_tes/ga4gh/tes/task_runs.py), passed through to the downstream TES instances, and persisted in the task document in MongoDB (db_document.basic_auth). - The middleware management API (
api/middleware_management.yaml) had no security. - The default
tes.service_listinconfig.yamlwas outdated compared with the current network.
Current state on dev (2026-10-23, 54f8611):
- The TES API requires bearer tokens (
disable_auth: False; docs: note where charts from 0.3.0 on are published TESK#240): RFC 9068 access tokens only (verify_token_type: True), trusted issuers, audience and optional client allowlist (security.auth.issuers,audience,clients), groups from userinfo (userinfo_claims), on FOCA 0.17 (build!: require FOCA 0.17 and Python 3.13 #245).GET /service-info, the spec and the Swagger UI are public. The app refuses to start without trusted issuers, without an audience (unlessverify_audience: false) and without a group mapped toadmin(pro_tes/security.py,docs/access-control.md). - Users own their tasks (feat(access-control)!: own tasks per user #250): the owner is the token's
sub;GET /taskslists only the caller's tasks, andGET /tasks/{id}and:cancelare allowed for the owner only (also not for admins; maintainer decision). Task identifiers are unique, so that no owner role is inherited (fix(db)!: make task identifiers unique #258). - No Basic parsing, no stored credentials (feat!: call TES backends with service tokens #251): proTES calls the backends with credentials of its own, set per backend (
auth: client_credentials(default) |basic|none), never with those of its callers.basic(transitional) reads the credentials from environment variables. On startup,remove_stored_credentials()(pro_tes/utils/db.py) removesbasic_authfrom tasks stored by earlier versions. Credentials in input/output URLs are rejected (or stripped,url_credentials). - No default backends (feat!: call TES backends with service tokens #251):
custom.tes.service_list: []inpro_tes/config.yamlandconfig_models.py; the app warns if no backend is configured or discovered. Backends can also be discovered from a registry (feat: discover TES backends from the registry #260; verified,https, public addresses, discovered backends getclient_credentialsornone). - The middleware management API is not served (unregistered in fix: early cancel leaves the executor running TESK#219, FOCA 0.15), so it isn't reachable at all; the spec still describes runtime installs from Git/PyPI/local paths and has no security (fix(api)!: load only installed middlewares #217, on hold).
- The repository has no LS Login or ELIXIR defaults: issuers, audiences, clients, group mappings and backends are deployment configuration; config comments, chart values, docs and tests use fictitious examples (
login.example.org,compute-users,tes.example.org).
Core design problem (resolved): a request carries one Authorization header, so once clients send Bearer <token>, proTES can't receive per-request Basic credentials for the downstream instances. Resolved by proTES authenticating downstream with its own credentials (see "Downstream credentials (decided)").
Access policy (agreed):
- Public:
GET /service-info. - Running tasks (create, list, get, cancel): members of
ECP_CLNor any subgroup. - Middleware management API: members of
ECP_CLN:ADMINonly.
Authorization policy (agreed). Users must be members of the LS Login (Perun) group ECP_CLN (organization ELIXIR, "ELIXIR Compute Platform group for cloud apps") or any of its subgroups. The subgroups are currently ADMIN, BioHackCloud, BioHackCloud Admins, ELIXIR-CH, ELIXIR-CZ, ELIXIR-DE, ELIXIR-FI, ELIXIR-GR, ELIXIR-NL and OSS, plus the new EOC-Compute for approved compute users (elixir-cloud-aai/tes-dashboard#36). Membership is managed as LS Login VO groups and released to services as entitlement values, typically in the eduperson_entitlement claim.
Do not hardcode a guessed string: the exact value(s), whether subgroup members carry the parent ECP_CLN value, and whether the claim appears in the access token or only via userinfo are checked with a real test member in elixir-cloud-aai/generic-issues#31.
Generic configuration. This policy is the ELIXIR On-Cloud deployment's, not proTES's: proTES maps groups to the roles
userandadmin(security.access_control.claim_groups,group_mapping; exact values) and has no LS Login orECP_CLNdefaults. The ELIXIR On-Cloud values (issuerhttps://login.aai.lifescience-ri.eu/oidc/,userinfo_claims: [eduperson_entitlement], theECP_CLNentitlement values, the frontends' client IDs) belong in its deployment configuration, outside this repository (elixir-cloud-aai/generic-issues#31). The sample access token (2026-10-20) carries no group claims, so groups come from userinfo.
Downstream credentials (decided). Replaces options (a)–(c) of step 1. Per the ELIXIR On-Cloud authentication policy:
- Now (MVP): users are validated at the edge: issuer allowlist, signature,
exp/nbf,typ: at+jwt, client/audience allowlist (the frontends' client IDs), andECP_CLNfrom userinfo. proTES calls the TES backends with its own token (OAuth 2.0 client credentials, RFC 6749 §4.4); backends check issuer, signature, expiry and thatclient_idis proTES's, without anaudcheck. That avoids expired user tokens in long-running tasks and per-backend audiences, and it works for backends discovered at runtime (feat: discover TES backends from the registry #202). Backends that don't accept tokens yet get a transitional per-backend Basic mode from Secrets. The user'ssubtravels as data in TES tasktags, for accounting and audit only (feat: pass user identity to TES backends #254, on hold). - Target (later, with fix(chart): add probes to the API Deployment TESK#254): token exchange (RFC 8693, supported by LS Login): proTES exchanges the incoming token for one with
aud= the chosen backend andact= proTES, so that each backend checks that the token is for itself and can apply per-user policies. Not scheduled; full cross-stack auth is on hold. - Forwarding the caller's token (former option b) is not done: it would hand user tokens to every backend, including discovered ones.
How?
- Decide and document how proTES authenticates downstream: proTES's own client-credentials token, plus per-backend
basic(transitional) andnone(see above;docs/access-control.md, "Credentials of TES instances"). Add Read the docs files. Before they were auto generated TESK#213 / fix(chart): quote secret values TESK#251 (b6b35e6). - Enable bearer validation for the TES API and enforce the policy:
disable_auth: False,verify_token_type, issuers, audience, optionalclients, groups from userinfo, rolesuser/adminfromgroup_mapping, public service info; startup checks for issuers, audience and an admin group. Dependabot: urllib3 and boto3 updates TESK#212 / docs: note where charts from 0.3.0 on are published TESK#240 (46d3bc9), on FOCA 0.17 (build!: require FOCA 0.17 and Python 3.13 #214 / feat: add a chart value for the Swagger UI TESK#245,ec95fec). The audience is the frontends' client IDs, set per deployment (cf. Demonstrator dashboard: forward the user's LS Login access token to proTES and WES backends tes-dashboard#34).- The check with real LS Login tokens of a test member (exact
ECP_CLNentitlement values, parent values for subgroup members, FOCA's JWKS and userinfo validation; so far only tested with a fake identity provider in the smoke test) is a deployment task: chore: configure proTES for ELIXIR On-Cloud generic-issues#31.
- The check with real LS Login tokens of a test member (exact
- Record the authenticated
subas task owner (user_id, plus FOCA owner roles) and restrict list, get and cancel to the owner's tasks; no sharing, admins don't get access to the tasks of others (decision Q2). fix(filer): HTTP(S) uploads read outputs in text mode, so binary files fail and some text is altered TESK#215, Add missing boilerplate TESK#153 / fix(chart): quote secret values TESK#250 (9370b32), unique task identifiers feat(chart)!: derive resource names from the release TESK#248 / feat(chart): deprecate auth.clientSecret TESK#258 (e38b4de).- Tasks submitted by a service client (Conquest) on a user's behalf: proTES refuses to start if service clients or
on_behalf_of_headerare configured. Moved to fix(chart): add probes to the API Deployment TESK#254 (on hold), together with token exchange as a later step.
- Tasks submitted by a service client (Conquest) on a user's behalf: proTES refuses to start if service clients or
- Stop persisting downstream credentials in MongoDB: no
basic_authin task documents, none queued for the Celery worker, existing ones removed on startup (remove_stored_credentials()), Basic credentials only from environment variables (Secrets). Add Read the docs files. Before they were auto generated TESK#213 / fix(chart): quote secret values TESK#251. - Restrict the middleware management endpoints to
ECP_CLN:ADMIN(the roleadmin). The API is not served at all today, so nobody can reach it; this counts as met for M4.4. Securing the API before it is served again, and removing runtime installs from Git/PyPI/local paths, is feat: expose service-info setting in the chart TESK#217 (on hold, middleware direction undecided). - Configure every backend of the production deployment with its auth mode (
client_credentials, orbasicuntil the node accepts tokens), and register proTES's client-credentials client at LS Login: moved, with the per-node checklist, to chore: configure proTES for ELIXIR On-Cloud generic-issues#31 (ELIXIR On-Cloud deployment, outside this repository). - Update the Helm chart, the default service list and the docs: the chart is built on FOCA's library chart, renders only with issuers, audience and an admin group, and takes backend credentials from Secrets via
extraEnv(build(chart)!: use the FOCA library chart #216 / docs: add a single-node guide with MicroK8s TESK#252,718c3ba); no default backends (feat!: call TES backends with service tokens #251; this also covers chore: align the repo with the org's conventions TESK#229);docs/access-control.md,docs/configuration.md(backends, discovery) anddocs/upgrading.md(Basic credentials, removedbasic_auth) (feat(auth)!: require tokens for task operations #240, fix(chart): quote secret values TESK#250, fix(chart): quote secret values TESK#251, feat(chart): add tesk.filerHttpTimeout TESK#260).
Remaining
docs(chart): fix the TES backend examples: the chart's example ofcustom.tes.service_liststill uses the old string form (- "https://tes.example.org"indeployment/values.yamlanddeployment/README.md), which the config model rejects since fix(chart): quote secret values TESK#251 (it requires- url: …). Small docs fix.
Acceptance criteria
- With auth enabled, task requests without a valid token get
401, non-members get403, and members of the mapped groups are accepted (feat(auth)!: require tokens for task operations #240;tests/ga4gh/tes/test_access_control.py,tests/test_app.py, smoke test). WithECP_CLNitself: to be confirmed with a real LS Login test member in chore: configure proTES for ELIXIR On-Cloud generic-issues#31. - Tasks reach every live Node's backends via the configured mode, with nothing stored per task in the DB. Nothing stored: done (feat!: call TES backends with service tokens #251). Configuring the Nodes: chore: configure proTES for ELIXIR On-Cloud generic-issues#31.
- Users see only their own tasks (feat(access-control)!: own tasks per user #250; admins neither, by decision).
- The middleware API is restricted to
ECP_CLN:ADMIN. Met for M4.4: the API is not served, so not reachable; the restriction for when it is served again is feat: expose service-info setting in the chart TESK#217.
Dependencies: none left in proTES. The production configuration (elixir-cloud-aai/generic-issues#31) depends on proTES's client-credentials client at LS Login and on token support at the nodes (elixir-cloud-aai/generic-issues#35, elixir-cloud-aai/generic-issues#20, elixir-cloud-aai/generic-issues#21).
Moved to other issues
- Dependabot: urllib3 and boto3 updates TESK#212 (PR docs: note where charts from 0.3.0 on are published TESK#240): bearer tokens for task operations, roles from groups, public service info.
- Add Read the docs files. Before they were auto generated TESK#213 (PR fix(chart): quote secret values TESK#251): service tokens towards the backends, per-backend
basic/none, no caller credentials stored or forwarded, no default backends. - Enable LS Login on the ELIXIR On-Cloud TESK deployments generic-issues#35 (PR feat: add a chart value for the Swagger UI TESK#245): FOCA 0.17 (
at+jwtcheck, client allowlist). - fix(filer): HTTP(S) uploads read outputs in text mode, so binary files fail and some text is altered TESK#215 and Add missing boilerplate TESK#153 (PR fix(chart): quote secret values TESK#250): own tasks per user, no sharing.
- feat(chart)!: derive resource names from the release TESK#248 (PR feat(chart): deprecate auth.clientSecret TESK#258): unique task identifiers.
- Make service-info public by default, configurable TESK#216 (PR docs: add a single-node guide with MicroK8s TESK#252): chart on FOCA's library chart.
- chore(docs): run sphinx-apidocs TESK#202 (PR feat(chart): add tesk.filerHttpTimeout TESK#260): backends discovered from the Cloud Registry (verified,
https, public addresses). - fix(chart): add probes to the API Deployment TESK#254 (open, on hold): the user's identity towards the backends (TES tags) and the on-behalf-of path for service clients such as Conquest; later token exchange.
- feat: expose service-info setting in the chart TESK#217 (open, on hold): middleware API with bearer auth, admins only, installed middlewares only.
- chore: align the repo with the org's conventions TESK#229 (open): no default TES backends; done in fix(chart): quote secret values TESK#251, except the chart example (see "Remaining").
- fix: apply exclude_docs of pulled docs TESK#246 (open): release pins of FOCA 0.17.0 and
foca-common0.2.0 (not auth, but blocks a release with these changes). - chore: configure proTES for ELIXIR On-Cloud generic-issues#31 (open): ELIXIR On-Cloud configuration of proTES: LS Login client,
ECP_CLNcheck with a test member, per-node backends.
Part of the ELIXIR Compute Platform WP4 sprint (M&Ds due end of December 2026).
If you want to work on this issue:
- Assign yourself (if someone is already assigned, ask them first or pick another one)
- Move the issue to "In progress" on the project board
- Start working 🚀
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
uniqueg commentedon Oct 22, 2026
This issue is now the parent of the auth work in proTES, split into PR-sized child issues:
feat(auth)!: require LS Login tokens for tasks: LS Login bearer tokens for the TES API,ECP_CLN(and subgroups) for tasks,ECP_CLN:ADMINas admins, public service info.feat!: call TES backends with service tokens: proTES's own client-credentials token towards the backends, no caller credentials stored or forwarded any more, the user'ssubin TES task tags.build!: require FOCA 0.16 and Python 3.11+:at+jwtchecks, client allowlist, service tokens.feat(access-control): own tasks per user: own tasks only (admins all), including tasks that Conquest submits for a user.fix(api)!: load only installed middlewares: the middleware API restricted toECP_CLN:ADMIN.On step 1 (downstream credentials): the ELIXIR On-Cloud auth policy decided for proTES's own service token (client credentials) towards the backends, which check that the token's
client_idis proTES's, rather than forwarding the user's token (option b). That avoids expired user tokens in long-running tasks and per-backend audiences, and it also makes dynamic discovery (#202) possible without forwarding user tokens. Backends that don't accept tokens yet can get a transitional per-backend mode in elixir-cloud-aai/TESK#213.The per-node checklist (step 6) stays here; this issue is closed once all children are done and the production deployment is configured.
uniqueg commentedon Oct 23, 2026
Updated to the current state of
dev; the remaining deployment work moved to elixir-cloud-aai/generic-issues#31. Closing as done for proTES.