File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
src/modules/encryption/strategies Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ export default {
87
87
} ,
88
88
encryption : {
89
89
keytar : process . env . RI_ENCRYPTION_KEYTAR ? process . env . RI_ENCRYPTION_KEYTAR === 'true' : true , // enabled by default
90
+ keytarService : process . env . RI_ENCRYPTION_KEYTAR_SERVICE || 'redisinsight' ,
90
91
encryptionIV : process . env . RI_ENCRYPTION_IV || Buffer . alloc ( 16 , 0 ) ,
91
92
encryptionAlgorithm : process . env . RI_ENCRYPTION_ALGORYTHM || 'aes-256-cbc' ,
92
93
} ,
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import {
11
11
} from 'src/modules/encryption/exceptions' ;
12
12
import config , { Config } from 'src/utils/config' ;
13
13
14
- const SERVICE = 'redisinsight' ;
15
14
const ACCOUNT = 'app' ;
16
15
const SERVER_CONFIG = config . get ( 'server' ) as Config [ 'server' ] ;
17
16
const ENCRYPTION_CONFIG = config . get ( 'encryption' ) as Config [ 'encryption' ] ;
@@ -54,7 +53,7 @@ export class KeytarEncryptionStrategy implements IEncryptionStrategy {
54
53
*/
55
54
private async getPassword ( ) : Promise < string | null > {
56
55
try {
57
- return await this . keytar . getPassword ( SERVICE , ACCOUNT ) ;
56
+ return await this . keytar . getPassword ( ENCRYPTION_CONFIG . keytarService , ACCOUNT ) ;
58
57
} catch ( error ) {
59
58
this . logger . error ( 'Unable to get password' ) ;
60
59
throw new KeytarUnavailableException ( ) ;
@@ -68,7 +67,7 @@ export class KeytarEncryptionStrategy implements IEncryptionStrategy {
68
67
*/
69
68
private async setPassword ( password : string ) : Promise < void > {
70
69
try {
71
- await this . keytar . setPassword ( SERVICE , ACCOUNT , password ) ;
70
+ await this . keytar . setPassword ( ENCRYPTION_CONFIG . keytarService , ACCOUNT , password ) ;
72
71
} catch ( error ) {
73
72
this . logger . error ( 'Unable to set password' ) ;
74
73
throw new KeytarUnavailableException ( ) ;
You can’t perform that action at this time.
0 commit comments