Skip to content
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

load a VC into a wallet via the internal API #2643

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

woutslakhorst
Copy link
Member

closes #2642

primary use case is to load a VC into the wallet when issued to a web:did.

description: |
If a VerifiableCredential is obtained in another way or when it's created without publishing, this API allows to add it to a wallet.
The DID of the holder has to be provided in the path.
It's assumed that the credentialSubject.id equals the holder DID.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if it doesn't? Do we still load it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, yes. I think the internal wallet API needs to change. Instead of calling Wallet() on the VCR, it needs to be Wallet(holderDID) because not all VC.credentialSubject.ID needs to equal the holder DID theoretically.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or add a wallet DID to the funcs (Put(ctx, walletDID, credential)). Our dependency injection style makes it cumbersome to have non-multi-tenant interfaces (see OpenID handlers)


error returns:
* 400 - Invalid credential
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or holder DID not managed by this node?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current wallet does not group credentials by wallet. If you add a VC that is not owned, then you'll never be able to use it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does group them (on a shelf, identified by the credential subject DID), but without ownership check. So probably OK (we can always add the check later)

Copy link
Member

@reinkrul reinkrul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

@woutslakhorst woutslakhorst merged commit 9913b5a into master Dec 5, 2023
6 checks passed
@woutslakhorst woutslakhorst deleted the feature/2642/vc_load_api branch December 5, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add API to load VC into wallet
2 participants