Skip to content

Commit

Permalink
set did:web document vm ids to absolute did uri (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistermoe authored May 14, 2024
1 parent ac63881 commit 78aa51c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dids/didweb/didweb.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func Create(domain string, opts ...CreateOption) (_did.BearerDID, error) {
}

vm := didcore.VerificationMethod{
ID: "#" + strconv.Itoa(idx),
ID: did.URI + "#" + strconv.Itoa(idx),
Type: "JsonWebKey",
Controller: did.URI,
PublicKeyJwk: &publicKeyJWK,
Expand Down
3 changes: 3 additions & 0 deletions dids/didweb/didweb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func TestCreate_WithOptions(t *testing.T) {
assert.Equal(t, "did:example:123", document.AlsoKnownAs[0])
assert.Equal(t, "did:example:123", document.Controller[0])

assert.Equal(t, 1, len(document.VerificationMethod))
assert.Contains(t, document.VerificationMethod[0].ID, document.ID)

}

func TestTransformID(t *testing.T) {
Expand Down

0 comments on commit 78aa51c

Please sign in to comment.