feat(domain): key passport signatures by disclosure set - #70
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 13 |
| Duplication | 6 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the
Passportfield and the naming vocabulary that let each audience receive a proof over its own view. Consumed by dpp-engine's audience-scoped read (dpp-engine#63); no behaviour changes in this repo on its own.Do not publish yet. dpp-engine builds against this via the local
[patch.crates-io]override for now.The defect this exists to fix
A passport carries two proofs:
jwsSignatureover the full payload (Conformity), andpublicJwsSignatureover the public view. Cross that withAudience::may_seeand a non-public reader has nothing that covers what they receive:publicJwsSignature✅publicJwsSignature— covers less ❌jwsSignature— covers more ❌Neither non-public case is "unsigned". Both were served a signature that fails against the bytes it arrived with, which to anyone actually checking is indistinguishable from tampering. A repairer or recycler making a safety or resale call on the data is exactly the reader who needs to verify it.
What lands here
Passport::disclosure_signatures: BTreeMap<String, String>— a proof per non-public disclosure set, frozen at publish beside its two siblings.BTreeMapso serialisation is key-ordered and the signed bytes are reproducible;skip_serializing_ifempty, so drafts and existing rows are unaffected.disclosure_key(&[Disclosure]) -> StringandAudience::disclosure_key()/disclosure_set()— canonical set naming, tokens in Annex XIII order joined with+.Disclosure::token()— a stable wire token, deliberately notSerialize-derived, because these strings are baked into stored artefact keys and must not move if a serde attribute changes.Why the key is the disclosure set and never the audience name
ESPR's actor vocabulary is ~14 classes (repairers, refurbishers, recyclers, customs, civil society, …), not battery Art. 77(2)'s three audiences, and the Art. 9(2)(f) delegated act mapping actors to data does not exist for any of our sectors. An artefact keyed
"legitimateInterest"would need every passport re-signed the day that mapping lands. One keyed by the classes it actually covers keeps meaning exactly what it always meant, and a new actor taxonomy becomes a new mapping onto the same keys.The tests assert this literally rather than by round-trip —
a_disclosure_key_names_classes_never_an_audiencefails if an audience name ever leaks into a key.Tests
Four new in
domain::identity: key contents, canonical ordering regardless of input order,disclosure_setagreeing withmay_seefor every audience/class pair, and the no-audience-names property.just checkgreen.Release note
This is a breaking change for anyone constructing
Passportwith a struct literal, so it wants 0.12.0 (lockstep) whenever it is published. Not bumped here.