Skip to content

Commit

Permalink
fix: use websocket in did document
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Aug 30, 2023
1 parent 1b4a326 commit cce4f8e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@types/node-fetch": "^2.6.4",
"dotenv": "^16.0.1",
"jest": "^29.2.2",
"ngrok": "^4.3.1",
"ngrok": "^5.0.0-beta.2",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
Expand Down
7 changes: 3 additions & 4 deletions src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function createModules() {

async function createAndImportDid(agent: MediatorAgent) {
const httpEndpoint = agent.config.endpoints.find((e) => e.startsWith('http')) as string
const wsEndpoint = agent.config.endpoints.find((e) => e.startsWith('ws')) as string
const domain = httpEndpoint.replace(/^https?:\/\//, '')
const did = `did:web:${domain}`

Expand Down Expand Up @@ -98,7 +99,7 @@ async function createAndImportDid(agent: MediatorAgent) {
service: [
new DidCommV1Service({
id: `did:web:${domain}#animo-mediator`,
serviceEndpoint: httpEndpoint,
serviceEndpoint: wsEndpoint,
recipientKeys: [verificationMethod.id],
}),
],
Expand Down Expand Up @@ -156,9 +157,7 @@ export async function createAgent() {
didCommMimeType: DidCommMimeType.V0,
},
dependencies: agentDependencies,
modules: {
...createModules(),
},
modules: createModules(),
})

// Create all transports
Expand Down
24 changes: 9 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1029,11 +1029,6 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.46.tgz#9f2102d0ba74a318fcbe170cbff5463f119eab59"
integrity sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==

"@types/node@^8.10.50":
version "8.10.66"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.66.tgz#dd035d409df322acc83dff62a602f12a5783bbb3"
integrity sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==

"@types/qs@*":
version "6.9.7"
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb"
Expand Down Expand Up @@ -3202,17 +3197,16 @@ next-tick@^1.1.0:
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb"
integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==

ngrok@^4.3.1:
version "4.3.3"
resolved "https://registry.yarnpkg.com/ngrok/-/ngrok-4.3.3.tgz#c51a1c4af2271ac3c9092ede3b0975caf7833217"
integrity sha512-a2KApnkiG5urRxBPdDf76nNBQTnNNWXU0nXw0SsqsPI+Kmt2lGf9TdVYpYrHMnC+T9KhcNSWjCpWqBgC6QcFvw==
ngrok@^5.0.0-beta.2:
version "5.0.0-beta.2"
resolved "https://registry.yarnpkg.com/ngrok/-/ngrok-5.0.0-beta.2.tgz#7976690a592b27de9a91ff93892cfabda24360ad"
integrity sha512-UzsyGiJ4yTTQLCQD11k1DQaMwq2/SsztBg2b34zAqcyjS25qjDpogMKPaCKHwe/APRTHeel3iDXcVctk5CNaCQ==
dependencies:
"@types/node" "^8.10.50"
extract-zip "^2.0.1"
got "^11.8.5"
lodash.clonedeep "^4.5.0"
uuid "^7.0.0 || ^8.0.0"
yaml "^1.10.0"
yaml "^2.2.2"
optionalDependencies:
hpagent "^0.1.2"

Expand Down Expand Up @@ -4184,10 +4178,10 @@ yallist@^4.0.0:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==

yaml@^1.10.0:
version "1.10.2"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
yaml@^2.2.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.2.tgz#f522db4313c671a0ca963a75670f1c12ea909144"
integrity sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==

yargs-parser@^21.0.1, yargs-parser@^21.1.1:
version "21.1.1"
Expand Down

0 comments on commit cce4f8e

Please sign in to comment.