-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: request verifiable presentation from user (#509) #765
Conversation
48cbdd9
to
29d4676
Compare
@AndrewCLu Since I have been working on the documentation part, I noticed that we have already two functions published in the provider which are:
My worry is to not confuse developers by having non production ready functions in the client. I am thinking of adding a flag inside the provider to distinguish the development features from the others. This is the idea I got but you can thinking of a better way: export class CryptKeeperInjectedProvider {
const IS_UNDER_DEVELOPMENT = true;
/**
* Requests user to add a verifiable credential.
* NOTE: THIS FUNCTION IS UNDER DEVELOPMENT AND NOT READY FOR PRODUCTION USE
*
* @param {string} serializedVerifiableCredential - The json string representation of the verifiable credential to add.
* @returns {void}
*/
async addVerifiableCredentialRequest(serializedVerifiableCredential: string): Promise<void> {
if (IS_UNDER_DEVELOPMENT) {
console.warn('This function is under development and not ready for production use.');
return;
}
// ...
}
} We can maybe add _ prefix before the function name. 🤔 |
29d4676
to
c07ede1
Compare
@0xisk @0xmad So right now the I was thinking that perhaps it isn't necessary to enforce the feature flag at the sdk level, if we do the check in the browser extension anyways. I just renamed the sdk functions with the prefix Also updated the PR with screenshots based on the new UI. |
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.
@AndrewCLu thanks, there are some comments.
In addition there is some code which isn't covered with unit tests. It's related to all layers (ui, background, ducks and etc).
packages/app/src/ui/components/VerifiableCredential/Item/VerifiableCredentialItem.tsx
Outdated
Show resolved
Hide resolved
packages/app/src/ui/components/VerifiableCredential/Item/VerifiableCredentialItem.tsx
Outdated
Show resolved
Hide resolved
packages/app/src/ui/pages/PresentVerifiableCredential/usePresentVerifiableCredential.ts
Outdated
Show resolved
Hide resolved
packages/app/src/ui/pages/PresentVerifiableCredential/usePresentVerifiableCredential.ts
Outdated
Show resolved
Hide resolved
packages/app/src/ui/pages/PresentVerifiableCredential/usePresentVerifiableCredential.ts
Outdated
Show resolved
Hide resolved
@0xmad Thanks for the feedback!
|
c07ede1
to
a10ce3e
Compare
@AndrewCLu thanks, there are still some issues:
|
a10ce3e
to
dab5a69
Compare
@0xmad Thanks again for the feedback, I made some changes:
|
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.
Thanks @AndrewCLu, I had my review and left my thoughts and requested changes in this PR #867
- Another point:
Thinking of the PCD idea, why do not we start having a generic interface for defining what are the components of a VC? You can take a look at this package (https://github.com/proofcarryingdata/zupass/blob/main/packages/pcd-types/src/pcd.ts) to get the idea. More preciselyPCD
andPCDPackage
abad2b7
to
5bdd3de
Compare
@0xmad I updated the styling so that the buttons are now at the bottom. See the new screenshots for reference. @0xisk I agree with all of your comments and changes in #867, but I think its possible for me to separate them into a new PR distinct from this one, since this is centered around verifiable presentations. Perhaps I can combine it with adding comments to all the functions. |
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.
@AndrewCLu thanks, just some minor comments.
packages/app/src/ui/pages/PresentVerifiableCredential/PresentVerifiableCredential.tsx
Show resolved
Hide resolved
packages/app/src/ui/pages/PresentVerifiableCredential/usePresentVerifiableCredential.ts
Outdated
Show resolved
Hide resolved
packages/app/src/ui/pages/PresentVerifiableCredential/usePresentVerifiableCredential.ts
Outdated
Show resolved
Hide resolved
packages/app/src/ui/pages/PresentVerifiableCredential/PresentVerifiableCredential.tsx
Show resolved
Hide resolved
@AndrewCLu regarding the test coverage: there are some missing tests for |
@AndrewCLu I agree with you I created a PR for this #876 |
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.
Thanks @AndrewCLu I can approve from my end, just please finishing fixing the other requested changes from Anton.
…e, use dropdown menu (#509)
5bdd3de
to
52d9da3
Compare
@0xmad Addressed your comments, only caveat is I will include the browser push changes in my refactor PR since I will be modify all the event related code there anyways. With regard to test coverage, I just updated all the tests with regards to verifiable presentations ( |
@AndrewCLu ok, I'm good with fixing these changes in refactoring 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.
@AndrewCLu thanks!
Explanation
This change implements Verifiable Presentations, a way for users to present Verifiable Credentials to verifiers in an authentic way. The lifecycle is as follows:
More Information
See this change for reference on integration with displaying Verifiable Credentials.
Screenshots/Screencaps
View a request for Verifiable Credentials and select ones you want to share:
Choose to either sign a Verifiable Presentation or send it in the clear:
View a Verifiable Presentation request in full page window:
Sign your Verifiable Presentation with metamask:
Manual Testing Steps
Pre-Merge Checklist