@buka/nestjs-kit 4.1.7 → 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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.1.8](https://github.com/buka-ltd/npm.nestjs-kit/compare/v4.1.7...v4.1.8) (2026-05-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * 修复dek缓存返回原始数据被删除后缓存损坏的问题 ([5761659](https://github.com/buka-ltd/npm.nestjs-kit/commit/57616596144eaacb9e9488ed26d441f45ef1d9ac))
9
+
3
10
  ## [4.1.7](https://github.com/buka-ltd/npm.nestjs-kit/compare/v4.1.6...v4.1.7) (2026-05-23)
4
11
 
5
12
 
package/dist/index.js CHANGED
@@ -9490,7 +9490,7 @@ let KmsProvider = _KmsProvider = class KmsProvider {
9490
9490
  const cacheKey = encryptedDek.toString("base64");
9491
9491
  if (ttl > 0) {
9492
9492
  const cached = this.dekCache.get(cacheKey);
9493
- if (cached && cached.expireAt > Date.now()) return Promise.resolve(cached.dek);
9493
+ if (cached && cached.expireAt > Date.now()) return Promise.resolve(Buffer.from(cached.dek));
9494
9494
  const inflight = this.dekDecryptingPromises.get(cacheKey);
9495
9495
  if (inflight) return inflight;
9496
9496
  }
@@ -9507,7 +9507,7 @@ let KmsProvider = _KmsProvider = class KmsProvider {
9507
9507
  });
9508
9508
  const dek = Buffer.from(dekResponse.data.plaintext, "base64");
9509
9509
  if (ttl > 0) this.dekCache.set(cacheKey, {
9510
- dek,
9510
+ dek: Buffer.from(dek),
9511
9511
  expireAt: Date.now() + ttl * 1e3
9512
9512
  });
9513
9513
  return dek;