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

resolve did:dht in VCs #321

Merged
merged 2 commits into from
Nov 29, 2023
Merged

resolve did:dht in VCs #321

merged 2 commits into from
Nov 29, 2023

Conversation

phoebe-lew
Copy link
Contributor

Tested via:

    it('verify does not throw an exception with vaild vc signed by did:dht', async () => {
      const alice = await DidDhtMethod.create({publish: true});
      const sleep = (time: any) => new Promise(resolve => setTimeout(resolve, time));
      await sleep(10_000);
      const [signingKeyPair] = alice.keySet.verificationMethodKeys!;
      const privateKey = (await Jose.jwkToKey({ key: signingKeyPair.privateKeyJwk!})).keyMaterial;
      signer = EdDsaSigner(privateKey);
      signOptions = {
        issuerDid  : alice.did,
        subjectDid : alice.did,
        kid        : alice.did + '#' + alice.did.split(':')[2],
        signer     : signer
      };

      const vc = VerifiableCredential.create({
        type    : 'StreetCred',
        issuer  : signOptions.issuerDid,
        subject : signOptions.subjectDid,
        data    : new StreetCredibility('high', true),
      });

      const vcJwt = await vc.sign(signOptions);

      console.log('signed');

      await VerifiableCredential.verify(vcJwt);

    }).timeout(20_000);
    ```
    
    But not merging due to the long timeout

Copy link

codesandbox bot commented Nov 29, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Contributor

TBDocs Report

✅ No errors or warnings

@web5/api

  • Project entry file: packages/api/src/index.ts

Updated @ 2023-11-29T00:33:51.834Z - Commit: 703f01c

Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Merging #321 (fc6bf3c) into main (34b915d) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
- Coverage   91.77%   91.75%   -0.02%     
==========================================
  Files          73       73              
  Lines       15758    15758              
  Branches     1448     1448              
==========================================
- Hits        14462    14459       -3     
- Misses       1270     1273       +3     
  Partials       26       26              
Components Coverage Δ
api 96.46% <ø> (-0.23%) ⬇️
common 95.00% <ø> (ø)
credentials 94.32% <100.00%> (ø)
crypto 100.00% <ø> (ø)
dids 88.75% <ø> (ø)
agent 88.07% <ø> (ø)
identity-agent 56.81% <ø> (ø)
proxy-agent 58.43% <ø> (ø)
user-agent 55.22% <ø> (ø)

@phoebe-lew
Copy link
Contributor Author

@decentralgabe what should use mocks? the test?

@decentralgabe
Copy link
Member

decentralgabe commented Nov 29, 2023

@phoebe-lew sorry disregard, looks good to me 😄

@phoebe-lew phoebe-lew merged commit 7828b69 into main Nov 29, 2023
29 of 30 checks passed
@phoebe-lew phoebe-lew deleted the plew.vc-resolve-dht branch November 29, 2023 10:31
finn-block pushed a commit that referenced this pull request Mar 19, 2024
finn-block pushed a commit that referenced this pull request Mar 19, 2024
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.

4 participants