Skip to content

Commit 5e537dc

Browse files
authored
feat(deps): bump peer-did-resolver to 2.0.0 and add test (#121)
fixes #119 BREAKING CHANGE: The resolution of did:peer:2 identifiers now yields documents that use `Multikey` as the verification method `type`
1 parent 32cd2b0 commit 5e537dc

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"ethr-did-resolver": "^10.0.0",
3434
"express": "^4.18.2",
3535
"express-actuator": "^1.8.4",
36-
"peer-did-resolver": "^1.0.1",
36+
"peer-did-resolver": "^2.0.0",
3737
"plc-did-resolver": "^1.0.0",
3838
"web-did-resolver": "^2.0.27"
3939
},

src/__tests__/peer.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ describe('did:peer driver', () => {
1616
})
1717
})
1818

19+
it('responds with didResolutionResult for "did:peer:2 with 2 service endpoints (github #119)', async () => {
20+
expect.assertions(6)
21+
const did =
22+
'did:peer:2.Vz6Mkj3PUd1WjvaDhNZhhhXQdz5UnZXmS7ehtx8bsPpD47kKc.Ez6LSg8zQom395jKLrGiBNruB9MM6V8PWuf2FpEy4uRFiqQBR.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly9leGFtcGxlLmNvbS9kaWRjb21tIiwiYSI6WyJkaWRjb21tL3YyIl0sInIiOlsiZGlkOmV4YW1wbGU6MTIzNDU2Nzg5YWJjZGVmZ2hpI2tleS0xIl19fQ.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly9leGFtcGxlLmNvbS9hbm90aGVyIiwiYSI6WyJkaWRjb21tL3YyIl0sInIiOlsiZGlkOmV4YW1wbGU6MTIzNDU2Nzg5YWJjZGVmZ2hpI2tleS0yIl19fQ\n'
23+
const response = await request(app).get(`/1.0/identifiers/${did}`)
24+
expect(response.status).toBe(200)
25+
expect(response.body).toHaveProperty('didDocument')
26+
expect(response.body.didDocument).toHaveProperty('authentication')
27+
expect(response.body.didDocument.service).toHaveLength(2)
28+
expect(response.body).toHaveProperty('didDocumentMetadata')
29+
expect(response.body.didResolutionMetadata).toEqual({
30+
contentType: 'application/did+ld+json',
31+
})
32+
})
33+
1934
it('responds with notFound error for unknown DID', async () => {
2035
// expect.assertions(1)
2136
const did = 'did:peer:fakefakefake'

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"@jridgewell/gen-mapping" "^0.1.0"
1616
"@jridgewell/trace-mapping" "^0.3.9"
1717

18-
"@aviarytech/did-peer@^0.0.19":
19-
version "0.0.19"
20-
resolved "https://registry.yarnpkg.com/@aviarytech/did-peer/-/did-peer-0.0.19.tgz#5ac20d37d762f05be7a502826cb0fbb6cd319180"
21-
integrity sha512-koSwVi++RIVWgYoNHHFZ95ouVqCNlLvqDfJfThOwExkZ2YSoRW/EFXeXFe33Gm7wR9gwTgoZXgi71hHO9d5RVQ==
18+
"@aviarytech/did-peer@^0.0.22":
19+
version "0.0.22"
20+
resolved "https://registry.yarnpkg.com/@aviarytech/did-peer/-/did-peer-0.0.22.tgz#d0c15062c37fc6bf2720d31dbbf9eb23e09c2435"
21+
integrity sha512-BdA7L9wpYNLf1c3d0yB92aoj1AUWE10p408VZ4IJXfavb/oNxALZRRRJTcvMdrd5P2XXQsP5+x4bXfO24iRURg==
2222
dependencies:
2323
buffer "^6.0.3"
2424

@@ -4798,13 +4798,13 @@ path-type@^5.0.0:
47984798
resolved "https://registry.yarnpkg.com/path-type/-/path-type-5.0.0.tgz#14b01ed7aea7ddf9c7c3f46181d4d04f9c785bb8"
47994799
integrity sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==
48004800

4801-
peer-did-resolver@^1.0.1:
4802-
version "1.0.1"
4803-
resolved "https://registry.yarnpkg.com/peer-did-resolver/-/peer-did-resolver-1.0.1.tgz#15d5d490af6b8d595168a3d071385acbb54c542a"
4804-
integrity sha512-nbc8Y1L6IDqBTgWYx2OvIYJOjHAokdnVW2WzzYPaeIHM9YI6ovMGTbBct7nSLsbg/hBHc/w+tsvsn6kAcIxStQ==
4801+
peer-did-resolver@^2.0.0:
4802+
version "2.0.0"
4803+
resolved "https://registry.yarnpkg.com/peer-did-resolver/-/peer-did-resolver-2.0.0.tgz#81af5824a866c32e2600098a4125f833126001a1"
4804+
integrity sha512-4x6bv3fqEhGFJZI33S0pKLOYgE5Qynk5YLyZ+F828Nz1G4EnJuJBcz8uKaXqYhagVvAFD9Xd1dqtXlkyh2sNoA==
48054805
dependencies:
4806-
"@aviarytech/did-peer" "^0.0.19"
4807-
did-resolver "^4.0.0"
4806+
"@aviarytech/did-peer" "^0.0.22"
4807+
did-resolver "^4.1.0"
48084808

48094809
picocolors@^1.0.0:
48104810
version "1.0.0"

0 commit comments

Comments
 (0)