Chore: Allow using an AWS_SESSION_TOKEN for object storage with AWS S3

This commit is contained in:
Hector Valcarcel 2024-06-07 17:57:54 +02:00 committed by mike12345567
parent 9e3f476c65
commit 65c2039d0c
4 changed files with 8 additions and 0 deletions

View File

@ -120,6 +120,7 @@ const environment = {
REDIS_CLUSTERED: process.env.REDIS_CLUSTERED,
MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY,
MINIO_SECRET_KEY: process.env.MINIO_SECRET_KEY,
AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN,
AWS_REGION: process.env.AWS_REGION,
MINIO_URL: process.env.MINIO_URL,
MINIO_ENABLED: process.env.MINIO_ENABLED || 1,

View File

@ -101,6 +101,11 @@ export function ObjectStore(
}
}
// for AWS Credentials using temporary session token
if (!env.MINIO_ENABLED && env.AWS_SESSION_TOKEN) {
config.sessionToken = env.AWS_SESSION_TOKEN
}
// custom S3 is in use i.e. minio
if (env.MINIO_URL) {
if (opts.presigning && env.MINIO_ENABLED) {

View File

@ -48,6 +48,7 @@ const environment = {
MINIO_URL: process.env.MINIO_URL,
WORKER_URL: process.env.WORKER_URL,
AWS_REGION: process.env.AWS_REGION,
AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN,
MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY,
MINIO_SECRET_KEY: process.env.MINIO_SECRET_KEY,
REDIS_URL: process.env.REDIS_URL,

View File

@ -24,6 +24,7 @@ const environment = {
// auth
MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY,
MINIO_SECRET_KEY: process.env.MINIO_SECRET_KEY,
AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN,
SALT_ROUNDS: process.env.SALT_ROUNDS,
REDIS_PASSWORD: process.env.REDIS_PASSWORD,
COOKIE_DOMAIN: process.env.COOKIE_DOMAIN,