Skip to content

feat: use tokens sent with public reads #245

Closed

Description

@uniqueg

Why?

Public reads (GET /services, GET /services/{serviceId}, GET /services/types, GET /verifications, GET /services/{serviceId}/verification) ignore a bearer token if one is sent, unless reads require login. Since #238, these reads hide pending items from requests without a user, so:

  • Admins and creators don't see pending services and types in the public reads, even when they send their token. Clients have to merge in GET /approvals (feat: show and approve pending entries cloud-registry-ui#46 does).
  • An admin can verify a pending service, but no read returns that verification until the type is approved.

What?

  • On public reads, validate a bearer token if one is sent, and use the user for the visibility rules (admins, creators, users with a role). Without a token, behave as now.
  • An invalid or expired token on a public read: either 401 (so clients notice and log in again) or treat the request as anonymous. Decide in the PR and document it.
  • Must work with LS Login tokens in production, as the other authenticated endpoints do.
  • Pending services can't be verified: PUT /services/{serviceId}/verification returns 409 while the service is pending (maintainer decision: a service must leave the pending state before it can be verified). A service that becomes pending through a type change loses its verification anyway, as the type no longer matches.

Acceptance criteria

  • Verifying a pending service returns 409.
  • GET /services and GET /services/types with a token include the pending items the caller may see; without a token, they don't.
  • Tests cover anonymous, valid and invalid tokens on each public read.

Activity

  1. added
    priority: medium
    status: triage
    type: auth
    type: feature
    workload: hours
    on Oct 25, 2026
  2. added
    status: in progress
    and removed
    status: triage
    on Oct 26, 2026
  3. removed
    status: in progress
    on Oct 26, 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: mediumtype: authtype: featureworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions