Mandate schema
Specification versionv0.1.1JSON Schema of a mandate and its rules.
SHA-256 6b1452c1…c7b7 ShowHide
6b1452c1070780ce841d0158116bf4cf2fa08a41e2fc966ac359636ddb72c7b7Specification v0.1 · open · vendor-neutral
Everything you need to build a home guard, an agent integration or a validator – and to show that it conforms.
An agent never talks to a device directly. It sends its request to the implementation, which decides with the household’s mandate and only then passes a command on to the smart-home platform. The specification defines the solid lines; how the dashed ones work is up to the implementation.
Read section 1.1 of the specA mandate belongs to one agent and holds rules. Each rule names resources (a device, a category or an area), actions and a decision. Rule order never matters: of all matching rules, the strictest decision wins.
Read section 3 of the spec| Field | Type |
|---|---|
| type | "https://home-mandate.org/mandate/v0" |
| id | string |
| name | string? |
| principal | string |
| agent | {client_id, display_name} |
| enforce | false? |
| rules | Rule[] |
| default | "deny" |
| approval | Approval |
| limits | {max_actions_per_hour} |
| valid_from | date-time |
| expires | date-time? |
| issuer | uri? |
| audience | uri? |
| version | integer? |
| created_by | string |
| created_at | date-time |
| Field | Type |
|---|---|
| id | string |
| resource | Resource |
| actions | string[] |
| decision | allow|ask|deny |
| note | string? |
| conditions | Conditions? |
| constraints | Constraints? |
| approval | Approval? |
| allow_critical | true? |
? marks an optional field. Generated from the JSON Schema of the mandate.
An implementation conforms to one or more classes. It conforms to a class of a version if it passes all cases of that class.
Validates mandates, computes their digests and evaluates requests (sections 3 and 4).
478 test cases
Selects the mandate to evaluate among several stored ones (section 4.3).
29 test cases
Verifies signed mandates and the succession of mandate versions (sections 3.5 and 7).
58 test cases
Verifies the hash chain of audit logs and computes entry digests (section 9.4).
217 test cases
Additionally verifies the signed checkpoints of a log (section 9.5).
11 test cases
Answers AuthZEN requests from its own mandate store and resource directory (sections 4.3 and 6).
valid evaluator and selection cases, over HTTP
Evaluator is the basis: anything that claims to evaluate mandates conforms to it. The obligations of the guard (section 11) cannot be tested from outside yet; an implementation states how it meets them.
The test tool mandate-conformance contains the cases of its version and plays them against your implementation, whatever its language: through a small harness that reads and writes one JSON line per request, or over HTTP for a PDP. Its report names the version, the classes and the manifest.
Section 10 of the spec describes both ways.
go install github.com/home-mandate/spec/cmd/mandate-conformance@v0.1.1 mandate-conformance -report report.json -exec ./your-harness mandate-conformance -report report.json -authzen https://pdp.test -control https://pdp.test/test/state Verify files with the SHA-256 checksum. Each format is also named by an address of its own: mandate, audit log entry and audit checkpoint.
JSON Schema of a mandate and its rules.
6b1452c1070780ce841d0158116bf4cf2fa08a41e2fc966ac359636ddb72c7b713 device categories, their actions and which actions are critical.
954b4dfc9ccec520c4d2c90dc55a74e8eec67790a643c1c91719904d338b3222JSON Schema of an audit log entry.
0571f424d81fbd74c5ca82a5c2489101d526fd4bcafec11074eabfc1e8390ed2