Skip to content

Commit

Permalink
Merge branch 'main' into feat/bump-indy-vdr-version
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoGlastra committed Nov 10, 2023
2 parents 3ea371d + d40bfd1 commit 873a2c7
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 84 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/eslint": "^8.21.2",
"@types/express": "^4.17.13",
"@types/jest": "^29.5.5",
"@types/node": "^16.11.7",
"@types/node": "^18.18.8",
"@types/uuid": "^9.0.1",
"@types/varint": "^6.0.0",
"@types/ws": "^8.5.4",
Expand Down Expand Up @@ -61,7 +61,7 @@
"ws": "^8.13.0"
},
"resolutions": {
"@types/node": "^16.11.7"
"@types/node": "18.18.8"
},
"engines": {
"node": ">=18"
Expand Down
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@stablelib/ed25519": "^1.0.2",
"@stablelib/random": "^1.0.1",
"@stablelib/sha256": "^1.0.1",
"@types/node-fetch": "2.6.2",
"@types/ws": "^8.5.4",
"abort-controller": "^3.0.0",
"big-integer": "^1.6.51",
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/agent/AgentDependencies.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { FileSystem } from '../storage/FileSystem'
import type { EventEmitter } from 'events'
import type fetch from 'node-fetch'
import type WebSocket from 'ws'

export interface AgentDependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class DidExchangeStateMachine {
}
if (rule.state !== record.state || rule.role !== record.role) {
throw new AriesFrameworkError(
`Record with role ${record.role} is in invalid state ${record.state} to process ${messageType}. Expected state for role ${rule.role} is ${rule.state}.`
`Record with role ${record.role} is in invalid state ${record.state} to process ${messageType.messageTypeUri}. Expected state for role ${rule.role} is ${rule.state}.`
)
}
}
Expand All @@ -80,7 +80,7 @@ export class DidExchangeStateMachine {
.find((r) => canHandleMessageType(r.message, messageType) && r.role === record.role)
if (!rule) {
throw new AriesFrameworkError(
`Could not find create message rule for messageType ${messageType}, state ${record.state} and role ${record.role}`
`Could not find create message rule for messageType ${messageType.messageTypeUri}, state ${record.state} and role ${record.role}`
)
}
return rule.nextState
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/transport/HttpOutboundTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { Agent } from '../agent/Agent'
import type { AgentMessageReceivedEvent } from '../agent/Events'
import type { Logger } from '../logger'
import type { OutboundPackage } from '../types'
import type fetch from 'node-fetch'

import { AbortController } from 'abort-controller'

Expand Down Expand Up @@ -53,7 +52,7 @@ export class HttpOutboundTransport implements OutboundTransport {
method: 'POST',
body: JSON.stringify(payload),
headers: { 'Content-Type': this.agent.config.didCommMimeType },
signal: abortController.signal,
signal: abortController.signal as NonNullable<RequestInit['signal']>,
})
clearTimeout(id)
responseMessage = await response.text()
Expand Down
14 changes: 4 additions & 10 deletions packages/core/src/utils/__tests__/shortenedUrl.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import type { Response } from 'node-fetch'

import { Headers } from 'node-fetch'

import { ConnectionInvitationMessage } from '../../modules/connections'
import { InvitationType, OutOfBandInvitation } from '../../modules/oob'
import { convertToNewInvitation } from '../../modules/oob/helpers'
Expand Down Expand Up @@ -51,7 +47,7 @@ const mockedResponseOobUrl = {
url: 'https://wonderful-rabbit-5.tun2.indiciotech.io?oob=eyJAdHlwZSI6ICJkaWQ6c292OkJ6Q2JzTlloTXJqSGlxWkRUVUFTSGc7c3BlYy9vdXQtb2YtYmFuZC8xLjAvaW52aXRhdGlvbiIsICJAaWQiOiAiNzY0YWYyNTktOGJiNC00NTQ2LWI5MWEtOTI0YzkxMmQwYmI4IiwgImxhYmVsIjogIkFsaWNlIiwgImhhbmRzaGFrZV9wcm90b2NvbHMiOiBbImRpZDpzb3Y6QnpDYnNOWWhNcmpIaXFaRFRVQVNIZztzcGVjL2Nvbm5lY3Rpb25zLzEuMCJdLCAic2VydmljZXMiOiBbImRpZDpzb3Y6TXZUcVZYQ0VtSjg3dXNMOXVRVG83diJdfQ====',
} as Response

mockedResponseOobUrl.headers = dummyHeader
dummyHeader.forEach(mockedResponseOobUrl.headers.append)

const mockedResponseConnectionJson = {
status: 200,
Expand All @@ -63,18 +59,16 @@ const mockedResponseConnectionJson = {
serviceEndpoint: 'http://sour-cow-15.tun1.indiciotech.io',
recipientKeys: ['5Gvpf9M4j7vWpHyeTyvBKbjYe7qWc72kGo6qZaLHkLrd'],
}),
headers: header,
} as Response

mockedResponseConnectionJson['headers'] = header

const mockedResponseConnectionUrl = {
status: 200,
ok: true,
url: 'http://sour-cow-15.tun1.indiciotech.io?c_i=eyJAdHlwZSI6ICJkaWQ6c292OkJ6Q2JzTlloTXJqSGlxWkRUVUFTSGc7c3BlYy9jb25uZWN0aW9ucy8xLjAvaW52aXRhdGlvbiIsICJAaWQiOiAiMjA5NzFlZjAtMTAyOS00NmRiLWEyNWItYWY0YzQ2NWRkMTZiIiwgImxhYmVsIjogInRlc3QiLCAic2VydmljZUVuZHBvaW50IjogImh0dHA6Ly9zb3VyLWNvdy0xNS50dW4xLmluZGljaW90ZWNoLmlvIiwgInJlY2lwaWVudEtleXMiOiBbIjVHdnBmOU00ajd2V3BIeWVUeXZCS2JqWWU3cVdjNzJrR282cVphTEhrTHJkIl19',
headers: dummyHeader,
} as Response

mockedResponseConnectionUrl['headers'] = dummyHeader

let outOfBandInvitationMock: OutOfBandInvitation
let connectionInvitationMock: ConnectionInvitationMessage
let connectionInvitationToNew: OutOfBandInvitation
Expand Down Expand Up @@ -126,7 +120,7 @@ describe('shortened urls resolving to connection invitations', () => {
url: 'https://oob.lissi.io/ssi?oob=eyJAdHlwZSI6ImRpZDpzb3Y6QnpDYnNOWWhNcmpIaXFaRFRVQVNIZztzcGVjL2Nvbm5lY3Rpb25zLzEuMC9pbnZpdGF0aW9uIiwiQGlkIjoiMGU0NmEzYWEtMzUyOC00OTIxLWJmYjItN2JjYjk0NjVjNjZjIiwibGFiZWwiOiJTdGFkdCB8IExpc3NpLURlbW8iLCJzZXJ2aWNlRW5kcG9pbnQiOiJodHRwczovL2RlbW8tYWdlbnQuaW5zdGl0dXRpb25hbC1hZ2VudC5saXNzaS5pZC9kaWRjb21tLyIsImltYWdlVXJsIjoiaHR0cHM6Ly9yb3V0aW5nLmxpc3NpLmlvL2FwaS9JbWFnZS9kZW1vTXVzdGVyaGF1c2VuIiwicmVjaXBpZW50S2V5cyI6WyJEZlcxbzM2ekxuczlVdGlDUGQyalIyS2pvcnRvZkNhcFNTWTdWR2N2WEF6aCJdfQ',
} as Response

mockedResponseConnectionInOobUrl.headers = dummyHeader
dummyHeader.forEach(mockedResponseConnectionInOobUrl.headers.append)

const expectedOobMessage = convertToNewInvitation(
JsonTransformer.fromJSON(
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/utils/parseInvitation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { AgentDependencies } from '../agent/AgentDependencies'
import type { Response } from 'node-fetch'

import { AbortController } from 'abort-controller'
import { parseUrl } from 'query-string'
Expand Down Expand Up @@ -90,7 +89,7 @@ export const parseInvitationUrl = (invitationUrl: string): OutOfBandInvitation =
export const oobInvitationFromShortUrl = async (response: Response): Promise<OutOfBandInvitation> => {
if (response) {
if (response.headers.get('Content-Type')?.startsWith('application/json') && response.ok) {
const invitationJson = await response.json()
const invitationJson = (await response.json()) as Record<string, unknown>
return parseInvitationJson(invitationJson)
} else if (response['url']) {
// The following if else is for here for trinsic shorten urls
Expand Down
5 changes: 1 addition & 4 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@
"@aries-framework/core": "0.4.2",
"@types/express": "^4.17.15",
"express": "^4.17.1",
"node-fetch": "^2.6.1",
"ws": "^8.13.0"
},
"devDependencies": {
"@types/node": "^16.11.7",
"@types/node-fetch": "2.6.2",
"@types/ref-napi": "^3.0.4",
"@types/node": "^18.18.8",
"@types/ws": "^8.5.4",
"nock": "^13.3.0",
"rimraf": "^4.4.0",
Expand Down
1 change: 0 additions & 1 deletion packages/node/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { AgentDependencies } from '@aries-framework/core'

import { EventEmitter } from 'events'
import fetch from 'node-fetch'
import WebSocket from 'ws'

import { NodeFileSystem } from './NodeFileSystem'
Expand Down
86 changes: 27 additions & 59 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1711,10 +1711,10 @@
write-pkg "4.0.0"
yargs "16.2.0"

"@mapbox/node-pre-gyp@1.0.9":
version "1.0.9"
resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz#09a8781a3a036151cdebbe8719d6f8b25d4058bc"
integrity sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==
"@mapbox/node-pre-gyp@1.0.11", "@mapbox/node-pre-gyp@^1.0.11":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa"
integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==
dependencies:
detect-libc "^2.0.0"
https-proxy-agent "^5.0.0"
Expand All @@ -1741,21 +1741,6 @@
semver "^7.3.5"
tar "^6.1.11"

"@mapbox/node-pre-gyp@^1.0.11":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa"
integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==
dependencies:
detect-libc "^2.0.0"
https-proxy-agent "^5.0.0"
make-dir "^3.1.0"
node-fetch "^2.6.7"
nopt "^5.0.0"
npmlog "^5.0.1"
rimraf "^3.0.2"
semver "^7.3.5"
tar "^6.1.11"

"@mattrglobal/bbs-signatures@1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@mattrglobal/bbs-signatures/-/bbs-signatures-1.0.0.tgz#8ff272c6d201aadab7e08bd84dbfd6e0d48ba12d"
Expand All @@ -1766,13 +1751,13 @@
"@mattrglobal/node-bbs-signatures" "0.13.0"

"@mattrglobal/bbs-signatures@^1.0.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@mattrglobal/bbs-signatures/-/bbs-signatures-1.1.0.tgz#031418c6a003d1782e3aff95995bda6a0605f9f1"
integrity sha512-uf74y3S7kAxL3FZrva6u+BF3VY3El5QI9IMkyBCoNoJvO+nWJewmTqLMLWEh6QJ1N5egZfDCI4PuS9ISrZJTZg==
version "1.3.1"
resolved "https://registry.yarnpkg.com/@mattrglobal/bbs-signatures/-/bbs-signatures-1.3.1.tgz#ed00b9c5bb5ea7fb4ca1dc6316a32d0618acc82e"
integrity sha512-syZGkapPpktD2el4lPTCQRw/LSia6/NwBS83hzCKu4dTlaJRO636qo5NCiiQb+iBYWyZQQEzN0jdRik8N9EUGA==
dependencies:
"@stablelib/random" "1.0.0"
optionalDependencies:
"@mattrglobal/node-bbs-signatures" "0.15.0"
"@mattrglobal/node-bbs-signatures" "0.18.1"

"@mattrglobal/bls12381-key-pair@^1.0.0":
version "1.0.0"
Expand All @@ -1791,12 +1776,12 @@
neon-cli "0.8.2"
node-pre-gyp "0.17.0"

"@mattrglobal/node-bbs-signatures@0.15.0":
version "0.15.0"
resolved "https://registry.yarnpkg.com/@mattrglobal/node-bbs-signatures/-/node-bbs-signatures-0.15.0.tgz#acbe578253fa95d96141bd44cb65e75cd0b79c67"
integrity sha512-ipIwL1neAW/gwC0jg0aOFWiIipdvn6kq0Ta2ccSgc1pZUg6xPYj7dRMEaR6QJ9zV6qOBe7awETd1CoLunwwsLA==
"@mattrglobal/node-bbs-signatures@0.18.1":
version "0.18.1"
resolved "https://registry.yarnpkg.com/@mattrglobal/node-bbs-signatures/-/node-bbs-signatures-0.18.1.tgz#f313da682bdd9b592e7b65549cbbb8f67b0ce583"
integrity sha512-s9ccL/1TTvCP1N//4QR84j/d5D/stx/AI1kPcRgiE4O3KrxyF7ZdL9ca8fmFuN6yh9LAbn/OiGRnOXgvn38Dgg==
dependencies:
"@mapbox/node-pre-gyp" "1.0.9"
"@mapbox/node-pre-gyp" "1.0.11"
neon-cli "0.10.1"

"@multiformats/base-x@^4.0.1":
Expand Down Expand Up @@ -2969,18 +2954,12 @@
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c"
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==

"@types/node-fetch@2.6.2":
version "2.6.2"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da"
integrity sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==
"@types/node@*", "@types/node@18.18.8", "@types/node@>=13.7.0", "@types/node@^18.18.8":
version "18.18.8"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.8.tgz#2b285361f2357c8c8578ec86b5d097c7f464cfd6"
integrity sha512-OLGBaaK5V3VRBS1bAkMVP2/W9B+H8meUfl866OrMNQqt7wDgdpWPp5o6gmIc9pB+lIQHSq4ZL8ypeH1vPxcPaQ==
dependencies:
"@types/node" "*"
form-data "^3.0.0"

"@types/node@*", "@types/node@>=13.7.0", "@types/node@^16.11.7":
version "16.18.24"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.24.tgz#f21925dd56cd3467b4e1e0c5071d0f2af5e9a316"
integrity sha512-zvSN2Esek1aeLdKDYuntKAYjti9Z2oT4I8bfkLLhIxHlv3dwZ5vvATxOc31820iYm4hQRCwjUgDpwSMFjfTUnw==
undici-types "~5.26.4"

"@types/normalize-package-data@^2.4.0":
version "2.4.1"
Expand Down Expand Up @@ -3021,13 +3000,6 @@
dependencies:
"@types/node" "*"

"@types/ref-napi@^3.0.4":
version "3.0.8"
resolved "https://registry.yarnpkg.com/@types/ref-napi/-/ref-napi-3.0.8.tgz#7b4a131064f66d2decd6ddcb39d9b0b793e55e7f"
integrity sha512-L6yis+3lww27qQXLFS3eipTSivnYurvfMfttjF3kLUfIIhJ/ZUtcoF6JUcJ+AObdE4S6zK+h9ou5CmyLJJw/3w==
dependencies:
"@types/node" "*"

"@types/ref-struct-di@^1.1.10":
version "1.1.10"
resolved "https://registry.yarnpkg.com/@types/ref-struct-di/-/ref-struct-di-1.1.10.tgz#4ea45151a4561894c654a250763f71199216bb9b"
Expand Down Expand Up @@ -5990,15 +5962,6 @@ for-in@^1.0.2:
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==

form-data@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f"
integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.8"
mime-types "^2.1.12"

form-data@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
Expand Down Expand Up @@ -9250,7 +9213,7 @@ node-fetch@3.0.0-beta.9:
data-uri-to-buffer "^3.0.1"
fetch-blob "^2.1.1"

node-fetch@^2.2.0, node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7:
node-fetch@^2.2.0, node-fetch@^2.6.0, node-fetch@^2.6.7:
version "2.6.9"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6"
integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==
Expand Down Expand Up @@ -10466,9 +10429,9 @@ rc@^1.2.8:
strip-json-comments "~2.0.1"

react-devtools-core@^4.26.1:
version "4.27.6"
resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-4.27.6.tgz#e5a613014f7506801ed6c1a97bd0e6316cc9c48a"
integrity sha512-jeFNhEzcSwpiqmw+zix5IFibNEPmUodICN7ClrlRKGktzO/3FMteMb52l1NRUiz/ABSYt9hOZ9IPgVDrg5pyUw==
version "4.28.5"
resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-4.28.5.tgz#c8442b91f068cdf0c899c543907f7f27d79c2508"
integrity sha512-cq/o30z9W2Wb4rzBefjv5fBalHU0rJGZCHAkf/RHSBWSSYwh8PlQTqqOJmgIIbBtpj27T6FIPXeomIjZtCNVqA==
dependencies:
shell-quote "^1.6.1"
ws "^7"
Expand Down Expand Up @@ -12074,6 +12037,11 @@ unbox-primitive@^1.0.2:
has-symbols "^1.0.3"
which-boxed-primitive "^1.0.2"

undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==

unicode-canonical-property-names-ecmascript@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"
Expand Down

0 comments on commit 873a2c7

Please sign in to comment.