Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

feat: vc wallet prove interface #2681

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

sudeshrshetty
Copy link
Contributor

Signed-off-by: sudesh.shetty sudesh.shetty@securekey.com

@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #2681 (580de1b) into main (ad29113) will increase coverage by 0.01%.
The diff coverage is 94.87%.

❗ Current head 580de1b differs from pull request most recent head 35bc293. Consider uploading reports for the commit 35bc293 to get more accurate results
Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
pkg/wallet/wallet.go 96.64% <94.28%> (-0.60%) ⬇️
pkg/client/vcwallet/client.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad29113...35bc293. Read the comment docs.

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) {
Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor Author

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)

Copy link
Contributor Author

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>
}

// WithRawCredentials option for providing raw credential for wallet to prove.
func WithRawCredentials(raw ...json.RawMessage) CredentialToProve {
Copy link
Contributor

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())
Copy link
Contributor

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.

@troyronda troyronda merged commit a5b4943 into hyperledger-archives:main Mar 25, 2021
sudeshrshetty added a commit to sudeshrshetty/aries-framework-go that referenced this pull request Oct 18, 2021
- 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>
sudeshrshetty added a commit to sudeshrshetty/aries-framework-go that referenced this pull request Jan 22, 2022
- 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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

vc wallet: prove
3 participants