fix(6423): add username and password for redis connection (#6745)
Co-authored-by: pbb <pierre-bertrand.borel_ext@michelin.com>
This commit is contained in:
@ -29,12 +29,17 @@ export const cacheStorageModuleFactory = (
|
||||
);
|
||||
}
|
||||
|
||||
const username = environmentService.get('REDIS_USERNAME');
|
||||
const password = environmentService.get('REDIS_PASSWORD');
|
||||
|
||||
return {
|
||||
...cacheModuleOptions,
|
||||
store: redisStore,
|
||||
socket: {
|
||||
host,
|
||||
port,
|
||||
username,
|
||||
password,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@ -368,6 +368,10 @@ export class EnvironmentVariables {
|
||||
@CastToPositiveNumber()
|
||||
REDIS_PORT = 6379;
|
||||
|
||||
REDIS_USERNAME: string;
|
||||
|
||||
REDIS_PASSWORD: string;
|
||||
|
||||
API_TOKEN_EXPIRES_IN = '100y';
|
||||
|
||||
SHORT_TERM_TOKEN_EXPIRES_IN = '5m';
|
||||
|
||||
@ -34,6 +34,8 @@ export const messageQueueModuleFactory = async (
|
||||
case MessageQueueDriverType.BullMQ: {
|
||||
const host = environmentService.get('REDIS_HOST');
|
||||
const port = environmentService.get('REDIS_PORT');
|
||||
const username = environmentService.get('REDIS_USERNAME');
|
||||
const password = environmentService.get('REDIS_PASSWORD');
|
||||
|
||||
return {
|
||||
type: MessageQueueDriverType.BullMQ,
|
||||
@ -41,6 +43,8 @@ export const messageQueueModuleFactory = async (
|
||||
connection: {
|
||||
host,
|
||||
port,
|
||||
username,
|
||||
password,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user