@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.
Files changed (2) hide show
  1. package/database/mongo.js +39 -24
  2. 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 tlsCAFilePath = path.resolve(process.cwd(), appDefinition.database.documentDB.tlsCAFile);
53
- mongoConfig.tlsCAFile = tlsCAFilePath;
52
+ const tlsCAFile = appDefinition.database.documentDB.tlsCAFile;
54
53
 
55
- console.log('📄 DocumentDB TLS CA file configured:');
56
- console.log(' 📎 Original path:', appDefinition.database.documentDB.tlsCAFile);
57
- console.log(' 📎 Resolved path:', tlsCAFilePath);
58
- console.log(' 📄 File exists:', fs.existsSync(tlsCAFilePath));
59
-
60
- // List current directory contents for debugging
61
- try {
62
- console.log('📁 Current directory contents:');
63
- fs.readdirSync(process.cwd()).forEach(item => {
64
- const stats = fs.statSync(path.join(process.cwd(), item));
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
- // Check if security directory exists
69
- const securityDir = path.join(process.cwd(), 'security');
70
- if (fs.existsSync(securityDir)) {
71
- console.log('📁 Security directory contents:');
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.log('❌ Security directory does not exist at:', securityDir);
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.e387a34.0",
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.e387a34.0",
26
- "@friggframework/prettier-config": "2.0.0--canary.419.e387a34.0",
27
- "@friggframework/test": "2.0.0--canary.419.e387a34.0",
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": "e387a348fdc21f44aacf0ead206444dfd07dec90"
59
+ "gitHead": "daed467862dc5acc37b4dd9e48ea62444da598be"
60
60
  }