-
Notifications
You must be signed in to change notification settings - Fork 158
feat: vc wallet prove interface #2681
feat: vc wallet prove interface #2681
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2681 +/- ##
==========================================
+ Coverage 88.41% 88.42% +0.01%
==========================================
Files 265 265
Lines 21165 21202 +37
==========================================
+ Hits 18712 18747 +35
- Misses 1431 1432 +1
- Partials 1022 1023 +1
Continue to review full report at Codecov.
|
pkg/client/vcwallet/client.go
Outdated
func (c *Client) Prove(credentialIDs []string, options *wallet.ProofOptions) (json.RawMessage, error) { | ||
// TODO to be added #2433 | ||
return nil, fmt.Errorf("to be implemented") | ||
func (c *Client) Prove(credentials []interface{}, options *wallet.ProofOptions) (*verifiable.Presentation, error) { |
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'd rather not use an interface[]. Looking at the code, you have two different inputs to Prove: credential IDs or credentials.
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.
Also - It seems you switched from Prove being on stored credentials to being on anything passed-in. What was the reason?
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.
If you really need different inputs into the same function, you could also look at how NewPresentation was done:
https://github.com/hyperledger/aries-framework-go/blob/main/pkg/doc/verifiable/presentation.go#L179-L221
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.
@troyronda things would have been simpler ([]string) if it is just for stored VCs. During selective disclosure, derived VCs aren't saved and we can not generate presentation unless we save it. But we cannot save them since it might replace the original VC (due to same id
property)
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.
fixed, added variadic args for passing different kind of credential arguments.
- added prove interface based on universal wallet prove interface (https://w3c-ccg.github.io/universal-wallet-interop-spec/#prove). - support for both stored and raw credential arguments. - Closes hyperledger-archives#2680 Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
e582a7b
to
35bc293
Compare
} | ||
|
||
// WithRawCredentials option for providing raw credential for wallet to prove. | ||
func WithRawCredentials(raw ...json.RawMessage) CredentialToProve { |
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.
We might want to refactor this name.
} | ||
|
||
for _, raw := range opts.rawCredentials { | ||
credential, err := verifiable.ParseCredential(raw, verifiable.WithDisabledProofCheck()) |
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.
need comments on why proof checks are disabled.
- added prove interface based on universal wallet prove interface (https://w3c-ccg.github.io/universal-wallet-interop-spec/#prove). - support for both stored and raw credential arguments. - Closes hyperledger-archives#2680 Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
- added prove interface based on universal wallet prove interface (https://w3c-ccg.github.io/universal-wallet-interop-spec/#prove). - support for both stored and raw credential arguments. - Closes hyperledger-archives#2680 Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
(https://w3c-ccg.github.io/universal-wallet-interop-spec/#prove).
Signed-off-by: sudesh.shetty sudesh.shetty@securekey.com