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

Scaffold web5.vc #116

Merged
merged 16 commits into from
Jun 12, 2023
Merged

Scaffold web5.vc #116

merged 16 commits into from
Jun 12, 2023

Conversation

mistermoe
Copy link
Contributor

This PR introduces the following:

  • scaffolding for web5.vc. It doesn't include any actual functionality. just a tee up
  • an independent vcs package where we can put decoupled functionality specific to verifiable credentials. Thinking about renaming this package to credentials

Open questions / TODOs:

  • need to implement a CryptoAlgorithm interface that is implemented for each crypto algorithm we intend to support (e.g. secp256k1, ed25519), though @frankhinek may be covering this with his KeyManager & encryption work.
  • need to decide where jw* functionality will live.
    • in vcs package?
    • in crypto package? a mixture of both? (JWK stuff in crypto package, JWT stuff in vcs package)
    • in a separate jose package?

@mistermoe
Copy link
Contributor Author

cc: @frankhinek @nitro-neal

@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Merging #116 (eba1b2d) into main (6d380d9) will decrease coverage by 15.61%.
The diff coverage is 18.36%.

@@             Coverage Diff             @@
##             main     #116       +/-   ##
===========================================
- Coverage   66.05%   50.45%   -15.61%     
===========================================
  Files          31       33        +2     
  Lines        3456     3554       +98     
  Branches      195       86      -109     
===========================================
- Hits         2283     1793      -490     
- Misses       1171     1761      +590     
+ Partials        2        0        -2     
Components Coverage Δ
crypto 0.00% <ø> (ø)
dids 48.61% <ø> (ø)
web5 42.56% <94.73%> (-38.77%) ⬇️
web5-agent 0.00% <ø> (ø)
web5-proxy-agent 0.00% <ø> (ø)
web5-user-agent 79.63% <ø> (ø)

@@ -68,6 +70,7 @@ export class Web5 {
private constructor(options: Web5Options) {
this.#connectedDid = options.connectedDid;
this.dwn = new DwnApi(options.web5Agent, this.#connectedDid);
this.vc = new VcApi(options.web5Agent, this.#connectedDid);
Copy link
Contributor

@nitro-neal nitro-neal Jun 8, 2023

Choose a reason for hiding this comment

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

this.#connectedDid gives the private key information right?
If I read this correct it gives the JWK and the algo which is what we will need for signing.

Copy link
Contributor

@nitro-neal nitro-neal left a comment

Choose a reason for hiding this comment

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

Awesome! 🔥

@mistermoe mistermoe marked this pull request as ready for review June 8, 2023 15:28
@frankhinek
Copy link
Contributor

frankhinek commented Jun 8, 2023

Supportive of renaming the package to credentials...

  • As we've encountered ourselves there are not a lot of great TS/JS packages out there for verifiable credentials, particularly those that support VC data model 2.0.
  • It would be great if developers could import @tbd54566975/credentials even if they aren't yet adopting all of Web5.
  • vcs as a standalone package is a little too cryptic of an acronym.

@mistermoe CryptoAlgorithm and KeyManager are both part of the crypto package work I hope to share by the end of this week, so hopefully, once we align on that design, it'll cover needs across the dids and credentials packages (and of course rest of Web5 JS).

The question on where to put JOSE related capabilities is one that seems less clear, at least IMHO. Perhaps we ought to sketch out what would be in category if we exclude all things cryptography and credential related? Based on what's left we see how much it is and if its easier to then categorize it as mostly credential related, mostly crypto related, or is worthy of a package of its own. If you look at the JOSE registries it appears quite a lot of it might end up being crypto related but worth exploring: https://www.iana.org/assignments/jose/jose.xhtml.

packages/credentials/package.json Outdated Show resolved Hide resolved
packages/credentials/package.json Outdated Show resolved Hide resolved
packages/credentials/package.json Outdated Show resolved Hide resolved
packages/credentials/karma.conf.cjs Show resolved Hide resolved
packages/credentials/karma.conf.cjs Show resolved Hide resolved
packages/credentials/src/types.ts Outdated Show resolved Hide resolved
packages/credentials/src/types.ts Outdated Show resolved Hide resolved
packages/credentials/src/types.ts Outdated Show resolved Hide resolved
packages/credentials/src/types.ts Outdated Show resolved Hide resolved
packages/credentials/tests/example.spec.ts Show resolved Hide resolved
@mistermoe mistermoe merged commit 7031fd4 into main Jun 12, 2023
@frankhinek frankhinek added the enhancement New feature or request label Jun 12, 2023
@frankhinek frankhinek deleted the vcs branch June 15, 2023 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants