cprime-supergateway 3.4.4 → 3.4.5
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.
|
@@ -11,14 +11,16 @@ import { EncryptionService } from '../services/encryptionService.js';
|
|
|
11
11
|
import { initMongoClient } from '../lib/initMongoClient.js';
|
|
12
12
|
import { McpServerLogRepository } from '../lib/mcpServerLogRepository.js';
|
|
13
13
|
const encryptionService = new EncryptionService('env');
|
|
14
|
-
const plaintext = await encryptionService.decryptText(process.env.ENCRYPTED_ENV ?? '', process.env.AAD_JSON ? JSON.parse(process.env.AAD_JSON) : {});
|
|
15
14
|
let decryptedEnvs = {};
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
if (process.env.ENCRYPTED_ENV) {
|
|
16
|
+
const plaintext = await encryptionService.decryptText(process.env.ENCRYPTED_ENV, process.env.AAD_JSON ? JSON.parse(process.env.AAD_JSON) : {});
|
|
17
|
+
try {
|
|
18
|
+
const asObj = JSON.parse(plaintext);
|
|
19
|
+
decryptedEnvs = asObj;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
console.error('Failed to parse decrypted envs', plaintext);
|
|
23
|
+
}
|
|
22
24
|
}
|
|
23
25
|
const setResponseHeaders = ({ res, headers, }) => Object.entries(headers).forEach(([key, value]) => {
|
|
24
26
|
res.setHeader(key, value);
|
package/package.json
CHANGED
|
@@ -26,16 +26,18 @@ export interface StdioToSseArgs {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const encryptionService = new EncryptionService('env')
|
|
29
|
-
const plaintext = await encryptionService.decryptText(
|
|
30
|
-
process.env.ENCRYPTED_ENV ?? '',
|
|
31
|
-
process.env.AAD_JSON ? JSON.parse(process.env.AAD_JSON) : {},
|
|
32
|
-
)
|
|
33
29
|
let decryptedEnvs = {}
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
if (process.env.ENCRYPTED_ENV) {
|
|
31
|
+
const plaintext = await encryptionService.decryptText(
|
|
32
|
+
process.env.ENCRYPTED_ENV,
|
|
33
|
+
process.env.AAD_JSON ? JSON.parse(process.env.AAD_JSON) : {},
|
|
34
|
+
)
|
|
35
|
+
try {
|
|
36
|
+
const asObj = JSON.parse(plaintext)
|
|
37
|
+
decryptedEnvs = asObj
|
|
38
|
+
} catch {
|
|
39
|
+
console.error('Failed to parse decrypted envs', plaintext)
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
const setResponseHeaders = ({
|
|
File without changes
|