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

Fixed DID DHT library regression where kid becomes undefined #575

Merged
merged 3 commits into from
May 16, 2024

Conversation

thehenrytsai
Copy link
Contributor

  1. Fixed DID DHT library regression where kid becomes undefined
  2. Added tests to prevent this from happening again in vector tests.

Copy link

changeset-bot bot commented May 16, 2024

🦋 Changeset detected

Latest commit: 49a931e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@web5/dids Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

dnsPacket : dnsPacket
});

expect(didResolutionResult.didDocument).to.deep.equal(inputDidDocument);
Copy link
Contributor

Choose a reason for hiding this comment

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

good call

@@ -1038,13 +1038,14 @@ export class DidDhtDocument {
publicKey.alg = parsedAlg || KeyTypeToDefaultAlgorithmMap[Number(t) as DidDhtRegisteredKeyType];

// Determine the Key ID (kid): '0' for the identity key or JWK thumbprint for others.
publicKey.kid = dnsRecordId.endsWith('0') ? '0' : await computeJwkThumbprint({ jwk: publicKey });
const kid = dnsRecordId.endsWith('0') ? '0' : await computeJwkThumbprint({ jwk: publicKey });
publicKey.kid = kid;

// Initialize the `verificationMethod` array if it does not already exist.
didDocument.verificationMethod ??= [];

// Prepend the DID URI to the ID fragment to form the full verification method ID.
Copy link
Contributor

Choose a reason for hiding this comment

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

update comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What would you like me to update the comment to? I'll do it!

Copy link
Contributor

github-actions bot commented May 16, 2024

TBDocs Report

✅ No errors or warnings

@web5/api

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

@web5/crypto

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

@web5/crypto-aws-kms

  • Project entry file: packages/crypto-aws-kms/src/index.ts

@web5/dids

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

@web5/credentials

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

TBDocs Report Updated at 2024-05-16T18:18:25Z 49a931e

LiranCohen
LiranCohen previously approved these changes May 16, 2024
Copy link
Member

@LiranCohen LiranCohen left a comment

Choose a reason for hiding this comment

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

🎸

packages/dids/src/methods/did-dht.ts Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.12%. Comparing base (eef9396) to head (49a931e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #575      +/-   ##
==========================================
+ Coverage   91.10%   91.12%   +0.02%     
==========================================
  Files         116      116              
  Lines       29664    29665       +1     
  Branches     2199     2200       +1     
==========================================
+ Hits        27024    27033       +9     
+ Misses       2605     2597       -8     
  Partials       35       35              
Components Coverage Δ
agent 80.86% <ø> (ø)
api 97.93% <ø> (+0.15%) ⬆️
common 98.68% <ø> (ø)
credentials 95.26% <ø> (ø)
crypto 93.81% <ø> (ø)
dids 97.78% <100.00%> (+0.08%) ⬆️
identity-agent 96.70% <ø> (ø)
crypto-aws-kms 100.00% <ø> (ø)
proxy-agent 96.70% <ø> (ø)
user-agent 96.70% <ø> (ø)

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.

👍

@thehenrytsai thehenrytsai merged commit 98eeb4c into main May 16, 2024
11 checks passed
@thehenrytsai thehenrytsai deleted the henrytsai/did-dht-regression branch May 16, 2024 18:45
This was referenced May 16, 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