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

Refactoring credentials api interface #255

Merged
merged 10 commits into from
Nov 6, 2023
Merged

Refactoring credentials api interface #255

merged 10 commits into from
Nov 6, 2023

Conversation

nitro-neal
Copy link
Contributor

@nitro-neal nitro-neal commented Nov 2, 2023

This change brings the web5-js credentials package more in line with the web5-kt credentials package api interface.

This simplifies the creation of VCs and moves signing into a separate function call:

const vc = VerifiableCredential.create("ExampleCredential", "did:issuer", "did:subject", myData)
const signedVc = vc.sign(signOptions)

This also moves Presentation Exchange into its own object to do anything with Presentation Exchange:

const presentationResult = PresentationExchange.createPresentationFromCredentials(vcJwts, presentationDefinition)

Copy link

codesandbox bot commented Nov 2, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Merging #255 (cc45dca) into main (29860a4) will increase coverage by 0.08%.
The diff coverage is 93.92%.

@@            Coverage Diff             @@
##             main     #255      +/-   ##
==========================================
+ Coverage   90.60%   90.69%   +0.08%     
==========================================
  Files          69       70       +1     
  Lines       13552    13679     +127     
  Branches     1332     1343      +11     
==========================================
+ Hits        12279    12406     +127     
  Misses       1247     1247              
  Partials       26       26              
Components Coverage Δ
api 95.30% <ø> (ø)
common 95.00% <ø> (ø)
credentials 94.42% <93.92%> (+1.65%) ⬆️
crypto 100.00% <ø> (ø)
dids 88.75% <ø> (ø)
agent 88.17% <ø> (ø)
identity-agent 59.05% <ø> (ø)
proxy-agent 58.59% <ø> (ø)
user-agent 57.36% <ø> (ø)

@frankhinek
Copy link
Contributor

Pending feedback from @andresuribe87 / @mistermoe / @nitro-neal

Copy link
Contributor

github-actions bot commented Nov 6, 2023

TBDocs Report

🛑 Errors: 0
⚠️ Warnings: 23

@web5/api

  • Project entry file: packages/api/src/index.ts
📄 File: node_modules/abstract-level/types/abstract-level.d.ts
⚠️ compiler:TS2304: Cannot find name 'this'. #L143
⚠️ compiler:TS2304: Cannot find name 'this'. #L173
⚠️ compiler:TS2304: Cannot find name 'this'. #L187
⚠️ compiler:TS2304: Cannot find name 'this'. #L201
⚠️ compiler:TS2304: Cannot find name 'this'. #L218
📄 File: packages/api/src/did-api.ts
⚠️ extractor:ae-undocumented: Missing documentation for "agent". #L49
⚠️ extractor:ae-undocumented: Missing documentation for "connectedDid". #L50
📄 File: packages/api/src/dwn-api.ts
⚠️ extractor:ae-undocumented: Missing documentation for "agent". #L185
⚠️ extractor:ae-undocumented: Missing documentation for "connectedDid". #L186
📄 File: packages/api/src/protocol.ts
⚠️ extractor:ae-undocumented: Missing documentation for "_agent". #L30
⚠️ extractor:ae-undocumented: Missing documentation for "_metadata". #L31
⚠️ extractor:ae-undocumented: Missing documentation for "_protocolsConfigureMessage". #L32
📄 File: packages/api/src/record.ts
⚠️ extractor:ae-undocumented: Missing documentation for "_agent". #L76
⚠️ extractor:ae-undocumented: Missing documentation for "_attestation". #L77
⚠️ extractor:ae-undocumented: Missing documentation for "_contextId". #L78
⚠️ extractor:ae-undocumented: Missing documentation for "_descriptor". #L79
⚠️ extractor:ae-undocumented: Missing documentation for "_encodedData". #L80
⚠️ extractor:ae-undocumented: Missing documentation for "_encryption". #L81
⚠️ extractor:ae-undocumented: Missing documentation for "_readableStream". #L82
⚠️ extractor:ae-undocumented: Missing documentation for "_recordId". #L83
📄 File: packages/api/src/vc-api.ts
⚠️ extractor:ae-undocumented: Missing documentation for "agent". #L9
⚠️ extractor:ae-undocumented: Missing documentation for "connectedDid". #L10
📄 File: packages/api/src/web5.ts
⚠️ extractor:ae-undocumented: Missing documentation for "connectedDid". #L89

Updated @ 2023-11-06T17:52:38.508Z - Commit: 4382c19

Copy link
Contributor

@frankhinek frankhinek left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@nitro-neal nitro-neal merged commit a2758b9 into main Nov 6, 2023
23 of 24 checks passed
@frankhinek frankhinek deleted the credentials-refresh branch November 9, 2023 20:46
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.

2 participants