@friggframework/core 2.0.0--canary.419.e387a34.0 → 2.0.0--canary.419.daed467.0
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/database/mongo.js +39 -24
- package/package.json +5 -5
package/database/mongo.js
CHANGED
|
@@ -49,34 +49,49 @@ if (appDefinition.database?.documentDB?.enable === true) {
|
|
|
49
49
|
|
|
50
50
|
// Set TLS CA file path if specified
|
|
51
51
|
if (appDefinition.database.documentDB.tlsCAFile) {
|
|
52
|
-
const
|
|
53
|
-
mongoConfig.tlsCAFile = tlsCAFilePath;
|
|
52
|
+
const tlsCAFile = appDefinition.database.documentDB.tlsCAFile;
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
console.log('
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
console.log(` ${stats.isDirectory() ? '📁' : '📄'} ${item}`);
|
|
66
|
-
});
|
|
54
|
+
// Basic safety: reject obviously dangerous paths
|
|
55
|
+
if (tlsCAFile.includes('..') || path.isAbsolute(tlsCAFile)) {
|
|
56
|
+
console.warn('⚠️ Rejecting potentially unsafe tlsCAFile path:', tlsCAFile);
|
|
57
|
+
} else {
|
|
58
|
+
const tlsCAFilePath = path.resolve(process.cwd(), tlsCAFile);
|
|
59
|
+
|
|
60
|
+
console.log('📄 DocumentDB TLS CA file configured:');
|
|
61
|
+
console.log(' 📎 Original path:', tlsCAFile);
|
|
62
|
+
console.log(' 📎 Resolved path:', tlsCAFilePath);
|
|
63
|
+
console.log(' 📄 File exists:', fs.existsSync(tlsCAFilePath));
|
|
67
64
|
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
console.log('
|
|
72
|
-
fs.readdirSync(securityDir).forEach(item => {
|
|
73
|
-
console.log(` 📄 ${item}`);
|
|
74
|
-
});
|
|
65
|
+
// Only set tlsCAFile if the file actually exists
|
|
66
|
+
if (fs.existsSync(tlsCAFilePath)) {
|
|
67
|
+
mongoConfig.tlsCAFile = tlsCAFilePath;
|
|
68
|
+
console.log('✅ TLS CA file configured successfully');
|
|
75
69
|
} else {
|
|
76
|
-
console.
|
|
70
|
+
console.error('❌ TLS CA file not found, continuing without certificate');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Debug directory listing (only in development)
|
|
74
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
75
|
+
try {
|
|
76
|
+
console.log('📁 Current directory contents:');
|
|
77
|
+
fs.readdirSync(process.cwd()).forEach(item => {
|
|
78
|
+
const stats = fs.statSync(path.join(process.cwd(), item));
|
|
79
|
+
console.log(` ${stats.isDirectory() ? '📁' : '📄'} ${item}`);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const securityDir = path.join(process.cwd(), 'security');
|
|
83
|
+
if (fs.existsSync(securityDir)) {
|
|
84
|
+
console.log('📁 Security directory contents:');
|
|
85
|
+
fs.readdirSync(securityDir).forEach(item => {
|
|
86
|
+
console.log(` 📄 ${item}`);
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
console.log('❌ Security directory does not exist at:', securityDir);
|
|
90
|
+
}
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.log('❌ Error listing directory contents:', error.message);
|
|
93
|
+
}
|
|
77
94
|
}
|
|
78
|
-
} catch (error) {
|
|
79
|
-
console.log('❌ Error listing directory contents:', error.message);
|
|
80
95
|
}
|
|
81
96
|
}
|
|
82
97
|
} else {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.419.
|
|
4
|
+
"version": "2.0.0--canary.419.daed467.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@hapi/boom": "^10.0.1",
|
|
7
7
|
"aws-sdk": "^2.1200.0",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"uuid": "^9.0.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@friggframework/eslint-config": "2.0.0--canary.419.
|
|
26
|
-
"@friggframework/prettier-config": "2.0.0--canary.419.
|
|
27
|
-
"@friggframework/test": "2.0.0--canary.419.
|
|
25
|
+
"@friggframework/eslint-config": "2.0.0--canary.419.daed467.0",
|
|
26
|
+
"@friggframework/prettier-config": "2.0.0--canary.419.daed467.0",
|
|
27
|
+
"@friggframework/test": "2.0.0--canary.419.daed467.0",
|
|
28
28
|
"@types/lodash": "4.17.15",
|
|
29
29
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
30
30
|
"chai": "^4.3.6",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "daed467862dc5acc37b4dd9e48ea62444da598be"
|
|
60
60
|
}
|