Skip to content

Commit 594ba81

Browse files
committed
update library
1 parent 2c7e16d commit 594ba81

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"aws-sdk": "^2.1692.0",
13+
"aws-sigv4-auth-cassandra-plugin": "^1.0.5",
1314
"cassandra-driver": "^4.7.2",
1415
"dotenv": "^16.4.7",
1516
"next": "15.1.6",

src/lib/cassandra.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { Client } from 'cassandra-driver';
44
import * as AWS from 'aws-sdk';
5+
import { SigV4AuthProvider } from 'aws-sigv4-auth-cassandra-plugin'; // Import the SigV4AuthProvider
56

67
// Set up AWS SDK credentials for AWS Keyspaces (only used if connecting to AWS)
78
AWS.config.update({
@@ -22,7 +23,7 @@ if (isAwsKeyspaces) {
2223
contactPoints: [process.env.DB_CONTACT_POINTS || 'cassandra.us-east-1.amazonaws.com'], // AWS Keyspaces endpoint
2324
localDataCenter: process.env.DB_LOCAL_DATACENTER || 'us-east-1',
2425
keyspace: process.env.DB_KEYSPACE || 'your_keyspace',
25-
authProvider: new Cassandra.AwsAuthProvider(AWS.config.credentials), // AWS IAM for authentication
26+
authProvider: new SigV4AuthProvider(AWS.config.credentials), // AWS IAM for authentication
2627
sslOptions: { rejectUnauthorized: true }, // Enable SSL for AWS Keyspaces
2728
});
2829
} else {

0 commit comments

Comments
 (0)