@buka/nestjs-kit 4.1.6 → 4.1.8
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/CHANGELOG.md +14 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9407,7 +9407,7 @@ let KmsProvider = _KmsProvider = class KmsProvider {
|
|
|
9407
9407
|
this.openbao = openbao;
|
|
9408
9408
|
this.options = options;
|
|
9409
9409
|
}
|
|
9410
|
-
async
|
|
9410
|
+
async onApplicationBootstrap() {
|
|
9411
9411
|
const keks = this.options.keks ?? [];
|
|
9412
9412
|
await Promise.all(keks.map((kekId) => this.getOrLoadKekMetadata(kekId)));
|
|
9413
9413
|
const ttl = this.options.dekCacheTtl ?? 0;
|
|
@@ -9462,7 +9462,7 @@ let KmsProvider = _KmsProvider = class KmsProvider {
|
|
|
9462
9462
|
const cacheKey = encryptedDek.toString("base64");
|
|
9463
9463
|
if (ttl > 0) {
|
|
9464
9464
|
const cached = this.dekCache.get(cacheKey);
|
|
9465
|
-
if (cached && cached.expireAt > Date.now()) return Promise.resolve(cached.dek);
|
|
9465
|
+
if (cached && cached.expireAt > Date.now()) return Promise.resolve(Buffer.from(cached.dek));
|
|
9466
9466
|
const inflight = this.dekDecryptingPromises.get(cacheKey);
|
|
9467
9467
|
if (inflight) return inflight;
|
|
9468
9468
|
}
|
|
@@ -9479,7 +9479,7 @@ let KmsProvider = _KmsProvider = class KmsProvider {
|
|
|
9479
9479
|
});
|
|
9480
9480
|
const dek = Buffer.from(dekResponse.data.plaintext, "base64");
|
|
9481
9481
|
if (ttl > 0) this.dekCache.set(cacheKey, {
|
|
9482
|
-
dek,
|
|
9482
|
+
dek: Buffer.from(dek),
|
|
9483
9483
|
expireAt: Date.now() + ttl * 1e3
|
|
9484
9484
|
});
|
|
9485
9485
|
return dek;
|