@pikku/mongodb 0.12.2 → 0.12.3
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 +24 -0
- package/dist/src/mongodb-secret-service.js +1 -1
- package/dist/src/mongodb-workflow-service.js +3 -0
- package/dist/src/pikku-mongodb.js +1 -1
- package/package.json +2 -2
- package/src/mongodb-secret-service.ts +1 -1
- package/src/mongodb-workflow-service.ts +3 -0
- package/src/pikku-mongodb.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @pikku/mongodb
|
|
2
2
|
|
|
3
|
+
## 0.12.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a2ee6d0: Replace process.exit(1) with thrown error on MongoDB connection failure to allow graceful error handling.
|
|
8
|
+
- 87433f0: Validate state key names in updateRunState to prevent MongoDB operator injection.
|
|
9
|
+
- Updated dependencies [e412b4d]
|
|
10
|
+
- Updated dependencies [53dc8c8]
|
|
11
|
+
- Updated dependencies [0a1cc51]
|
|
12
|
+
- Updated dependencies [0a1cc51]
|
|
13
|
+
- Updated dependencies [0a1cc51]
|
|
14
|
+
- Updated dependencies [0a1cc51]
|
|
15
|
+
- Updated dependencies [0a1cc51]
|
|
16
|
+
- Updated dependencies [0a1cc51]
|
|
17
|
+
- Updated dependencies [0a1cc51]
|
|
18
|
+
- Updated dependencies [0a1cc51]
|
|
19
|
+
- Updated dependencies [0a1cc51]
|
|
20
|
+
- Updated dependencies [8b9b2e9]
|
|
21
|
+
- Updated dependencies [8b9b2e9]
|
|
22
|
+
- Updated dependencies [b973d44]
|
|
23
|
+
- Updated dependencies [8b9b2e9]
|
|
24
|
+
- Updated dependencies [8b9b2e9]
|
|
25
|
+
- @pikku/core@0.12.9
|
|
26
|
+
|
|
3
27
|
## 0.12.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -50,7 +50,7 @@ export class MongoDBSecretService {
|
|
|
50
50
|
async getSecret(key) {
|
|
51
51
|
const row = await this.secrets.findOne({ _id: key });
|
|
52
52
|
if (!row)
|
|
53
|
-
throw new Error(
|
|
53
|
+
throw new Error('Requested secret not found');
|
|
54
54
|
const kek = this.getKEK(row.keyVersion);
|
|
55
55
|
const result = await envelopeDecrypt(kek, row.ciphertext, row.wrappedDek);
|
|
56
56
|
await this.logAudit(key, 'read');
|
|
@@ -311,6 +311,9 @@ export class MongoDBWorkflowService extends PikkuWorkflowService {
|
|
|
311
311
|
await this.steps.updateOne({ _id: stepId }, { $set: { branchTaken: branchKey, updatedAt: new Date() } });
|
|
312
312
|
}
|
|
313
313
|
async updateRunState(runId, name, value) {
|
|
314
|
+
if (!/^[a-zA-Z0-9_]+$/.test(name)) {
|
|
315
|
+
throw new Error('Invalid state key name');
|
|
316
|
+
}
|
|
314
317
|
await this.runs.updateOne({ _id: runId }, {
|
|
315
318
|
$set: {
|
|
316
319
|
[`state.${name}`]: value,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/mongodb",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"author": "yasser.fadl@gmail.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/src/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"prepublishOnly": "yarn build"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@pikku/core": "^0.12.
|
|
20
|
+
"@pikku/core": "^0.12.9"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"mongodb": "^6.12.0"
|
|
@@ -89,7 +89,7 @@ export class MongoDBSecretService implements SecretService {
|
|
|
89
89
|
|
|
90
90
|
async getSecret(key: string): Promise<string> {
|
|
91
91
|
const row = await this.secrets.findOne({ _id: key })
|
|
92
|
-
if (!row) throw new Error(
|
|
92
|
+
if (!row) throw new Error('Requested secret not found')
|
|
93
93
|
|
|
94
94
|
const kek = this.getKEK(row.keyVersion)
|
|
95
95
|
const result = await envelopeDecrypt<string>(
|
|
@@ -515,6 +515,9 @@ export class MongoDBWorkflowService extends PikkuWorkflowService {
|
|
|
515
515
|
name: string,
|
|
516
516
|
value: unknown
|
|
517
517
|
): Promise<void> {
|
|
518
|
+
if (!/^[a-zA-Z0-9_]+$/.test(name)) {
|
|
519
|
+
throw new Error('Invalid state key name')
|
|
520
|
+
}
|
|
518
521
|
await this.runs.updateOne(
|
|
519
522
|
{ _id: runId },
|
|
520
523
|
{
|