generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 54
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
adding credentials package to web5-js #175
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nitro-neal
requested review from
frankhinek,
csuwildcat and
mistermoe
as code owners
August 22, 2023 21:10
Codecov Report
@@ Coverage Diff @@
## main #175 +/- ##
==========================================
+ Coverage 89.42% 89.53% +0.11%
==========================================
Files 64 67 +3
Lines 12399 12828 +429
Branches 1188 1238 +50
==========================================
+ Hits 11088 11486 +398
- Misses 1291 1319 +28
- Partials 20 23 +3
|
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
frankhinek
previously requested changes
Aug 23, 2023
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.
Notes:
- Switched to using
Convert
utility from the@web5/common
package instead ofEncoder
from@tbd54566975/dwn-sdk-js
. - A devDependency on
@tbd54566975/dwn-sdk-js
was added to the PresentationExchange test but not added topackage.json
. Doesn't need to be fixed since it was swapped forConvert
but something to keep an eye on.
And a a few minor changes:
- Added comments to the newly added utility functions. @nitro-neal double-check that the explanations and usage examples are accurate.
- Used exact dependency version for
@sphereon/pex
. - Updated formatting, word wrap, and code style to match SDK conventions.
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
mistermoe
approved these changes
Sep 12, 2023
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.
🎖️ 💯 🍖 🌞
andorsk
pushed a commit
to modernfoundry/web5-js
that referenced
this pull request
Sep 28, 2023
* adding credentials package to web5-js * Minor formatting and code style adjustments Signed-off-by: Frank Hinek <[email protected]> * Add comments to utility functions Signed-off-by: Frank Hinek <[email protected]> * Add EdDSA alg to JWS header parameters type Signed-off-by: Frank Hinek <[email protected]> * Pin @sphereon/pex version Signed-off-by: Frank Hinek <[email protected]> * Use Convert from @web5/common and fix type issues Signed-off-by: Frank Hinek <[email protected]> * Add named export for utils Signed-off-by: Frank Hinek <[email protected]> * Rewrite the PresentationExchange test to not rely on the 'agent' package Signed-off-by: Frank Hinek <[email protected]> * updating with credentials ssi package * update package-lock * adding full vc and vp impl * adding more tests * updating tests and renaming VC and VP * adding validator tests * fix pex state issues * more tests --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: Frank Hinek <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Integrate
pex
SSI objects within thecredentials
package of web5 and provide an SSI SDKThe
types.ts
file in the credential package exports web5 objects as wrapped pex objectsThis allows users to only need to import web5 and not pex, and we can add abstractions around pex lib as needed.
Credentials
VerifiableCredential Creation and Verification
The
VerifiableCredential
class provides methods for the creation, handling, and signing of Verifiable Credentials (VCs) in JWT format.VP Creation and Verification
The
VerifiablePresentation
class provides utility methods for creation and handling Verifiable Presentations (VPs) in JWT format.Presentation Exchange Helpers
These methods assist in evaluating verifiable credentials and presentations against specified presentation definitions.
Verifiable Credentials and Presentations Library
Note: you do not have to use the functions to create SSI objects, you can instead create them yourselves with the boilerplate types in types.ts
Signer Options Object
The
Signer
represents a function that takes a byte array as input and returns a promise that resolves to a byte array, representing the signature of the input data.Type Definition
This change also allows a full PE by users using boilerplate ssi objects. A full Presentation Exchange is available as a new unit test
presentationexchange.spec.ts