From ab0f6ff99a41249f22744d62a1c571581aec7929 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 09:18:45 +0000 Subject: [PATCH 1/3] fix(deps): update dependency @interledger/http-signature-utils to v2.0.2 --- aws/lambdas/http-signatures/package-lock.json | 28 +++++++++++++------ aws/lambdas/http-signatures/package.json | 2 +- .../package.json | 2 +- packages/auth/package.json | 2 +- packages/backend/package.json | 2 +- pnpm-lock.yaml | 21 ++++---------- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/aws/lambdas/http-signatures/package-lock.json b/aws/lambdas/http-signatures/package-lock.json index 7503c0f3c2..2325678c7a 100644 --- a/aws/lambdas/http-signatures/package-lock.json +++ b/aws/lambdas/http-signatures/package-lock.json @@ -6,24 +6,36 @@ "": { "name": "http-signatures-lambda", "dependencies": { - "@interledger/http-signature-utils": "2.0.1" + "@interledger/http-signature-utils": "2.0.2" } }, "node_modules/@interledger/http-signature-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@interledger/http-signature-utils/-/http-signature-utils-2.0.1.tgz", - "integrity": "sha512-aELLCsl3x1Xtyv4N9lyF3TmCynkYyap5WYOQNQDVi74+BRyP1sHPE9u8HQJJAi2r6yU7+qRTMrM2uU6aD7RQmA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@interledger/http-signature-utils/-/http-signature-utils-2.0.2.tgz", + "integrity": "sha512-gTAPFMt7xwG1zv1rbrltcZTAqOw/ZJwkVdnNjQzu5G9JTfvJQzS6pcpiVUej1cblpewotbOzosgdX00f93q9zA==", "dependencies": { - "http-message-signatures": "^0.1.2", + "http-message-signatures": "^1.0.4", "httpbis-digest-headers": "^1.0.0", "jose": "^4.13.1", "uuid": "^9.0.0" } }, "node_modules/http-message-signatures": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/http-message-signatures/-/http-message-signatures-0.1.2.tgz", - "integrity": "sha512-gjJYDgFBy+xnlAs2G0gIWpiorCv9Xi7pIlOnnd91zHAK7BtkLxonmm/JAtd5e6CakOuW03IwEuJzj2YMy8lfWQ==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/http-message-signatures/-/http-message-signatures-1.0.4.tgz", + "integrity": "sha512-gavCQWnxHFg0BVlKs6CmYK7hNSH1o0x0mHTC68yBAHYOYuTVXPv52mEE7QuT5TenfiagTdOa/zPJzen4lEX7Rg==", + "dependencies": { + "structured-headers": "^1.0.1" + } + }, + "node_modules/http-message-signatures/node_modules/structured-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/structured-headers/-/structured-headers-1.0.1.tgz", + "integrity": "sha512-QYBxdBtA4Tl5rFPuqmbmdrS9kbtren74RTJTcs0VSQNVV5iRhJD4QlYTLD0+81SBwUQctjEQzjTRI3WG4DzICA==", + "engines": { + "node": ">= 14", + "npm": ">=6" + } }, "node_modules/httpbis-digest-headers": { "version": "1.0.0", diff --git a/aws/lambdas/http-signatures/package.json b/aws/lambdas/http-signatures/package.json index 5a393e7c72..0533520412 100644 --- a/aws/lambdas/http-signatures/package.json +++ b/aws/lambdas/http-signatures/package.json @@ -3,6 +3,6 @@ "main": "index.js", "type": "module", "dependencies": { - "@interledger/http-signature-utils": "2.0.1" + "@interledger/http-signature-utils": "2.0.2" } } diff --git a/localenv/mock-account-servicing-entity/package.json b/localenv/mock-account-servicing-entity/package.json index dcb7e552c3..43913da4f0 100644 --- a/localenv/mock-account-servicing-entity/package.json +++ b/localenv/mock-account-servicing-entity/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@apollo/client": "^3.9.5", - "@interledger/http-signature-utils": "2.0.1", + "@interledger/http-signature-utils": "2.0.2", "@remix-run/node": "^2.6.0", "@remix-run/react": "^2.6.0", "@remix-run/serve": "^2.6.0", diff --git a/packages/auth/package.json b/packages/auth/package.json index 730d5f289c..15f7f404f3 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -25,7 +25,7 @@ "@graphql-tools/graphql-file-loader": "^8.0.1", "@graphql-tools/load": "^8.0.2", "@graphql-tools/schema": "^10.0.3", - "@interledger/http-signature-utils": "2.0.1", + "@interledger/http-signature-utils": "2.0.2", "@interledger/open-payments": "6.6.0", "@interledger/openapi": "1.2.1", "@koa/cors": "^5.0.0", diff --git a/packages/backend/package.json b/packages/backend/package.json index 313294e477..22433a0c58 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -50,7 +50,7 @@ "@graphql-tools/graphql-file-loader": "^8.0.1", "@graphql-tools/load": "^8.0.2", "@graphql-tools/schema": "^10.0.3", - "@interledger/http-signature-utils": "2.0.1", + "@interledger/http-signature-utils": "2.0.2", "@interledger/open-payments": "6.6.0", "@interledger/openapi": "1.2.1", "@interledger/pay": "0.4.0-alpha.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ee2f65975c..921ff72e99 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ^3.9.5 version: 3.9.5(@types/react@18.2.62)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0) '@interledger/http-signature-utils': - specifier: 2.0.1 - version: 2.0.1 + specifier: 2.0.2 + version: 2.0.2 '@remix-run/node': specifier: ^2.6.0 version: 2.6.0(typescript@5.3.3) @@ -127,8 +127,8 @@ importers: specifier: ^10.0.3 version: 10.0.3(graphql@16.8.1) '@interledger/http-signature-utils': - specifier: 2.0.1 - version: 2.0.1 + specifier: 2.0.2 + version: 2.0.2 '@interledger/open-payments': specifier: 6.6.0 version: 6.6.0 @@ -266,8 +266,8 @@ importers: specifier: ^10.0.3 version: 10.0.3(graphql@16.8.1) '@interledger/http-signature-utils': - specifier: 2.0.1 - version: 2.0.1 + specifier: 2.0.2 + version: 2.0.2 '@interledger/open-payments': specifier: 6.6.0 version: 6.6.0 @@ -3468,15 +3468,6 @@ packages: - supports-color dev: false - /@interledger/http-signature-utils@2.0.1: - resolution: {integrity: sha512-aELLCsl3x1Xtyv4N9lyF3TmCynkYyap5WYOQNQDVi74+BRyP1sHPE9u8HQJJAi2r6yU7+qRTMrM2uU6aD7RQmA==} - dependencies: - http-message-signatures: 0.1.2 - httpbis-digest-headers: 1.0.0 - jose: 4.13.1 - uuid: 9.0.1 - dev: false - /@interledger/http-signature-utils@2.0.2: resolution: {integrity: sha512-gTAPFMt7xwG1zv1rbrltcZTAqOw/ZJwkVdnNjQzu5G9JTfvJQzS6pcpiVUej1cblpewotbOzosgdX00f93q9zA==} dependencies: From 2c2cee008acd0461633acddf8344a38fd2112b0a Mon Sep 17 00:00:00 2001 From: Sabine Schaller Date: Thu, 7 Mar 2024 10:35:44 +0100 Subject: [PATCH 2/3] fix: type issue --- packages/auth/src/signature/middleware.ts | 2 +- packages/auth/src/tests/context.ts | 2 +- packages/backend/src/open_payments/auth/middleware.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/auth/src/signature/middleware.ts b/packages/auth/src/signature/middleware.ts index f07e766f70..b29f91ad9e 100644 --- a/packages/auth/src/signature/middleware.ts +++ b/packages/auth/src/signature/middleware.ts @@ -19,7 +19,7 @@ function contextToRequestLike(ctx: AppContext): RequestLike { return { url, method: ctx.method, - headers: ctx.headers, + headers: JSON.parse(JSON.stringify(ctx.headers)), body: ctx.request.body ? JSON.stringify(ctx.request.body) : undefined } } diff --git a/packages/auth/src/tests/context.ts b/packages/auth/src/tests/context.ts index e46b485f2f..78eb9ad784 100644 --- a/packages/auth/src/tests/context.ts +++ b/packages/auth/src/tests/context.ts @@ -52,7 +52,7 @@ export async function createContextWithSigHeaders( const request = { url, method, - headers, + headers: JSON.parse(JSON.stringify(headers)), body: JSON.stringify(requestBody) } const sigHeaders = await createHeaders({ diff --git a/packages/backend/src/open_payments/auth/middleware.ts b/packages/backend/src/open_payments/auth/middleware.ts index e9e544fa92..45a3665261 100644 --- a/packages/backend/src/open_payments/auth/middleware.ts +++ b/packages/backend/src/open_payments/auth/middleware.ts @@ -42,7 +42,7 @@ function contextToRequestLike(ctx: HttpSigContext): RequestLike { return { url, method: ctx.method, - headers: ctx.headers, + headers: JSON.parse(JSON.stringify(ctx.headers)), body: ctx.request.body ? JSON.stringify(ctx.request.body) : undefined } } From 78cd73fdd2c612298c855c190597e67255d14373 Mon Sep 17 00:00:00 2001 From: Sabine Schaller Date: Thu, 7 Mar 2024 10:58:03 +0100 Subject: [PATCH 3/3] fix: handle headers undefined use case --- packages/auth/src/signature/middleware.ts | 2 +- packages/auth/src/tests/context.ts | 2 +- packages/backend/src/open_payments/auth/middleware.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/auth/src/signature/middleware.ts b/packages/auth/src/signature/middleware.ts index b29f91ad9e..cfc797e148 100644 --- a/packages/auth/src/signature/middleware.ts +++ b/packages/auth/src/signature/middleware.ts @@ -19,7 +19,7 @@ function contextToRequestLike(ctx: AppContext): RequestLike { return { url, method: ctx.method, - headers: JSON.parse(JSON.stringify(ctx.headers)), + headers: ctx.headers ? JSON.parse(JSON.stringify(ctx.headers)) : undefined, body: ctx.request.body ? JSON.stringify(ctx.request.body) : undefined } } diff --git a/packages/auth/src/tests/context.ts b/packages/auth/src/tests/context.ts index 78eb9ad784..e9ab37a4c0 100644 --- a/packages/auth/src/tests/context.ts +++ b/packages/auth/src/tests/context.ts @@ -52,7 +52,7 @@ export async function createContextWithSigHeaders( const request = { url, method, - headers: JSON.parse(JSON.stringify(headers)), + headers: headers ? JSON.parse(JSON.stringify(headers)) : undefined, body: JSON.stringify(requestBody) } const sigHeaders = await createHeaders({ diff --git a/packages/backend/src/open_payments/auth/middleware.ts b/packages/backend/src/open_payments/auth/middleware.ts index 45a3665261..74266e13c0 100644 --- a/packages/backend/src/open_payments/auth/middleware.ts +++ b/packages/backend/src/open_payments/auth/middleware.ts @@ -42,7 +42,7 @@ function contextToRequestLike(ctx: HttpSigContext): RequestLike { return { url, method: ctx.method, - headers: JSON.parse(JSON.stringify(ctx.headers)), + headers: ctx.headers ? JSON.parse(JSON.stringify(ctx.headers)) : undefined, body: ctx.request.body ? JSON.stringify(ctx.request.body) : undefined } }