Skip to content

Commit

Permalink
switch to aws sdk v3 and update to v2.2.0 of s3-selectable
Browse files Browse the repository at this point in the history
  • Loading branch information
dforsber committed Jul 29, 2023
1 parent b3631cd commit 566fbce
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 155 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.16
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
}
},
"devDependencies": {
"@aws-amplify/auth": "^5.5.5",
"@aws-amplify/core": "^5.7.0",
"aws-sdk": "^2.1425.0",
"@aws-sdk/credential-providers": "^3.379.1",
"eslint": "^8.46.0",
"husky": "^8.0.0",
"prettier": "^3.0.0",
Expand All @@ -42,7 +43,7 @@
"@aws-sdk/client-apigatewaymanagementapi": "^3.379.1",
"@aws-sdk/client-glue": "^3.379.1",
"@aws-sdk/client-s3": "^3.379.1",
"@dforsber/s3-selectable": "^2.1.6",
"@dforsber/s3-selectable": "^2.2.0",
"is-stream": "^2.0.0",
"p-queue": "^6.6.2"
}
Expand Down
3 changes: 0 additions & 3 deletions src/default-handler/util.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
const { promisify } = require('util');

// NOTE: Not getting nodejs SDK v3 working.
const { ApiGatewayManagementApi } = require('@aws-sdk/client-apigatewaymanagementapi');
//const { ApiGatewayManagementApi } = require("aws-sdk");

const { Buffer } = require('buffer');
const { Glue } = require('@aws-sdk/client-glue');
Expand Down
9 changes: 5 additions & 4 deletions src/wss-signer/sign_wss_url.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
const { SharedIniFileCredentials } = require('aws-sdk');
const { fromNodeProviderChain } = require('@aws-sdk/credential-providers');
const { Signer } = require('@aws-amplify/core');
const process = require('process');

async function getSignedWssUrl(wssUrl) {
const creds = new SharedIniFileCredentials();
const signed = await Signer.signUrl(wssUrl, {
const creds = await fromNodeProviderChain()();
const accessInfo = {
access_key: creds.accessKeyId,
secret_key: creds.secretAccessKey,
session_token: creds.sessionToken,
});
};
const signed = await Signer.signUrl(wssUrl, accessInfo);
console.log(signed);
}

Expand Down
Loading

0 comments on commit 566fbce

Please sign in to comment.