Skip to content

Commit

Permalink
Merge pull request #162 from govuk-one-login/LIME-1267
Browse files Browse the repository at this point in the history
[LIME-1267] Upgraded aws-sdk
  • Loading branch information
SarahHillGDS authored Sep 19, 2024
2 parents 8cff7d7 + b433e73 commit 1425c74
Show file tree
Hide file tree
Showing 4 changed files with 912 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
"uglify-js": "latest"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "3.651.1",
"@govuk-one-login/di-ipv-cri-common-express": "6.4.1",
"@govuk-one-login/frontend-analytics": "2.0.1",
"@govuk-one-login/frontend-passthrough-headers": "1.1.1",
"@govuk-one-login/frontend-language-toggle": "1.1.0",
"aws-sdk": "^2.1300.0",
"@govuk-one-login/frontend-passthrough-headers": "1.1.1",
"axios": "1.6.1",
"cfenv": "1.2.4",
"connect-dynamodb": "^2.0.5",
Expand Down
7 changes: 4 additions & 3 deletions src/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ const {
SESSION_TTL,
LOG_LEVEL
} = require("./lib/config");
const { DynamoDBClient } = require("@aws-sdk/client-dynamodb");

describe("app", () => {
beforeEach(() => {
setup = sinon.stub();
setGTM = sinon.stub();
app = sinon.stub();
AWS = {
DynamoDB: sinon.stub(),
DynamoDBClient: sinon.stub(),
config: {
update: sinon.stub()
}
Expand All @@ -41,10 +42,10 @@ describe("app", () => {
AWS.config.update({
region: "eu-west-2"
});
const dynamodb = new AWS.DynamoDB();
const dynamodbClient = new DynamoDBClient({});

const dynamoDBSessionStore = new DynamoDBStore({
client: dynamodb,
client: dynamodbClient,
table: SESSION_TABLE_NAME
});

Expand Down
7 changes: 3 additions & 4 deletions src/dynamo-session-config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
const { SESSION_TABLE_NAME } = require("./lib/config");

const AWS = require("aws-sdk");
const { DynamoDBClient } = require("@aws-sdk/client-dynamodb");
const session = require("express-session");
const DynamoDBStore = require("connect-dynamodb")(session);

const createSessionStore = () => {
AWS.config.update({
const dynamodbClient = new DynamoDBClient({
region: "eu-west-2"
});
const dynamodb = new AWS.DynamoDB();

const dynamoDBSessionStore = new DynamoDBStore({
client: dynamodb,
client: dynamodbClient,
table: SESSION_TABLE_NAME
});

Expand Down
Loading

0 comments on commit 1425c74

Please sign in to comment.