Skip to content

feat!: make proTES a thin gateway (proposal) #391

Open

Description

@uniqueg

Status: proposal, not decided. Nothing starts on this until the maintainer has confirmed it. Open points are listed below. LS Login has answered our questions on token exchange (see Token flow); the flow still needs testing against real clients.

Why

proTES stores a copy of every task and polls its backend in the background with its own credentials. That's a lot of machinery, and it conflicts with per-hop token exchange: a background poll has no user request behind it, so there's no token to exchange once the user's has expired. Keeping a copy also makes proTES responsible for protecting that copy, and backends can't tell users apart, as they only ever see proTES.

Proposal

Layer                 Default   Adds
Core gateway          always    routing, relaying, token exchange
Task record plugin    on        history, provenance, listing
Recorder plugin       off       data for smart routing
Other plugins         optional  ownership checks, limits, retention

Core gateway

  • Stores no tasks. No tracker, no stored credentials, and probably no Celery or broker.
  • State and logs come live from the backend, with the caller's exchanged token.
  • Authorisation at the gateway only covers who may use the gateway. Each node protects its own resources and applies its own policy, so per-user isolation is the node's responsibility. The docs say so plainly.
  • No sharing of task access on proTES. Portals can offer that themselves.

Token flow

LS Login only lets a service exchange a token whose aud contains that service's own client ID. So each caller gets a token for the next service before calling it:

Krini    -> exchange for aud=proTES -> call proTES
proTES   -> exchange for aud=node   -> call the TES node

With Conquest in the chain, Krini exchanges for Conquest, and Conquest for proTES.

  • Krini: it needs a token for its first target, so it probably gets a small backend, if public clients can't exchange. It would have needed one soon anyway, e.g., to keep task and workflow listings at the portal.
  • Registration: exchange and each target (RFC 8707 resource indicator) are allowed per client in LS Login's service registration. So proTES's client lists every TES node. The number of combinations is manageable by hand for now, and registration could later be automated through the Cloud Registry. A rogue registry entry gets no token, as it isn't registered.
  • Audiences: one per node rather than one shared audience, so that a token stolen at one node can't be used at another.
  • Groups: entitlements come from user info or introspection and are computed for the client doing the exchange, so each exchanging client needs group release configured.
  • Long-running work: Conquest can hold a refresh token (offline_access, currently 31 days). Details are to be tested.
  • Changes at LS Login: a new proxy stack is planned for next year, and it may change the aud rule, add act and make lifetimes configurable. So FOCA keeps this configurable and doesn't hard-code today's behaviour.

Task IDs

  • An ID names the service that holds the task, plus the task ID there, so its length doesn't depend on the number of hops. No limit on ID length.
  • The first gateway that receives an ID without a prefix from its backend adds that backend's service ID. Gateways further up pass it on unchanged.
  • Clients that know the convention can call that service directly. Others call their entry gateway, which forwards the call to the named service.
  • Service IDs resolve only through a gateway's allow-list or the Cloud Registry, never through a URL in the ID.
  • The format must be unmistakable, as a plain TES can return any string. If it works, propose it to GA4GH, along the lines of DRS URIs.
  • Where a node is private or trusts another identity provider, a gateway at that boundary mints its own ID and becomes the addressed service. It needs the task record plugin for this.

Task record plugin

  • Stores owner, backend, remote ID, creation time and routing provenance, but no task contents, states or logs.
  • Makes no access decisions by default, so clients may opt in or out per request where operators allow it. Operators can also require it or turn it off, leaving proTES fully stateless.
  • A separate ownership plugin can serve federations that want central control. Required plugins that fail must fail the request.

Listing

  • GET /tasks stays, as TES requires it. It lists "tasks tracked by the TES server", so it means what the record plugin tracks, or nothing without one.
  • Asking all backends happens only on explicit request, e.g., for a data takeout. It isn't an everyday operation: clients that care about their tasks keep track of them, and portals offer task views themselves.

Identity and tracing

  • Owners are identified by issuer plus subject, so that identity providers can be added later. LS Login's sub stays the same across exchanges.
  • LS Login doesn't support act or can_act for now, so a node can't see the chain of services from its token. Instead:
    • A hop limit in a request header stops loops.
    • W3C traceparent across hops gives retroactive tracing, from each service's logs.
  • Once act is available, the chain comes from nested act claims, and a gateway finding itself in the chain refuses the request. LS Login is considering this for its new stack. Our chain is a concrete use case to bring to them, as provenance and accounting need it.
  • Separate identity providers change only how one hop gets its token (identity chaining across domains, RFC 7523), so the outbound credentials part stays swappable.

Data for smart routing

  • An optional recorder plugin sees responses passing through and keeps only what routing needs: image, requested resources, input sizes, backend, outcome, duration. No owner, no commands.
  • It's worth building once TES reports actual resource use. Until then, only the hook is needed.
  • Clients polling services directly bypass it, so it depends on clients staying on the gateway, on callbacks, or on telemetry. Tasks nobody asks about go unrecorded, which is fine.

Callbacks

Not part of this design, as TES has none yet. Once it does, proTES can pass callback URLs through to backends.

Plugins beyond proTES

Before any of these plugins is implemented, consider how useful it is for proWES and other gateways too. If it could be reused, abstract it. If it can't be fully abstracted, build an abstract plugin plus a specific one for each service type, such as TES or WES.

What changes

  • Removed: tracker, most stored task data, and own service tokens for tasks.
  • Dropped or moved: feat: pass user identity to TES backends #254 is replaced by token exchange; feat: limit tasks per user (opt-in) #285 and feat: retain finished tasks for N days (opt-in) #286 become plugins; per-backend tokens come with token exchange.
  • FOCA: outgoing token exchange per target audience, a plugin hook on responses, read-side hooks that can refuse a request, reserved hook signatures (before 1.0). #528 needs re-scoping against this before it's split.
  • Migration: existing tasks need a one-off migration, including their IDs. This is a breaking release (0.6.0).
  • Fallback: 0.5.0 keeps today's architecture and works as before. LS Login's answers don't rule out token exchange, so the fallback only applies if testing does.

To check

  • LS Login: is token exchange available? Yes, allowed per client.
  • LS Login: audiences without per-node registration? No, targets are registered per client.
  • LS Login: nested act? Not now, under consideration.
  • Test the flow end to end against LS Login with test clients: claims after each exchange, refused cases, group release.
  • LS Login: can public clients exchange tokens? This decides how soon Krini needs its backend.
  • LS Login: can an exchange return a refresh token, and is the 31 days an idle or an absolute limit?
  • LS Login: does the current 1-hour lifetime apply only to exchanged tokens?
  • FOCA access control without MongoDB, if per-resource policies go.
  • Do required plugins fail the request when they fail?
  • Which clients rely on GET /tasks (Cloud Components' TES views, Krini)? Those adapt.
  • Which TES backends enforce per-user access with exchanged tokens?
  • Is FOCA's namespacing of subjects by issuer complete?

Activity

  1. added this to the v0.6.0 milestone on Nov 3, 2026
  2. added
    priority: medium
    status flag: discuss
    status: on hold
    type: feature
    workload: weeks
    on Nov 3, 2026
  3. modified the milestones: v0.6.0, v0.7.0 on Nov 9, 2026
  4. uniqueg commented on Nov 10, 2026

    @uniqueg
    MemberAuthor

    Design point from elixir-cloud-aai/token-exchange-flow-testbed#29: input URLs (inputs[].url) may be signed URLs, whose query string works as a credential for anyone who has it. The task record plugin should state explicitly what it keeps of a task, and whether "no task contents" excludes input and output URLs, or keeps them only without query string and user info.

  5. removed this from the v0.7.0 milestone on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumstatus flag: discussstatus: on holdtype: featureworkload: weeks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions