Unreleased documentation. These pages follow the main branch and can change before the next release. For supported guidance, use v0.46.0.
Control who can request evidence
For the assertion provider
In about fifteen minutes you will register two applications under access profiles of their own, send the same region request as each, and see one answered and the other refused. You continue in the project from Return a governed value, with the source and Registry Evidence still running.
See who may ask today
Section titled “See who may ask today”In first-evidence-assertion/adult-status, list the clients the project knows:
rstack evidence access client list --format json | jq -c '.entries[]'{"accessProfiles":["standalone-service"],"id":"example-caller","status":"active"}{"accessProfiles":["standalone-service"],"id":"tutorial-client","status":"active"}A client is one application’s identity. Both hold standalone-service, so both may ask every
question that access profile grants. example-caller
comes with the project; you added tutorial-client in Your first assertion.
Add two access profiles
Section titled “Add two access profiles”Give each new application a profile with one grant. Add these profiles to the end of
dev-authority.yaml, at the same indentation as standalone-service:
age-checker-service: authority: organizational actorKind: service requesterTags: - age-checker-service grants: - definition: adult-status purpose: age-check audienceFrom: authenticated-requester representations: - signed-jws subjectBinding: audience-scoped subjects: - role: subject selectorProfile: record-by-id valueOrigin: request region-router-service: authority: organizational actorKind: service requesterTags: - region-router-service grants: - definition: residence-region purpose: residence-check audienceFrom: authenticated-requester representations: - signed-jws subjectBinding: audience-scoped subjects: - role: subject selectorProfile: record-by-id valueOrigin: requestrequesterTags lists the tags a caller’s token must carry to act under the profile. Check that
each grant stays inside its definition’s grant ceiling:
rstack evidence check . --target local-target.yaml0 errors, 0 warnings in 1 fileRegister a client for each profile
Section titled “Register a client for each profile”Registry Evidence reads profiles and clients only as it starts, and rstack evidence refuses a
client change while it runs, so stop it first:
rstack evidence dev stop .Local Evidence stoppedRegister one client per profile; the local issuer puts each profile’s tags in its client’s tokens:
rstack evidence access client add age-checker \ --access-profile age-checker-service \ --generate-local-keyrstack evidence access client add region-router \ --access-profile region-router-service \ --generate-local-keyAdded client age-checker with access profile age-checker-service.Added client region-router with access profile region-router-service.Start Registry Evidence again with the same ports, so it loads the profiles and clients:
rstack evidence dev start . \ --target local-target.yaml \ --evidence-port 18080 \ --issuer-port 8082Evidence ready at http://127.0.0.1:18080The source kept running throughout.
Ask for a purpose the definition does not declare
Section titled “Ask for a purpose the definition does not declare”adult-status declares only the purpose age-check. Ask under another:
rstack evidence request prepare adult-status \ --client age-checker \ --purpose residence-check \ --subject subject:record-id=adult \ --name adult-wrong-purposeevidencectl: purpose does not match the active local tutorial definitionPreparation refuses it, so nothing reaches Registry Evidence.
Send the region request as each client
Section titled “Send the region request as each client”Preparation checks the request against the project, not the grants, so both succeed:
rstack evidence request prepare residence-region \ --client region-router \ --purpose residence-check \ --subject subject:record-id=adult \ --name region-by-routerrstack evidence request prepare residence-region \ --client age-checker \ --purpose residence-check \ --subject subject:record-id=adult \ --name region-by-checkerSend the request as region-router; Registry Evidence applies that client’s grants:
rstack evidence api /v1/evidence \ --client region-router \ --input .evidence/requests/region-by-router/request.json \ --accept application/jose+json \ --output region-by-router.responseSend the other prepared request as age-checker. The API writes the refusal body and exits 1 for
the HTTP 403 response:
rstack evidence api /v1/evidence \ --client age-checker \ --input .evidence/requests/region-by-checker/request.json \ --accept application/jose+json \ --output region-by-checker.responseRead the refusal age-checker received:
jq . region-by-checker.response{ "type": "https://id.registrystack.org/problems/registry-evidence/evidence/denied", "title": "Evidence request is not permitted", "status": 403, "detail": "the Evidence request is not permitted", "code": "evidence.denied", "traceId": "<trace-id>"}evidence.denied does not name the missing grant.
Evidence problems lists every code.
Leave the source and Registry Evidence running; the next tutorial continues with them.
Cookies on Registry Stack
We use optional cookies to understand how you use the main Registry Stack website and this documentation. If you contact us, we may link this activity to your enquiry. You can change your choice at any time. Read the privacy policy.
Your browser asks sites not to track you, so optional tracking stays off.
We could not use or save that choice. Optional tracking remains off.