@pikku/mongodb 0.12.20 → 0.12.21

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,29 @@
1
1
  # @pikku/mongodb
2
2
 
3
+ ## 0.12.21
4
+
5
+ ### Patch Changes
6
+
7
+ - 4450b2a: Name the missing key when a secret is not found.
8
+
9
+ Every `SecretService` threw a bare `Requested secret not found`. In a deployed
10
+ runtime the stack is minified, so the message was the only evidence there was —
11
+ and it identified neither the key nor the service. Each implementation now names
12
+ the key it looked for; the better-auth middlewares that skip on an absent secret
13
+ match the prefix through one shared predicate instead of the whole string.
14
+
15
+ - Updated dependencies [4058c3a]
16
+ - Updated dependencies [4058c3a]
17
+ - Updated dependencies [4058c3a]
18
+ - Updated dependencies [4058c3a]
19
+ - Updated dependencies [4058c3a]
20
+ - Updated dependencies [4058c3a]
21
+ - Updated dependencies [114c079]
22
+ - Updated dependencies [4450b2a]
23
+ - Updated dependencies [4058c3a]
24
+ - Updated dependencies [4058c3a]
25
+ - @pikku/core@0.12.93
26
+
3
27
  ## 0.12.20
4
28
 
5
29
  ### Patch Changes
@@ -71,7 +71,7 @@ export class MongoDBSecretService {
71
71
  async getSecret(key) {
72
72
  const row = await this.secrets.findOne({ _id: key });
73
73
  if (!row)
74
- throw new Error('Requested secret not found');
74
+ throw new Error(`Requested secret not found: ${key}`);
75
75
  const kek = await this.getKEK(row.keyVersion);
76
76
  const result = await envelopeDecrypt(kek, row.ciphertext, row.wrappedDek);
77
77
  await this.logAudit(key, 'read');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/mongodb",
3
- "version": "0.12.20",
3
+ "version": "0.12.21",
4
4
  "description": "MongoDB services for Pikku — workflow state, agent runs, secrets and channel stores",
5
5
  "author": "yasser.fadl@gmail.com",
6
6
  "license": "MIT",
@@ -18,7 +18,7 @@
18
18
  "prepublishOnly": "yarn build"
19
19
  },
20
20
  "peerDependencies": {
21
- "@pikku/core": "^0.12.90"
21
+ "@pikku/core": "^0.12.93"
22
22
  },
23
23
  "dependencies": {
24
24
  "mongodb": "^7.5.0"
@@ -128,7 +128,7 @@ export class MongoDBSecretService implements SecretService {
128
128
 
129
129
  async getSecret<T = string>(key: string): Promise<SecretValue<T>> {
130
130
  const row = await this.secrets.findOne({ _id: key })
131
- if (!row) throw new Error('Requested secret not found')
131
+ if (!row) throw new Error(`Requested secret not found: ${key}`)
132
132
 
133
133
  const kek = await this.getKEK(row.keyVersion)
134
134
  const result = await envelopeDecrypt<T>(kek, row.ciphertext, row.wrappedDek)