GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • RSRegistry StackDocsDevelopment (unreleased)
  • GitHub ↗
  • Four ways to adopt
  • How the products fit together
  • Overview
  • Your first assertion
  • How Evidence works
  • Return a governed value
  • Control who can request evidence
  • Assert a role-bound relationship
  • Request evidence as an SD-JWT VC
  • Request an assertion
  • Request an access token
  • Verify an assertion

This view

  • Original page
  • New address

GeezerVison is showing docs.registrystack.org — Assert a role-bound relationship

Unreleased documentation. These pages follow the main branch and can change before the next release. For supported guidance, use v0.48.0.

Assert a role-bound relationship

For the assertion provider

View as Markdown

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 the run still going.

Outcome
A verified relationship assertion bound to a child and a candidate parent.
Time
About 10 minutes
Level
Local development with synthetic data
Prerequisites
The project, source, and run left going by Control who can request evidence

For the local commands in this tutorial, declare development in your shell. rstack dev sets this value for the processes it starts.

Terminal window
export REGISTRY_STACK_POSTURE=development

Check the relationship definition

Section titled “Check the relationship definition”

In first-evidence-assertion/adult-status, run the relationship fixture on its own:

Terminal window
rstack evidence test . \
--target local-target.yaml \
--fixture fixtures/legal-parent-relationship.yaml
PASS: fixtures/legal-parent-relationship.yaml (9 cases)

The legal-parent-relationship definition in evidence.yaml names two roles under subjects:

evidence.yaml
subjects:
- role: child
selectors:
- record-by-id
- role: candidate-parent
selectors:
- record-by-id

Each 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:

In a new terminal, read the run back from run.json and redefine the helper that fetches a token header file:

Terminal window
run_id="$(jq -r .run_id run.json)"
evidence_url="$(jq -r .products.evidence run.json)"
runtime_config="$(jq -r .runtimeConfigs.evidence run.json)"
headers_for() {
rstack dev token "$run_id" --as "$1" | awk '$1 == "evidence" && $2 == "headers" {print $3}'
}
Terminal window
rstack evidence request prepare legal-parent-relationship \
--evidence-url "$evidence_url" \
--header @"$(headers_for caller)" \
--runtime-config "$runtime_config" \
--purpose relationship-check \
--subject child:record-id=child \
--subject candidate-parent:record-id=parent \
--name legal-parent-relationship
rstack evidence api /v1/evidence \
--url "$evidence_url" \
--header @"$(headers_for caller)" \
--input .evidence/requests/legal-parent-relationship/request.json \
--accept application/jose+json \
--output legal-parent.jws.json
rstack evidence verify legal-parent.jws.json \
--context .evidence/requests/legal-parent-relationship/verification.json \
--output legal-parent.verified.json
jq -c '.subjects[], .supportedValues[]' legal-parent.verified.json
VERIFIED
{"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:

Terminal window
rstack evidence request prepare legal-parent-relationship \
--evidence-url "$evidence_url" \
--header @"$(headers_for caller)" \
--runtime-config "$runtime_config" \
--purpose relationship-check \
--subject child:record-id=child \
--name missing-candidate-parent
evidencectl: subject inputs must match the definition's complete role set

Give the child role twice, and it refuses again:

Terminal window
rstack evidence request prepare legal-parent-relationship \
--evidence-url "$evidence_url" \
--header @"$(headers_for caller)" \
--runtime-config "$runtime_config" \
--purpose relationship-check \
--subject child:record-id=child \
--subject child:record-id=parent \
--subject candidate-parent:record-id=parent \
--name duplicate-child
evidencectl: subject inputs must contain each selected profile field exactly once

Swap the two values. The request is complete, but the source holds no parent set for parent:

Terminal window
rstack evidence request prepare legal-parent-relationship \
--evidence-url "$evidence_url" \
--header @"$(headers_for caller)" \
--runtime-config "$runtime_config" \
--purpose relationship-check \
--subject child:record-id=parent \
--subject candidate-parent:record-id=child \
--name swapped-relationship
Terminal window
rstack evidence api /v1/evidence \
--url "$evidence_url" \
--header @"$(headers_for caller)" \
--input .evidence/requests/swapped-relationship/request.json \
--accept application/jose+json \
--output swapped-relationship.json
Terminal window
jq -r .code swapped-relationship.json
evidence.unavailable

Registry Evidence returns evidence.unavailable for any subject it cannot resolve, so the refusal does not say which record was missing.

Leave the source and the run going; the next tutorial continues with them.

Next

Section titled “Next”

Request evidence as an SD-JWT VC

Last reviewed 2026-11-27Edit this pageReport an issue
Was this helpful?

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.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.