New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add basic zcap impl based on linked-data-documents #189
Conversation
8ca6458
to
6ccdb1d
Compare
"id": "urn:uuid:ad86cb2c-e9db-434a-beae-71b82120a8a4", | ||
"capabilityAction": "Drive", | ||
"proof": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a whitespace inconsistency here.
It would be nice if the example files were usable/verifiable. But testing the parsing is good too.
Nice work @chunningham, I like the use of generic type parameters. |
4c83ec1
to
e08e28e
Compare
Is there a particular use-case or set of use-cases that Spruce has in mind? |
@agropper we are using zcaps for https://github.com/spruceid/kepler |
da1b192
to
8758cfa
Compare
Closes #125 |
src/ldp.rs
Outdated
@@ -615,6 +615,7 @@ async fn sign( | |||
created: Some(options.created.unwrap_or_else(now_ms)), | |||
domain: options.domain.clone(), | |||
challenge: options.challenge.clone(), | |||
property_set: options.property_set.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in https://github.com/spruceid/ssi/pull/189/files#r661613315:
I don't think
property_set
should be passed through into the proofs. There may be issue options that we don't support or know about but that are supposed to have a meaning other than passing them through into the proof. e.g.credentialStatus
issue option is supposed to cause acredentialStatus
object to be added to the document rather than to the proof: https://github.com/w3c-ccg/vc-http-api/blob/7c72ae2b470ff8dfec12d3b6c3de4f84c6f2a176/packages/vc-http-api-test-server/__tests__/issueCredential.spec.js#L130-L148
Maybe the options object with open-ended property_set
, or the property_set
alone, could be transcoded into a stricter version that is parameterized by the proof type and purpose (like in feat/generic_proof
), so unknown properties would be caught at that point? Or it could be done non-generically, for the sake of just this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I experimented with generic property_set
s for both Proof
and LinkedDataProofOptions
where the property_set
type P
for Proof<P>
must implement From<&LinkedDataProofOptions<O>>
(so that devs can implement how the options translate to custom proof fields). This path is blocked by some custom proof logic (e.g. P256BLAKE2BDigest...2021
expects to add the publicKeyJwk
field to the proof properties). Will try a non-generic path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
property_set
has been removed from LinkedDataProofOptions
in favour of changing the ProofSuite
trait to accept an additional extra_proof_properties: Option<Map<String, Value>>
argument for sign
and prepare
.
Co-authored-by: Charles Lehner <charles.lehner@spruceid.com>
aa88f2d
to
c54987f
Compare
An implementation of the ZCAP-LD specification. The struct is generic over caveats and actions to allow for application-specific definitions of these fields, as they are out of scope for the spec.