Repository navigation
In progress
Labels
priority: highHigh prioritystatus: in progressCurrently being worked ontype: featureNew feature or requestworkload: hoursLikely takes hours to resolve
Description
Context
Part of the TESK access-control redesign: the group model is removed entirely, the owner is identified by issuer and subject, and only task creation is gated by policy. Today TESK API authenticates user tokens only through the IdP's userinfo endpoint. It never checks their issuer, signature or audience itself. Only service-client tokens are validated locally (#153, #220).
Goal
A token validator that validates every access token locally. It sits behind one interface, so that other kinds of validation (for example RFC 7662 introspection of opaque tokens) can be added later without rework.
TokenValidatorinterface; the implementation is selected bytesk.api.auth.token-validator(onlyjwtfor now).- The JWT implementation accepts JWT access tokens only:
typat+jwt;issexactly one of the configured issuers;- keys from the issuer's OIDC discovery, or from a configured JWKS URI (https only);
- asymmetric algorithms only;
exp,iatandsubrequired;nbf, maximum age and clock skew checked.
- Audience:
- user tokens:
audmust contain one of the issuer's configured front-end client IDs; - listed service clients (
iss+ client ID from an allow list; client claim ==sub== the client ID):audmust contain the client's own ID.
- user tokens:
- The principal is
<iss>|<sub>. There is no group model. - Not wired into request authentication in this issue. Wiring is a follow-up that also removes the userinfo authentication and
ServiceClientTokenServices.
Acceptance criteria
- Unit tests for every check, including the refusals: unknown issuer, wrong audience, symmetric algorithms or
none, wrongtyp, expired or not yet valid, usersubequal to a listed client ID, delegated tokens (act). - Invalid settings fail at startup.
- 100% coverage (repo rule).
- Developer docs describe the interface and the settings.
- The audience defaults are confirmed against a real LS Login user token (
typ,aud, where the entitlements live) before the wiring issue starts.
Out of scope
- Wiring into Spring Security.
- Entitlement lookup and the decision-service call on create.
- Delegated tokens / trusted actors (open question).
- Introspection.
Metadata
Metadata
Assignees
Labels
priority: highHigh prioritystatus: in progressCurrently being worked ontype: featureNew feature or requestworkload: hoursLikely takes hours to resolve
Activity