Skip to content

Commit 8a79738

Browse files
authored
Merge pull request #656 from govuk-one-login/dependabot/npm_and_yarn/production-dependencies-ef3d59e1c5
BAU: Bump the production-dependencies group with 10 updates
2 parents c88bbbb + c974dd1 commit 8a79738

15 files changed

Lines changed: 716 additions & 549 deletions

File tree

package-lock.json

Lines changed: 459 additions & 408 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"@aws-lambda-powertools/logger": "^2.32.0",
1010
"@aws-lambda-powertools/metrics": "^2.32.0",
1111
"@aws-lambda-powertools/parameters": "^2.32.0",
12-
"@aws-sdk/client-appconfigdata": "^3.1015.0",
13-
"@aws-sdk/client-dynamodb": "^3.1015.0",
14-
"@aws-sdk/client-kms": "^3.1015.0",
15-
"@aws-sdk/client-s3": "^3.1015.0",
16-
"@aws-sdk/client-secrets-manager": "^3.1015.0",
17-
"@aws-sdk/client-sqs": "^3.1015.0",
18-
"@aws-sdk/client-ssm": "^3.1015.0",
19-
"@aws-sdk/lib-dynamodb": "^3.1015.0",
12+
"@aws-sdk/client-appconfigdata": "^3.1021.0",
13+
"@aws-sdk/client-dynamodb": "^3.1021.0",
14+
"@aws-sdk/client-kms": "^3.1021.0",
15+
"@aws-sdk/client-s3": "^3.1021.0",
16+
"@aws-sdk/client-secrets-manager": "^3.1021.0",
17+
"@aws-sdk/client-sqs": "^3.1021.0",
18+
"@aws-sdk/client-ssm": "^3.1021.0",
19+
"@aws-sdk/lib-dynamodb": "^3.1021.0",
2020
"@fastify/aws-lambda": "^6.4.0",
2121
"@fastify/cookie": "^11.0.2",
2222
"@fastify/csrf-protection": "^7.1.0",
@@ -37,7 +37,7 @@
3737
"fastify": "^5.8.3",
3838
"fastify-plugin": "^5.1.0",
3939
"govuk-frontend": "^5.14.0",
40-
"i18next": "^26.0.2",
40+
"i18next": "^26.0.3",
4141
"i18next-http-middleware": "^3.9.2",
4242
"jose": "^6.2.2",
4343
"notifications-node-client": "^8.3.2",

solutions/api/src/lambda/healthcheck.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ vi.mock(import("../../../commons/utils/metrics/index.js"), () => ({
1515
}));
1616

1717
vi.mock(
18-
import("../../../commons/utils/normalizeAPIGatewayProxyEventHeadersHandlerWrapper/index.js"),
18+
import("../../../commons/utils/normalizeAPIGatewayProxyEventHandlerWrapper/index.js"),
1919
() => ({
20-
normalizeAPIGatewayProxyEventHeadersHandlerWrapper: (fn) => fn,
20+
normalizeAPIGatewayProxyEventHandlerWrapper: (fn) => fn,
2121
}),
2222
);
2323

solutions/api/src/lambda/healthcheck.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { APIGatewayProxyResult } from "aws-lambda";
22
import { loggerAPIGatewayProxyHandlerWrapper } from "../../../commons/utils/logger/index.js";
33
import { metricsAPIGatewayProxyHandlerWrapper } from "../../../commons/utils/metrics/index.js";
4-
import { normalizeAPIGatewayProxyEventHeadersHandlerWrapper } from "../../../commons/utils/normalizeAPIGatewayProxyEventHeadersHandlerWrapper/index.js";
4+
import { normalizeAPIGatewayProxyEventHandlerWrapper } from "../../../commons/utils/normalizeAPIGatewayProxyEventHandlerWrapper/index.js";
55

6-
export const handler = normalizeAPIGatewayProxyEventHeadersHandlerWrapper(
6+
export const handler = normalizeAPIGatewayProxyEventHandlerWrapper(
77
loggerAPIGatewayProxyHandlerWrapper(
88
metricsAPIGatewayProxyHandlerWrapper(
99
async (): Promise<APIGatewayProxyResult> => {

solutions/api/src/lambda/journeyoutcome/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ vi.mock(import("../../../../commons/utils/logger/index.js"), () => ({
7171
}));
7272

7373
vi.mock(
74-
import("../../../../commons/utils/normalizeAPIGatewayProxyEventHeadersHandlerWrapper/index.js"),
74+
import("../../../../commons/utils/normalizeAPIGatewayProxyEventHandlerWrapper/index.js"),
7575
() => ({
76-
normalizeAPIGatewayProxyEventHeadersHandlerWrapper: (fn) => fn,
76+
normalizeAPIGatewayProxyEventHandlerWrapper: (fn) => fn,
7777
}),
7878
);
7979

solutions/api/src/lambda/journeyoutcome/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { validateJourneyOutcomeJwtClaims } from "./utils/validateJourneyOutcomeJ
1010
import { loggerAPIGatewayProxyHandlerWrapper } from "../../../../commons/utils/logger/index.js";
1111
import { getJourneyOutcome } from "./utils/getJourneyOutcome.js";
1212
import type { JourneyOutcomePayload } from "./utils/interfaces.js";
13-
import { normalizeAPIGatewayProxyEventHeadersHandlerWrapper } from "../../../../commons/utils/normalizeAPIGatewayProxyEventHeadersHandlerWrapper/index.js";
13+
import { normalizeAPIGatewayProxyEventHandlerWrapper } from "../../../../commons/utils/normalizeAPIGatewayProxyEventHandlerWrapper/index.js";
1414

15-
export const handler = normalizeAPIGatewayProxyEventHeadersHandlerWrapper(
15+
export const handler = normalizeAPIGatewayProxyEventHandlerWrapper(
1616
loggerAPIGatewayProxyHandlerWrapper(
1717
metricsAPIGatewayProxyHandlerWrapper(
1818
async (event: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> => {

solutions/api/src/lambda/token/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ vi.mock(import("../../../../commons/utils/logger/index.js"), () => ({
3838
}));
3939

4040
vi.mock(
41-
import("../../../../commons/utils/normalizeAPIGatewayProxyEventHeadersHandlerWrapper/index.js"),
41+
import("../../../../commons/utils/normalizeAPIGatewayProxyEventHandlerWrapper/index.js"),
4242
() => ({
43-
normalizeAPIGatewayProxyEventHeadersHandlerWrapper: (fn) => fn,
43+
normalizeAPIGatewayProxyEventHandlerWrapper: (fn) => fn,
4444
}),
4545
);
4646

solutions/api/src/lambda/token/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { verifyJti } from "./utils/verifyJti.js";
1111
import { loggerAPIGatewayProxyHandlerWrapper } from "../../../../commons/utils/logger/index.js";
1212
import { createAccessToken } from "./utils/createAccessToken.js";
1313
import { getApiBaseUrlWithStage } from "../../utils/common.js";
14-
import { normalizeAPIGatewayProxyEventHeadersHandlerWrapper } from "../../../../commons/utils/normalizeAPIGatewayProxyEventHeadersHandlerWrapper/index.js";
14+
import { normalizeAPIGatewayProxyEventHandlerWrapper } from "../../../../commons/utils/normalizeAPIGatewayProxyEventHandlerWrapper/index.js";
1515

16-
export const handler = normalizeAPIGatewayProxyEventHeadersHandlerWrapper(
16+
export const handler = normalizeAPIGatewayProxyEventHandlerWrapper(
1717
loggerAPIGatewayProxyHandlerWrapper(
1818
metricsAPIGatewayProxyHandlerWrapper(
1919
async (e: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> => {

solutions/commons/utils/metrics/index.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe("metricsAPIGatewayProxyHandlerWrapper", () => {
3636
expect(result).toStrictEqual({ statusCode: 200, body: "success" });
3737
});
3838

39-
it("returns 500 response and flushes metrics when handler throws", async () => {
39+
it("flushes metrics and re-throws when handler throws", async () => {
4040
const mockHandler = vi.fn().mockRejectedValue(new Error("handler error"));
4141
const publishSpy = vi.spyOn(metrics, "publishStoredMetrics");
4242
const coldStartSpy = vi.spyOn(metrics, "captureColdStartMetric");
@@ -50,7 +50,9 @@ describe("metricsAPIGatewayProxyHandlerWrapper", () => {
5050
} as APIGatewayProxyEvent;
5151
const mockContext = {} as Context;
5252

53-
const result = await wrappedHandler(mockEvent, mockContext);
53+
await expect(wrappedHandler(mockEvent, mockContext)).rejects.toThrow(
54+
"handler error",
55+
);
5456

5557
expect(mockHandler).toHaveBeenCalledWith(mockEvent, mockContext);
5658
expect(addDimensionsSpy).toHaveBeenCalledWith({
@@ -59,6 +61,5 @@ describe("metricsAPIGatewayProxyHandlerWrapper", () => {
5961
});
6062
expect(coldStartSpy).toHaveBeenCalledTimes(1);
6163
expect(publishSpy).toHaveBeenCalledTimes(1);
62-
expect(result).toStrictEqual({ statusCode: 500, body: "" });
6364
});
6465
});

solutions/commons/utils/metrics/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Metrics } from "@aws-lambda-powertools/metrics";
22
import type { APIGatewayProxyHandler } from "../interfaces.js";
3-
import { logger } from "../logger/index.js";
43

54
export const metrics = new Metrics({
65
namespace: "account-components",
@@ -20,13 +19,9 @@ export const metricsAPIGatewayProxyHandlerWrapper = (
2019
metrics.publishStoredMetrics();
2120
return res;
2221
} catch (error) {
23-
logger.error("An error occurred", { error });
2422
metrics.captureColdStartMetric();
2523
metrics.publishStoredMetrics();
26-
return {
27-
statusCode: 500,
28-
body: "",
29-
};
24+
throw error;
3025
}
3126
};
3227
return wrappedHandler;

0 commit comments

Comments
 (0)