Claims reviews
The id service enrols members with FG_ID_SERVICE_MEMBERS_CLAIMS=membership,
so the membership scope is this service's. When a person is deciding whether
to share it with another service, and whenever it is released to one, the id
service POSTs a ClaimsReview to /api/v1alpha1/claimsreviews.
The contract is the id service's; see its documentation. What this service
does with one, in lib/claims-reviews.ts:
- Verify the bearer token against the id service's JWKS, from its discovery
document: its issuer, this client ID as the audience,
typfg-claims-review+jwt, and at most two minutes old. - Check the token's
jtiandsubare the request'suidandsubject. - Look up the member, and build the
membershipclaim if it was asked for. - Put that to policy, and answer with what it allows, and its reasons for the rest.
Anyone who is not a member gets no claims, not an error.
The API
Kubernetes style, like the id service's: /api and /api/v1alpha1 for
discovery, and the OpenAPI document at /api/openapi/v3, which refers to the
id service's own for the ClaimsReview schema rather than copying it.