Skip to content

feat: support several token issuers #257

Closed

Description

@uniqueg

Why?

FOCA 0.18 supports several trusted token issuers with settings of their own (elixir-cloud-aai/foca#503, elixir-cloud-aai/foca#510). With two or more issuers, subjects are namespaced by issuer (<issuer>|<sub> by default), so that equal subjects of different issuers are different users. The registry stores subjects in several places and names users in paths, so it needs changes to support several issuers. Deployments with a single issuer are not affected.

What?

  • User paths: PUT/DELETE /services/{serviceId}/permissions/{userId}: give userId format: path, because namespaced subjects contain slashes. Match the user with * in the owner rule (owners-change-permissions in config.yaml), as for groups. Update the parameter description.

  • Startup checks: make the checks in app.py aware of IssuerConfig. Use issuer_urls, and accept audiences set per issuer.

  • Migration: add a script (or a documented mongosh snippet) that rewrites the stored subjects of one issuer to the namespaced form:

    • FOCA policy rules (user:<sub>, owners and maintainers);
    • created_by of service types (unused-types limit, visibility of pending types);
    • the user_names collection.

    The script then calls the adapter's mark_changed().

  • Docs (upgrading, configuration, Helm values):

    • Recommend namespace: "" for the issuer trusted so far, so that its stored subjects stay valid; use the script for anything else.
    • Document the IssuerConfig form of security.auth.issuers.
    • Add a note that group claim values are not namespaced: issuers must not be able to issue the same groups (e.g., admin groups).

Acceptance criteria

  • Equal subjects from two issuers are different users (owners, maintainers, creators of service types).
  • Roles can be granted to and revoked from namespaced users via the permissions API.
  • An upgrade path for existing deployments that add an issuer is documented and tested.

Requires FOCA 0.18.0. Related: #240 (opt-in admin role).

Activity

  1. added
    priority: high
    status: triage
    type: auth
    on Oct 26, 2026
  2. added
    type: feature
    workload: hours
    status: in progress
    and removed
    status: triage
    on Oct 26, 2026
  3. removed
    status: in progress
    on Oct 27, 2026
  4. added this to the v0.6.0 milestone on Oct 28, 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: hightype: authtype: featureworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions