@diia-inhouse/env 1.16.0 → 2.8.0
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.
- package/LICENCE.md +59 -59
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/index.js +2 -1
- package/dist/interfaces/index.js.map +1 -1
- package/dist/services/env.js +90 -62
- package/dist/services/env.js.map +1 -1
- package/dist/types/interfaces/index.d.ts +17 -1
- package/dist/types/services/env.d.ts +19 -17
- package/package.json +28 -40
package/LICENCE.md
CHANGED
|
@@ -18,40 +18,40 @@ or has expressed by any other means his willingness to license under the EUPL.
|
|
|
18
18
|
|
|
19
19
|
In this Licence, the following terms have the following meaning:
|
|
20
20
|
|
|
21
|
-
-
|
|
21
|
+
- ‘The Licence’: this Licence.
|
|
22
22
|
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
- ‘The Original Work’: the work or software distributed or communicated by the
|
|
24
|
+
Licensor under this Licence, available as Source Code and also as Executable
|
|
25
|
+
Code as the case may be.
|
|
26
26
|
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
- ‘Derivative Works’: the works or software that could be created by the
|
|
28
|
+
Licensee, based upon the Original Work or modifications thereof. This Licence
|
|
29
|
+
does not define the extent of modification or dependence on the Original Work
|
|
30
|
+
required in order to classify a work as a Derivative Work; this extent is
|
|
31
|
+
determined by copyright law applicable in the country mentioned in Article 15.
|
|
32
32
|
|
|
33
|
-
-
|
|
33
|
+
- ‘The Work’: the Original Work or its Derivative Works.
|
|
34
34
|
|
|
35
|
-
-
|
|
36
|
-
|
|
35
|
+
- ‘The Source Code’: the human-readable form of the Work which is the most
|
|
36
|
+
convenient for people to study and modify.
|
|
37
37
|
|
|
38
|
-
-
|
|
39
|
-
|
|
38
|
+
- ‘The Executable Code’: any code which has generally been compiled and which is
|
|
39
|
+
meant to be interpreted by a computer as a program.
|
|
40
40
|
|
|
41
|
-
-
|
|
42
|
-
|
|
41
|
+
- ‘The Licensor’: the natural or legal person that distributes or communicates
|
|
42
|
+
the Work under the Licence.
|
|
43
43
|
|
|
44
|
-
-
|
|
45
|
-
|
|
44
|
+
- ‘Contributor(s)’: any natural or legal person who modifies the Work under the
|
|
45
|
+
Licence, or otherwise contributes to the creation of a Derivative Work.
|
|
46
46
|
|
|
47
|
-
-
|
|
48
|
-
|
|
47
|
+
- ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
|
|
48
|
+
the Work under the terms of the Licence.
|
|
49
49
|
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
- ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
|
|
51
|
+
renting, distributing, communicating, transmitting, or otherwise making
|
|
52
|
+
available, online or offline, copies of the Work or providing access to its
|
|
53
|
+
essential functionalities at the disposal of any other natural or legal
|
|
54
|
+
person.
|
|
55
55
|
|
|
56
56
|
2. Scope of the rights granted by the Licence
|
|
57
57
|
|
|
@@ -59,15 +59,15 @@ The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
|
|
59
59
|
sublicensable licence to do the following, for the duration of copyright vested
|
|
60
60
|
in the Original Work:
|
|
61
61
|
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
62
|
+
- use the Work in any circumstance and for all usage,
|
|
63
|
+
- reproduce the Work,
|
|
64
|
+
- modify the Work, and make Derivative Works based upon the Work,
|
|
65
|
+
- communicate to the public, including the right to make available or display
|
|
66
|
+
the Work or copies thereof to the public and perform publicly, as the case may
|
|
67
|
+
be, the Work,
|
|
68
|
+
- distribute the Work or copies thereof,
|
|
69
|
+
- lend and rent the Work or copies thereof,
|
|
70
|
+
- sublicense rights in the Work or copies thereof.
|
|
71
71
|
|
|
72
72
|
Those rights can be exercised on any media, supports and formats, whether now
|
|
73
73
|
known or later invented, as far as the applicable law permits so.
|
|
@@ -240,43 +240,43 @@ their choice.
|
|
|
240
240
|
|
|
241
241
|
Without prejudice to specific agreement between parties,
|
|
242
242
|
|
|
243
|
-
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
- any litigation resulting from the interpretation of this License, arising
|
|
244
|
+
between the European Union institutions, bodies, offices or agencies, as a
|
|
245
|
+
Licensor, and any Licensee, will be subject to the jurisdiction of the Court
|
|
246
|
+
of Justice of the European Union, as laid down in article 272 of the Treaty on
|
|
247
|
+
the Functioning of the European Union,
|
|
248
248
|
|
|
249
|
-
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
249
|
+
- any litigation arising between other parties and resulting from the
|
|
250
|
+
interpretation of this License, will be subject to the exclusive jurisdiction
|
|
251
|
+
of the competent court where the Licensor resides or conducts its primary
|
|
252
|
+
business.
|
|
253
253
|
|
|
254
254
|
15. Applicable Law
|
|
255
255
|
|
|
256
256
|
Without prejudice to specific agreement between parties,
|
|
257
257
|
|
|
258
|
-
-
|
|
259
|
-
|
|
258
|
+
- this Licence shall be governed by the law of the European Union Member State
|
|
259
|
+
where the Licensor has his seat, resides or has his registered office,
|
|
260
260
|
|
|
261
|
-
-
|
|
262
|
-
|
|
261
|
+
- this licence shall be governed by Belgian law if the Licensor has no seat,
|
|
262
|
+
residence or registered office inside a European Union Member State.
|
|
263
263
|
|
|
264
264
|
Appendix
|
|
265
265
|
|
|
266
266
|
‘Compatible Licences’ according to Article 5 EUPL are:
|
|
267
267
|
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
276
|
-
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
|
|
268
|
+
- GNU General Public License (GPL) v. 2, v. 3
|
|
269
|
+
- GNU Affero General Public License (AGPL) v. 3
|
|
270
|
+
- Open Software License (OSL) v. 2.1, v. 3.0
|
|
271
|
+
- Eclipse Public License (EPL) v. 1.0
|
|
272
|
+
- CeCILL v. 2.0, v. 2.1
|
|
273
|
+
- Mozilla Public Licence (MPL) v. 2
|
|
274
|
+
- GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
|
|
275
|
+
- Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
|
|
276
|
+
works other than software
|
|
277
|
+
- European Union Public Licence (EUPL) v. 1.1, v. 1.2
|
|
278
|
+
- Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
|
|
279
|
+
Reciprocity (LiLiQ-R+).
|
|
280
280
|
|
|
281
281
|
The European Commission may update this Appendix to later versions of the above
|
|
282
282
|
licences without producing a new version of the EUPL, as long as they provide
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const dotenv_flow_1 = require("dotenv-flow");
|
|
18
|
+
(0, dotenv_flow_1.config)({ silent: true });
|
|
17
19
|
__exportStar(require("./interfaces"), exports);
|
|
18
20
|
__exportStar(require("./services"), exports);
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAE5B,6CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAAoC;AAEpC,IAAA,oBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;AAExB,+CAA4B;AAE5B,6CAA0B"}
|
package/dist/interfaces/index.js
CHANGED
|
@@ -5,8 +5,9 @@ var Env;
|
|
|
5
5
|
(function (Env) {
|
|
6
6
|
Env["Local"] = "local";
|
|
7
7
|
Env["Test"] = "test";
|
|
8
|
-
Env["Stage"] = "stage";
|
|
9
8
|
Env["Dev"] = "dev";
|
|
9
|
+
Env["Sandbox"] = "sandbox";
|
|
10
|
+
Env["Stage"] = "stage";
|
|
10
11
|
Env["Prod"] = "prod";
|
|
11
12
|
})(Env || (exports.Env = Env = {}));
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,IAAY,GAOX;AAPD,WAAY,GAAG;IACX,sBAAe,CAAA;IACf,oBAAa,CAAA;IACb,kBAAW,CAAA;IACX,0BAAmB,CAAA;IACnB,sBAAe,CAAA;IACf,oBAAa,CAAA;AACjB,CAAC,EAPW,GAAG,mBAAH,GAAG,QAOd"}
|
package/dist/services/env.js
CHANGED
|
@@ -8,13 +8,15 @@ const promises_1 = __importDefault(require("node:fs/promises"));
|
|
|
8
8
|
const promises_2 = require("node:timers/promises");
|
|
9
9
|
const lodash_get_1 = __importDefault(require("lodash.get"));
|
|
10
10
|
const node_vault_1 = __importDefault(require("node-vault"));
|
|
11
|
+
const types_1 = require("@diia-inhouse/types");
|
|
11
12
|
const interfaces_1 = require("../interfaces");
|
|
12
13
|
const metrics_1 = require("../metrics");
|
|
13
14
|
class EnvService {
|
|
14
15
|
logger;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
kubernetesPath = 'kubernetes';
|
|
17
|
+
isVaultEnabled = EnvService.getVar('VAULT_ENABLED', 'boolean', false);
|
|
18
|
+
renewalLeaseLifetime = EnvService.getVar('VAULT_RENEWAL_LEASE_LIFETIME', 'number', 0.6);
|
|
19
|
+
renewalMaxDelay = EnvService.getVar('VAULT_RENEWAL_MAX_DELAY', 'number', types_1.DurationMs.Minute);
|
|
18
20
|
rawSecrets = new Map();
|
|
19
21
|
vault = null;
|
|
20
22
|
constructor(logger) {
|
|
@@ -22,17 +24,46 @@ class EnvService {
|
|
|
22
24
|
if (!this.isVaultEnabled) {
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
25
|
-
this.vault = (0, node_vault_1.default)({ apiVersion: 'v1', endpoint:
|
|
27
|
+
this.vault = (0, node_vault_1.default)({ apiVersion: 'v1', endpoint: EnvService.getVar('VAULT_ADDR') });
|
|
28
|
+
}
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
static getVar(name, type = 'string', defaultValue) {
|
|
31
|
+
const value = process.env[name];
|
|
32
|
+
if (!value) {
|
|
33
|
+
if (defaultValue || defaultValue !== undefined) {
|
|
34
|
+
return defaultValue;
|
|
35
|
+
}
|
|
36
|
+
throw new Error(`Env variable ${name} is not defined`);
|
|
37
|
+
}
|
|
38
|
+
if (type === 'string') {
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const parsedValue = JSON.parse(value);
|
|
43
|
+
if (typeof parsedValue !== type) {
|
|
44
|
+
throw new TypeError(`Unexpected typeof ${name} variable; Current typeof ${typeof parsedValue}`);
|
|
45
|
+
}
|
|
46
|
+
return parsedValue;
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
throw new Error(`Error while parsing ${name} variable. Current value: ${value}; ${err}`);
|
|
50
|
+
}
|
|
26
51
|
}
|
|
27
52
|
async init() {
|
|
28
53
|
if (!this.vault) {
|
|
29
54
|
return;
|
|
30
55
|
}
|
|
31
56
|
try {
|
|
32
|
-
const tokenPath =
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
const
|
|
57
|
+
const tokenPath = EnvService.getVar('KUBERNETES_TOKEN_PATH', 'string', '/var/run/secrets/kubernetes.io/serviceaccount/token');
|
|
58
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
59
|
+
const k8sToken = await promises_1.default.readFile(tokenPath, 'utf8'); // nosemgrep: eslint.detect-non-literal-fs-filename
|
|
60
|
+
const loginResult = await this.vault.kubernetesLogin({
|
|
61
|
+
jwt: k8sToken,
|
|
62
|
+
kubernetesPath: this.kubernetesPath,
|
|
63
|
+
role: EnvService.getVar('VAULT_ROLE'),
|
|
64
|
+
});
|
|
65
|
+
const { auth: { client_token: token, lease_duration: leaseDuration, accessor, service_account_name }, } = loginResult;
|
|
66
|
+
this.logger = this.logger.child({ vaultServiceAccountName: service_account_name });
|
|
36
67
|
this.logger.info('Vault token accessor', { accessor });
|
|
37
68
|
this.vault.token = token;
|
|
38
69
|
this.scheduleTokenRenewal(leaseDuration);
|
|
@@ -42,9 +73,12 @@ class EnvService {
|
|
|
42
73
|
throw err;
|
|
43
74
|
}
|
|
44
75
|
}
|
|
76
|
+
async onDestroy() {
|
|
77
|
+
await this.revokeToken();
|
|
78
|
+
}
|
|
45
79
|
async getSecret(envName, ops = {}) {
|
|
46
80
|
const { accessor = `data.${envName}`, nullable } = ops;
|
|
47
|
-
const envValue =
|
|
81
|
+
const envValue = EnvService.getVar(envName, 'string', nullable ? null : undefined);
|
|
48
82
|
if (!this.vault) {
|
|
49
83
|
return envValue;
|
|
50
84
|
}
|
|
@@ -68,7 +102,50 @@ class EnvService {
|
|
|
68
102
|
throw err;
|
|
69
103
|
}
|
|
70
104
|
}
|
|
71
|
-
async
|
|
105
|
+
async getTransitKey(keyId, ops = {}) {
|
|
106
|
+
const { keyVersion } = ops;
|
|
107
|
+
if (!this.vault) {
|
|
108
|
+
throw new Error('Vault is not initialized. Failed to get transit key');
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
const vaultPath = keyVersion ? `${keyId}/${keyVersion}` : keyId;
|
|
112
|
+
const { data } = await this.vault.read(vaultPath);
|
|
113
|
+
const keyVersions = Object.keys(data.keys);
|
|
114
|
+
const highestKeyVersion = keyVersions.sort((a, b) => Number(b) - Number(a))[0];
|
|
115
|
+
if (!highestKeyVersion) {
|
|
116
|
+
throw new Error(`No key versions found for key ${keyId}`);
|
|
117
|
+
}
|
|
118
|
+
const key = data.keys[Number(highestKeyVersion)];
|
|
119
|
+
const fullKeyName = `${keyId}/${highestKeyVersion}`;
|
|
120
|
+
return { fullKeyName, key };
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
this.logger.error('Failed to get transit key', { err, path: keyId });
|
|
124
|
+
throw err;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
isLocal() {
|
|
128
|
+
return this.getEnv() === interfaces_1.Env.Local;
|
|
129
|
+
}
|
|
130
|
+
isTest() {
|
|
131
|
+
return this.getEnv() === interfaces_1.Env.Test;
|
|
132
|
+
}
|
|
133
|
+
isSandbox() {
|
|
134
|
+
return this.getEnv() === interfaces_1.Env.Sandbox;
|
|
135
|
+
}
|
|
136
|
+
isStage() {
|
|
137
|
+
return this.getEnv() === interfaces_1.Env.Stage;
|
|
138
|
+
}
|
|
139
|
+
isDev() {
|
|
140
|
+
return this.getEnv() === interfaces_1.Env.Dev;
|
|
141
|
+
}
|
|
142
|
+
isProd() {
|
|
143
|
+
return this.getEnv() === interfaces_1.Env.Prod;
|
|
144
|
+
}
|
|
145
|
+
getEnv() {
|
|
146
|
+
return process.env.NODE_ENV;
|
|
147
|
+
}
|
|
148
|
+
async renewToken(retryDelay = types_1.DurationMs.Second) {
|
|
72
149
|
if (!this.vault) {
|
|
73
150
|
return;
|
|
74
151
|
}
|
|
@@ -93,7 +170,7 @@ class EnvService {
|
|
|
93
170
|
await this.renewToken(retryDelay * 2);
|
|
94
171
|
}
|
|
95
172
|
}
|
|
96
|
-
async renewLease(leaseId, retryDelay =
|
|
173
|
+
async renewLease(leaseId, retryDelay = types_1.DurationMs.Second) {
|
|
97
174
|
if (!this.vault) {
|
|
98
175
|
return;
|
|
99
176
|
}
|
|
@@ -125,63 +202,14 @@ class EnvService {
|
|
|
125
202
|
setTimeout(async () => await this.renewLease(leaseId), this.getRenewalDelay(leaseDuration)).unref();
|
|
126
203
|
}
|
|
127
204
|
getRenewalDelay(leaseDurationS) {
|
|
128
|
-
return leaseDurationS *
|
|
129
|
-
}
|
|
130
|
-
async onDestroy() {
|
|
131
|
-
await this.revokeToken();
|
|
132
|
-
}
|
|
133
|
-
// backward compatibility for diia-app <=14. dii-app >14 uses ordered OnDestroy hooks so onBeforeApplicationShutdown is not needed
|
|
134
|
-
async onBeforeApplicationShutdown() {
|
|
135
|
-
await this.revokeToken();
|
|
205
|
+
return leaseDurationS * types_1.DurationMs.Second * this.renewalLeaseLifetime;
|
|
136
206
|
}
|
|
137
207
|
async revokeToken() {
|
|
138
|
-
if (!this.vault
|
|
208
|
+
if (!this.vault) {
|
|
139
209
|
return;
|
|
140
210
|
}
|
|
141
|
-
this.vault.token = '';
|
|
142
211
|
await this.vault.tokenRevokeSelf();
|
|
143
212
|
}
|
|
144
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
145
|
-
getVar(name, type = 'string', defaultValue) {
|
|
146
|
-
const value = process.env[name];
|
|
147
|
-
if (!value) {
|
|
148
|
-
if (defaultValue || defaultValue !== undefined) {
|
|
149
|
-
return defaultValue;
|
|
150
|
-
}
|
|
151
|
-
throw new Error(`Env variable ${name} is not defined`);
|
|
152
|
-
}
|
|
153
|
-
if (type === 'string') {
|
|
154
|
-
return value;
|
|
155
|
-
}
|
|
156
|
-
try {
|
|
157
|
-
const parsedValue = JSON.parse(value);
|
|
158
|
-
if (typeof parsedValue !== type) {
|
|
159
|
-
throw new TypeError(`Unexpected typeof ${name} variable; Current typeof ${typeof parsedValue}`);
|
|
160
|
-
}
|
|
161
|
-
return parsedValue;
|
|
162
|
-
}
|
|
163
|
-
catch (err) {
|
|
164
|
-
throw new Error(`Error while parsing ${name} variable. Current value: ${value}; ${err}`);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
isLocal() {
|
|
168
|
-
return this.getEnv() === interfaces_1.Env.Local;
|
|
169
|
-
}
|
|
170
|
-
isTest() {
|
|
171
|
-
return this.getEnv() === interfaces_1.Env.Test;
|
|
172
|
-
}
|
|
173
|
-
isStage() {
|
|
174
|
-
return this.getEnv() === interfaces_1.Env.Stage;
|
|
175
|
-
}
|
|
176
|
-
isDev() {
|
|
177
|
-
return this.getEnv() === interfaces_1.Env.Dev;
|
|
178
|
-
}
|
|
179
|
-
isProd() {
|
|
180
|
-
return this.getEnv() === interfaces_1.Env.Prod;
|
|
181
|
-
}
|
|
182
|
-
getEnv() {
|
|
183
|
-
return process.env.NODE_ENV;
|
|
184
|
-
}
|
|
185
213
|
}
|
|
186
214
|
exports.EnvService = EnvService;
|
|
187
215
|
//# sourceMappingURL=env.js.map
|
package/dist/services/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/services/env.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAiC;AACjC,mDAA0D;AAE1D,4DAA4B;AAC5B,4DAA8B;
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/services/env.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAiC;AACjC,mDAA0D;AAE1D,4DAA4B;AAC5B,4DAA8B;AAE9B,+CAAmE;AAEnE,8CAAiH;AACjH,wCAAqD;AAErD,MAAa,UAAU;IAaC;IAZH,cAAc,GAAG,YAAY,CAAA;IAE7B,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,eAAe,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;IAErE,oBAAoB,GAAG,UAAU,CAAC,MAAM,CAAC,8BAA8B,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;IAEvF,eAAe,GAAG,UAAU,CAAC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AAC,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA;IACvG,CAAC;IAEO,eAAe,CAAC,cAAsB;QAC1C,OAAO,cAAc,GAAG,kBAAU,CAAC,MAAM,GAAG,IAAI,CAAC,oBAAoB,CAAA;IACzE,CAAC;IAEO,KAAK,CAAC,WAAW;QACrB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACd,OAAM;QACV,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAA;IACtC,CAAC;CACJ;AAnQD,gCAmQC"}
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
export declare enum Env {
|
|
2
2
|
Local = "local",
|
|
3
3
|
Test = "test",
|
|
4
|
-
Stage = "stage",
|
|
5
4
|
Dev = "dev",
|
|
5
|
+
Sandbox = "sandbox",
|
|
6
|
+
Stage = "stage",
|
|
6
7
|
Prod = "prod"
|
|
7
8
|
}
|
|
8
9
|
export interface GetSecretOps {
|
|
9
10
|
accessor?: string;
|
|
10
11
|
nullable?: boolean;
|
|
11
12
|
}
|
|
13
|
+
export type GetTransitKeyResult = {
|
|
14
|
+
keys: Record<number, string>;
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
export type GetTransitKeyReadResult = Record<string, unknown> & {
|
|
19
|
+
data: GetTransitKeyResult;
|
|
20
|
+
};
|
|
21
|
+
export interface GetTransitKeyOps {
|
|
22
|
+
keyVersion?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ProcessedTransitKey {
|
|
25
|
+
fullKeyName: string;
|
|
26
|
+
key: string;
|
|
27
|
+
}
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { Logger,
|
|
2
|
-
import { Env, GetSecretOps } from '../interfaces';
|
|
3
|
-
export declare class EnvService implements OnDestroy
|
|
4
|
-
private
|
|
1
|
+
import { Logger, OnDestroy } from '@diia-inhouse/types';
|
|
2
|
+
import { Env, GetSecretOps, GetTransitKeyOps, ProcessedTransitKey } from '../interfaces';
|
|
3
|
+
export declare class EnvService implements OnDestroy {
|
|
4
|
+
private logger;
|
|
5
|
+
private readonly kubernetesPath;
|
|
5
6
|
private readonly isVaultEnabled;
|
|
6
7
|
private readonly renewalLeaseLifetime;
|
|
7
8
|
private readonly renewalMaxDelay;
|
|
8
9
|
private readonly rawSecrets;
|
|
9
10
|
private vault;
|
|
10
11
|
constructor(logger: Logger);
|
|
12
|
+
static getVar(name: string, type: 'boolean', defaultValue?: boolean | null): boolean;
|
|
13
|
+
static getVar(name: string, type: 'number', defaultValue?: number | null): number;
|
|
14
|
+
static getVar(name: string, type?: 'string', defaultValue?: string | null): string;
|
|
15
|
+
static getVar<T extends unknown[]>(name: string, type: 'object', defaultValue?: T | null): T;
|
|
16
|
+
static getVar<T extends Record<string, unknown>>(name: string, type: 'object', defaultValue?: T | null): T;
|
|
11
17
|
init(): Promise<void>;
|
|
12
|
-
getSecret(envName: string, ops?: GetSecretOps): Promise<string>;
|
|
13
|
-
private renewToken;
|
|
14
|
-
private renewLease;
|
|
15
|
-
private scheduleTokenRenewal;
|
|
16
|
-
private scheduleLeaseRenewal;
|
|
17
|
-
private getRenewalDelay;
|
|
18
18
|
onDestroy(): Promise<void>;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
getVar(name: string, type: 'boolean', defaultValue?: boolean | null): boolean;
|
|
22
|
-
getVar(name: string, type: 'number', defaultValue?: number | null): number;
|
|
23
|
-
getVar(name: string, type?: 'string', defaultValue?: string | null): string;
|
|
24
|
-
getVar<T extends unknown[]>(name: string, type: 'object', defaultValue?: T | null): T;
|
|
25
|
-
getVar<T extends Record<string, unknown>>(name: string, type: 'object', defaultValue?: T | null): T;
|
|
19
|
+
getSecret(envName: string, ops?: GetSecretOps): Promise<string>;
|
|
20
|
+
getTransitKey(keyId: string, ops?: GetTransitKeyOps): Promise<ProcessedTransitKey>;
|
|
26
21
|
isLocal(): boolean;
|
|
27
22
|
isTest(): boolean;
|
|
23
|
+
isSandbox(): boolean;
|
|
28
24
|
isStage(): boolean;
|
|
29
25
|
isDev(): boolean;
|
|
30
26
|
isProd(): boolean;
|
|
31
27
|
getEnv(): Env;
|
|
28
|
+
private renewToken;
|
|
29
|
+
private renewLease;
|
|
30
|
+
private scheduleTokenRenewal;
|
|
31
|
+
private scheduleLeaseRenewal;
|
|
32
|
+
private getRenewalDelay;
|
|
33
|
+
private revokeToken;
|
|
32
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diia-inhouse/env",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Environment checking service",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -11,35 +11,45 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": ">=
|
|
14
|
+
"node": ">=22"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"prebuild": "rimraf dist",
|
|
18
18
|
"build": "tsc",
|
|
19
19
|
"semantic-release": "semantic-release",
|
|
20
20
|
"start": "npm run build && node dist/index.js",
|
|
21
|
-
"lint": "eslint
|
|
22
|
-
"lint-fix": "eslint
|
|
21
|
+
"lint": "eslint . && prettier --check .",
|
|
22
|
+
"lint-fix": "eslint --fix . && prettier --write .",
|
|
23
23
|
"lint:lockfile": "lockfile-lint --path package-lock.json --allowed-hosts registry.npmjs.org --validate-https",
|
|
24
24
|
"prepare": "npm run build",
|
|
25
|
-
"test": "
|
|
26
|
-
"test:
|
|
27
|
-
"test:integration": "npm run test --selectProjects integration --",
|
|
28
|
-
"test:coverage": "npm run test --selectProjects unit --coverage --",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest watch",
|
|
29
27
|
"find-circulars": "madge --circular --extensions ts ./"
|
|
30
28
|
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@diia-inhouse/diia-metrics": "6.4.0",
|
|
31
|
+
"dotenv-flow": "4.1.0",
|
|
32
|
+
"lodash.get": "4.4.2",
|
|
33
|
+
"node-vault": "0.10.9"
|
|
34
|
+
},
|
|
31
35
|
"devDependencies": {
|
|
32
|
-
"@diia-inhouse/configs": "1.
|
|
33
|
-
"@diia-inhouse/diia-logger": "
|
|
34
|
-
"@diia-inhouse/errors": "1.
|
|
35
|
-
"@diia-inhouse/eslint-config": "
|
|
36
|
-
"@diia-inhouse/test": "
|
|
37
|
-
"@diia-inhouse/types": "
|
|
36
|
+
"@diia-inhouse/configs": "6.1.1",
|
|
37
|
+
"@diia-inhouse/diia-logger": "3.16.0",
|
|
38
|
+
"@diia-inhouse/errors": "1.17.0",
|
|
39
|
+
"@diia-inhouse/eslint-config": "8.2.4",
|
|
40
|
+
"@diia-inhouse/test": "7.2.0",
|
|
41
|
+
"@diia-inhouse/types": "11.3.0",
|
|
42
|
+
"@types/dotenv-flow": "3.3.3",
|
|
38
43
|
"@types/lodash.get": "4.4.9",
|
|
39
|
-
"@types/request": "2.48.
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
44
|
+
"@types/request": "2.48.13",
|
|
45
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
46
|
+
"@vitest/ui": "4.0.18",
|
|
47
|
+
"eslint": "9.39.2",
|
|
48
|
+
"lockfile-lint": "4.14.1",
|
|
49
|
+
"madge": "8.0.0",
|
|
50
|
+
"rimraf": "6.1.3",
|
|
51
|
+
"vite-tsconfig-paths": "6.1.1",
|
|
52
|
+
"vitest": "4.0.18"
|
|
43
53
|
},
|
|
44
54
|
"peerDependencies": {
|
|
45
55
|
"@diia-inhouse/types": ">=4.4.1"
|
|
@@ -53,33 +63,11 @@
|
|
|
53
63
|
"commitlint": {
|
|
54
64
|
"extends": "@diia-inhouse/configs/dist/commitlint"
|
|
55
65
|
},
|
|
56
|
-
"eslintConfig": {
|
|
57
|
-
"extends": "@diia-inhouse/eslint-config",
|
|
58
|
-
"overrides": [
|
|
59
|
-
{
|
|
60
|
-
"files": [
|
|
61
|
-
"*.ts"
|
|
62
|
-
],
|
|
63
|
-
"parserOptions": {
|
|
64
|
-
"project": [
|
|
65
|
-
"./tsconfig.json",
|
|
66
|
-
"./tests/tsconfig.json"
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
66
|
"jest": {
|
|
73
67
|
"preset": "@diia-inhouse/configs/dist/jest"
|
|
74
68
|
},
|
|
75
69
|
"prettier": "@diia-inhouse/eslint-config/prettier",
|
|
76
70
|
"madge": {
|
|
77
71
|
"tsConfig": "./tsconfig.json"
|
|
78
|
-
},
|
|
79
|
-
"dependencies": {
|
|
80
|
-
"@diia-inhouse/diia-metrics": "3.11.0",
|
|
81
|
-
"lodash.get": "4.4.2",
|
|
82
|
-
"node-vault": "0.10.2",
|
|
83
|
-
"protobufjs": "7.2.5"
|
|
84
72
|
}
|
|
85
73
|
}
|