Unreleased documentation. These pages follow the main branch and can change before the next release. For supported guidance, use v0.46.0.
Assert a role-bound relationship
For the assertion provider
If you write assertion definitions, this tutorial shows you one that binds two subjects in distinct roles and releases one Boolean: is the candidate in the child’s complete legal-parent set? You continue in the project from Control who can request evidence, with the source and Registry Evidence still running.
Check the relationship definition
Section titled “Check the relationship definition”In first-evidence-assertion/adult-status, run the relationship fixture on its own:
rstack evidence test . \ --target local-target.yaml \ --fixture fixtures/legal-parent-relationship.yamlPASS: fixtures/legal-parent-relationship.yaml (9 cases)The legal-parent-relationship definition in evidence.yaml names two roles under subjects:
subjects:- role: child selectors: - record-by-id- role: candidate-parent selectors: - record-by-idEach role selects a record through the record-by-id
selector profile. The parent-record source fetches the
parent set with the child selector alone, and its response shape requires complete: true, so an
incomplete set is refused before any Function runs. outputs declares one Boolean, is-parent, so
the parent list never enters the assertion.
Request and verify the relationship
Section titled “Request and verify the relationship”Prepare one request with both roles, send it, verify the response, and read it:
rstack evidence request prepare legal-parent-relationship \ --client tutorial-client \ --purpose relationship-check \ --subject child:record-id=child \ --subject candidate-parent:record-id=parent \ --name legal-parent-relationshiprstack evidence api /v1/evidence \ --client tutorial-client \ --input .evidence/requests/legal-parent-relationship/request.json \ --accept application/jose+json \ --output legal-parent.jws.jsonrstack evidence verify legal-parent.jws.json \ --context .evidence/requests/legal-parent-relationship/verification.json \ --output legal-parent.verified.jsonjq -c '.subjects[], .supportedValues[]' legal-parent.verified.jsonVERIFIED{"binding":"urn:evidence:subject:<binding>","role":"child"}{"binding":"urn:evidence:subject:<binding>","role":"candidate-parent"}{"providesValueFor":"urn:example:concept:legal-parent-relationship:v1","value":true}Each role carries its own subject binding, an opaque value scoped to your audience
(subjectBinding: audience-scoped), in place of the record identifier.
Prove the role boundary
Section titled “Prove the role boundary”Leave out the candidate parent, and request prepare refuses before it writes anything:
rstack evidence request prepare legal-parent-relationship \ --client tutorial-client \ --purpose relationship-check \ --subject child:record-id=child \ --name missing-candidate-parentevidencectl: subject inputs must match the definition's complete role setGive the child role twice, and it refuses again:
rstack evidence request prepare legal-parent-relationship \ --client tutorial-client \ --purpose relationship-check \ --subject child:record-id=child \ --subject child:record-id=parent \ --subject candidate-parent:record-id=parent \ --name duplicate-childevidencectl: subject inputs must contain each selected profile field exactly onceSwap the two values. The request is complete, but the source holds no parent set for parent:
rstack evidence request prepare legal-parent-relationship \ --client tutorial-client \ --purpose relationship-check \ --subject child:record-id=parent \ --subject candidate-parent:record-id=child \ --name swapped-relationshiprstack evidence api /v1/evidence \ --client tutorial-client \ --input .evidence/requests/swapped-relationship/request.json \ --accept application/jose+json \ --output swapped-relationship.jsonjq -r .code swapped-relationship.jsonevidence.unavailableRegistry Evidence returns evidence.unavailable for any subject it cannot resolve, so the refusal
does not say which record was missing.
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.