skyeye-svc-common-utils 1.0.67-debug0.1 → 1.0.67-debug0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export declare class AppConfigKeyRetriever {
|
|
2
|
+
private static swaggerAdminRoleApiKey;
|
|
3
|
+
private static publicJwtSecret;
|
|
4
|
+
private static internalJwtSecret;
|
|
5
|
+
private static sendgridClientSecret;
|
|
6
|
+
private static redisConnection;
|
|
2
7
|
static getSwaggerAdminRoleApiKey(): Promise<string>;
|
|
3
8
|
static getPublicJwtSecret(): Promise<string>;
|
|
4
9
|
static getInternalJwtSecret(): Promise<string>;
|
|
@@ -15,27 +15,37 @@ const azureKeyVault_1 = require("../../lib/azure/azureKeyVault");
|
|
|
15
15
|
class AppConfigKeyRetriever {
|
|
16
16
|
static getSwaggerAdminRoleApiKey() {
|
|
17
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
|
|
18
|
+
if (!AppConfigKeyRetriever.swaggerAdminRoleApiKey)
|
|
19
|
+
AppConfigKeyRetriever.swaggerAdminRoleApiKey = yield (0, azureKeyVault_1.getKey)(appConfig_1.commonAppConfig.SwaggerAdminRoleApiKey);
|
|
20
|
+
return AppConfigKeyRetriever.swaggerAdminRoleApiKey;
|
|
19
21
|
});
|
|
20
22
|
}
|
|
21
23
|
static getPublicJwtSecret() {
|
|
22
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
|
|
25
|
+
if (!AppConfigKeyRetriever.publicJwtSecret)
|
|
26
|
+
AppConfigKeyRetriever.publicJwtSecret = yield (0, azureKeyVault_1.getKey)(appConfig_1.commonAppConfig.PublicJwtSecret);
|
|
27
|
+
return AppConfigKeyRetriever.publicJwtSecret;
|
|
24
28
|
});
|
|
25
29
|
}
|
|
26
30
|
static getInternalJwtSecret() {
|
|
27
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
|
|
32
|
+
if (!AppConfigKeyRetriever.internalJwtSecret)
|
|
33
|
+
AppConfigKeyRetriever.internalJwtSecret = yield (0, azureKeyVault_1.getKey)(appConfig_1.commonAppConfig.InternalJwtSecret);
|
|
34
|
+
return AppConfigKeyRetriever.internalJwtSecret;
|
|
29
35
|
});
|
|
30
36
|
}
|
|
31
37
|
static getSendgridClientSecret() {
|
|
32
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
|
|
39
|
+
if (!AppConfigKeyRetriever.sendgridClientSecret)
|
|
40
|
+
AppConfigKeyRetriever.sendgridClientSecret = yield (0, azureKeyVault_1.getKey)(appConfig_1.commonAppConfig.SendgridClientSecretKey);
|
|
41
|
+
return AppConfigKeyRetriever.sendgridClientSecret;
|
|
34
42
|
});
|
|
35
43
|
}
|
|
36
44
|
static getRedisConnection() {
|
|
37
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
|
|
46
|
+
if (!AppConfigKeyRetriever.redisConnection)
|
|
47
|
+
AppConfigKeyRetriever.redisConnection = yield (0, azureKeyVault_1.getKey)(appConfig_1.commonAppConfig.RedisConnectionConfigKey);
|
|
48
|
+
return AppConfigKeyRetriever.redisConnection;
|
|
39
49
|
});
|
|
40
50
|
}
|
|
41
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appConfigKeyRetriever.js","sourceRoot":"","sources":["../../../src/utils/commonUtils/appConfigKeyRetriever.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA+C;AAC/C,iEAAuD;AAEvD,MAAa,qBAAqB;
|
|
1
|
+
{"version":3,"file":"appConfigKeyRetriever.js","sourceRoot":"","sources":["../../../src/utils/commonUtils/appConfigKeyRetriever.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA+C;AAC/C,iEAAuD;AAEvD,MAAa,qBAAqB;IAOvB,MAAM,CAAO,yBAAyB;;YACzC,IAAI,CAAC,qBAAqB,CAAC,sBAAsB;gBAC7C,qBAAqB,CAAC,sBAAsB,GAAG,MAAM,IAAA,sBAAM,EAAC,2BAAe,CAAC,sBAAsB,CAAC,CAAC;YACxG,OAAO,qBAAqB,CAAC,sBAAsB,CAAC;QACxD,CAAC;KAAA;IAEM,MAAM,CAAO,kBAAkB;;YAClC,IAAI,CAAC,qBAAqB,CAAC,eAAe;gBACtC,qBAAqB,CAAC,eAAe,GAAG,MAAM,IAAA,sBAAM,EAAC,2BAAe,CAAC,eAAe,CAAC,CAAC;YAC1F,OAAO,qBAAqB,CAAC,eAAe,CAAC;QACjD,CAAC;KAAA;IAEM,MAAM,CAAO,oBAAoB;;YACpC,IAAI,CAAC,qBAAqB,CAAC,iBAAiB;gBACxC,qBAAqB,CAAC,iBAAiB,GAAG,MAAM,IAAA,sBAAM,EAAC,2BAAe,CAAC,iBAAiB,CAAC,CAAC;YAC9F,OAAO,qBAAqB,CAAC,iBAAiB,CAAC;QACnD,CAAC;KAAA;IAEM,MAAM,CAAO,uBAAuB;;YACvC,IAAI,CAAC,qBAAqB,CAAC,oBAAoB;gBAC3C,qBAAqB,CAAC,oBAAoB,GAAG,MAAM,IAAA,sBAAM,EAAC,2BAAe,CAAC,uBAAuB,CAAC,CAAC;YACvG,OAAO,qBAAqB,CAAC,oBAAoB,CAAC;QACtD,CAAC;KAAA;IAEM,MAAM,CAAO,kBAAkB;;YAClC,IAAI,CAAC,qBAAqB,CAAC,eAAe;gBACtC,qBAAqB,CAAC,eAAe,GAAG,MAAM,IAAA,sBAAM,EAAC,2BAAe,CAAC,wBAAwB,CAAC,CAAC;YACnG,OAAO,qBAAqB,CAAC,eAAe,CAAC;QACjD,CAAC;KAAA;CACJ;AApCD,sDAoCC"}
|
package/package.json
CHANGED
|
@@ -2,24 +2,39 @@ import { commonAppConfig } from "../appConfig";
|
|
|
2
2
|
import { getKey } from "../../lib/azure/azureKeyVault";
|
|
3
3
|
|
|
4
4
|
export class AppConfigKeyRetriever {
|
|
5
|
+
private static swaggerAdminRoleApiKey: string;
|
|
6
|
+
private static publicJwtSecret: string;
|
|
7
|
+
private static internalJwtSecret: string;
|
|
8
|
+
private static sendgridClientSecret: string;
|
|
9
|
+
private static redisConnection: string;
|
|
5
10
|
|
|
6
11
|
public static async getSwaggerAdminRoleApiKey(): Promise<string> {
|
|
7
|
-
|
|
12
|
+
if (!AppConfigKeyRetriever.swaggerAdminRoleApiKey)
|
|
13
|
+
AppConfigKeyRetriever.swaggerAdminRoleApiKey = await getKey(commonAppConfig.SwaggerAdminRoleApiKey);
|
|
14
|
+
return AppConfigKeyRetriever.swaggerAdminRoleApiKey;
|
|
8
15
|
}
|
|
9
16
|
|
|
10
17
|
public static async getPublicJwtSecret(): Promise<string> {
|
|
11
|
-
|
|
18
|
+
if (!AppConfigKeyRetriever.publicJwtSecret)
|
|
19
|
+
AppConfigKeyRetriever.publicJwtSecret = await getKey(commonAppConfig.PublicJwtSecret);
|
|
20
|
+
return AppConfigKeyRetriever.publicJwtSecret;
|
|
12
21
|
}
|
|
13
22
|
|
|
14
23
|
public static async getInternalJwtSecret(): Promise<string> {
|
|
15
|
-
|
|
24
|
+
if (!AppConfigKeyRetriever.internalJwtSecret)
|
|
25
|
+
AppConfigKeyRetriever.internalJwtSecret = await getKey(commonAppConfig.InternalJwtSecret);
|
|
26
|
+
return AppConfigKeyRetriever.internalJwtSecret;
|
|
16
27
|
}
|
|
17
28
|
|
|
18
29
|
public static async getSendgridClientSecret(): Promise<string> {
|
|
19
|
-
|
|
30
|
+
if (!AppConfigKeyRetriever.sendgridClientSecret)
|
|
31
|
+
AppConfigKeyRetriever.sendgridClientSecret = await getKey(commonAppConfig.SendgridClientSecretKey);
|
|
32
|
+
return AppConfigKeyRetriever.sendgridClientSecret;
|
|
20
33
|
}
|
|
21
34
|
|
|
22
35
|
public static async getRedisConnection(): Promise<string> {
|
|
23
|
-
|
|
36
|
+
if (!AppConfigKeyRetriever.redisConnection)
|
|
37
|
+
AppConfigKeyRetriever.redisConnection = await getKey(commonAppConfig.RedisConnectionConfigKey);
|
|
38
|
+
return AppConfigKeyRetriever.redisConnection;
|
|
24
39
|
}
|
|
25
40
|
}
|