Repository navigation
Closed
Labels
priority: mediumMedium prioritytype: authRelated to authorization or authenticationtype: featureNew feature or requestworkload: hoursLikely takes hours to resolve
Description
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}/verificationreturns 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 /servicesandGET /services/typeswith 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.
Metadata
Metadata
Assignees
Labels
priority: mediumMedium prioritytype: authRelated to authorization or authenticationtype: featureNew feature or requestworkload: hoursLikely takes hours to resolve
Activity
docs: add tokens for public reads to 0.5.0