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

Get Key from a DID's Verification Information #342

Merged
merged 4 commits into from
Apr 7, 2023
Merged

Conversation

decentralgabe
Copy link
Member

  • Already existed in a lesser from in the service, this will be uptaken there

did/util.go Outdated

for _, method := range verificationMethods {
methodID := method.ID
maybeKID1 := kid // the kid == the kid
Copy link
Contributor

Choose a reason for hiding this comment

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

a helper function may make these look nicer

Copy link
Member Author

Choose a reason for hiding this comment

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

added

did/util.go Outdated
// resolution will fail.
// A KID can be fully qualified (e.g. did:example:123#key-1) or just the fragment (e.g. key-1, #key-1)
// Some DIDs, like did:key, use the entire DID as the KID, so we need to handle all three cases.
func GetKeyFromVerificationInformation(did Document, kid string) (gocrypto.PublicKey, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Very cool, much needed!

@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2023

Codecov Report

Merging #342 (96fb379) into main (08475b4) will increase coverage by 0.16%.
The diff coverage is 66.23%.

❗ Current head 96fb379 differs from pull request most recent head 365f0e1. Consider uploading reports for the commit 365f0e1 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #342      +/-   ##
==========================================
+ Coverage   57.32%   57.48%   +0.16%     
==========================================
  Files          51       51              
  Lines        6232     6298      +66     
==========================================
+ Hits         3572     3620      +48     
- Misses       1983     1998      +15     
- Partials      677      680       +3     
Impacted Files Coverage Δ
did/model.go 89.29% <ø> (ø)
did/util.go 61.01% <65.33%> (+8.32%) ⬆️
did/key.go 72.87% <100.00%> (ø)

@decentralgabe decentralgabe merged commit 7a28bcc into main Apr 7, 2023
@decentralgabe decentralgabe deleted the get-key-from-did branch April 7, 2023 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants