Skip to content

Commit fd4c702

Browse files
authored
Remove S3Client IAM static credentials to allow other auth methods
If credentials are specified in S3Client other auth methods like IDSA will not work, as this disables the default behaviour of the AWS SDK client (https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html) With this change we should be able to remove the need of hardcoded credentials when accesing S3 in favor of more secure IDSA.
1 parent 5ad4bb2 commit fd4c702

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

src/static/aws/s3.service.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@ import { generateNewImageName } from '../utils';
88

99
export class AWSS3Service implements Static {
1010
private readonly logger: Logger = new Logger(AWSS3Service.name);
11-
private readonly AWS_ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID;
12-
private readonly AWS_SECRET_ACCESS_KEY = process.env.AWS_SECRET_ACCESS_KEY;
1311
private readonly AWS_REGION = process.env.AWS_REGION;
1412
private readonly AWS_S3_BUCKET_NAME = process.env.AWS_S3_BUCKET_NAME;
1513

1614
private s3Client: S3Client;
1715

1816
constructor() {
1917
this.s3Client = new S3Client({
20-
credentials: {
21-
accessKeyId: this.AWS_ACCESS_KEY_ID,
22-
secretAccessKey: this.AWS_SECRET_ACCESS_KEY,
23-
},
2418
region: this.AWS_REGION,
2519
});
2620
this.logger.log('AWS S3 service is being used for file storage.');

0 commit comments

Comments
 (0)