ml-testing-toolkit 18.14.0 → 18.14.1
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 +7 -0
- package/package.json +1 -1
- package/src/lib/config.js +5 -5
- package/src/lib/db/adapters/dbAdapter.js +2 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
# Changelog: [mojaloop/thirdparty-api-svc](https://github.com/mojaloop/thirdparty-api-svc)
|
|
2
|
+
### [18.14.1](https://github.com/mojaloop/ml-testing-toolkit/compare/v18.14.0...v18.14.1) (2025-08-06)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* fix mongo tls argument ([#334](https://github.com/mojaloop/ml-testing-toolkit/issues/334)) ([69b16bc](https://github.com/mojaloop/ml-testing-toolkit/commit/69b16bcacea2ae31de0e49f40fa4fa4853ddfac0))
|
|
8
|
+
|
|
2
9
|
## [18.14.0](https://github.com/mojaloop/ml-testing-toolkit/compare/v18.13.2...v18.14.0) (2025-08-05)
|
|
3
10
|
|
|
4
11
|
|
package/package.json
CHANGED
package/src/lib/config.js
CHANGED
|
@@ -106,14 +106,14 @@ const _getSecretsFromEnvironment = () => {
|
|
|
106
106
|
process.env.REPORTING_DB_CONNECTION_STRING ||
|
|
107
107
|
process.env.REPORTING_DB_SSL_ENABLED ||
|
|
108
108
|
process.env.REPORTING_DB_SSL_VERIFY ||
|
|
109
|
-
process.env.
|
|
109
|
+
process.env.REPORTING_DB_SSL_CA_FILE_PATH
|
|
110
110
|
) {
|
|
111
111
|
try {
|
|
112
112
|
const reportingDbConnectionPassword = process.env.REPORTING_DB_CONNECTION_PASSWORD
|
|
113
113
|
const reportingDbConnectionString = process.env.REPORTING_DB_CONNECTION_STRING
|
|
114
114
|
const reportingDbSslEnabled = process.env.REPORTING_DB_SSL_ENABLED === 'true'
|
|
115
115
|
const reportingDbSslVerify = process.env.REPORTING_DB_SSL_VERIFY !== 'false'
|
|
116
|
-
const reportingDbSslCa = process.env.
|
|
116
|
+
const reportingDbSslCa = process.env.REPORTING_DB_SSL_CA_FILE_PATH
|
|
117
117
|
|
|
118
118
|
secretsFromEnvironment.DB = {
|
|
119
119
|
PASSWORD: reportingDbConnectionPassword,
|
|
@@ -123,18 +123,18 @@ const _getSecretsFromEnvironment = () => {
|
|
|
123
123
|
if (
|
|
124
124
|
process.env.REPORTING_DB_SSL_ENABLED ||
|
|
125
125
|
process.env.REPORTING_DB_SSL_VERIFY ||
|
|
126
|
-
process.env.
|
|
126
|
+
process.env.REPORTING_DB_SSL_CA_FILE_PATH
|
|
127
127
|
) {
|
|
128
128
|
secretsFromEnvironment.DB.SSL_ENABLED = reportingDbSslEnabled
|
|
129
129
|
secretsFromEnvironment.DB.SSL_VERIFY = reportingDbSslVerify
|
|
130
130
|
if (reportingDbSslCa) {
|
|
131
|
-
secretsFromEnvironment.DB.
|
|
131
|
+
secretsFromEnvironment.DB.SSL_CA_FILE_PATH = reportingDbSslCa
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
// Hide CA from being logged
|
|
136
136
|
const logSecrets = _.cloneDeep(secretsFromEnvironment)
|
|
137
|
-
if (logSecrets.DB && logSecrets.DB.
|
|
137
|
+
if (logSecrets.DB && logSecrets.DB.SSL_CA_FILE_PATH) logSecrets.DB.SSL_CA_FILE_PATH = mask(logSecrets.DB.SSL_CA_FILE_PATH)
|
|
138
138
|
if (logSecrets.DB && logSecrets.DB.PASSWORD) logSecrets.DB.PASSWORD = mask(logSecrets.DB.PASSWORD)
|
|
139
139
|
if (logSecrets.DB && logSecrets.DB.CONNECTION_STRING) logSecrets.DB.CONNECTION_STRING = mask(logSecrets.DB.CONNECTION_STRING)
|
|
140
140
|
console.log('Secrets retrieved from environment to be merged into system config', logSecrets)
|
|
@@ -59,23 +59,8 @@ const getConnection = async () => {
|
|
|
59
59
|
console.log(`SSL_VERIFY is set to ${systemConfig.DB.SSL_VERIFY} (type: ${typeof systemConfig.DB.SSL_VERIFY})`)
|
|
60
60
|
mongoOptions.tlsAllowInvalidCertificates = !systemConfig.DB.SSL_VERIFY
|
|
61
61
|
}
|
|
62
|
-
if (systemConfig.DB.
|
|
63
|
-
|
|
64
|
-
let ca = systemConfig.DB.SSL_CA
|
|
65
|
-
if (typeof ca === 'string') {
|
|
66
|
-
// If comma-separated, split into array
|
|
67
|
-
if (ca.includes(',')) {
|
|
68
|
-
ca = ca.split(',').map(s => s.trim())
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
// Convert to Buffer(s) if needed
|
|
72
|
-
if (Array.isArray(ca)) {
|
|
73
|
-
ca = ca.map(item => Buffer.isBuffer(item) ? item : Buffer.from(item))
|
|
74
|
-
} else if (!Buffer.isBuffer(ca)) {
|
|
75
|
-
ca = Buffer.from(ca)
|
|
76
|
-
}
|
|
77
|
-
// Mongoose expects tlsCAFile as a Buffer or array of Buffers
|
|
78
|
-
mongoOptions.tlsCAFile = ca
|
|
62
|
+
if (systemConfig.DB.SSL_CA_FILE_PATH) {
|
|
63
|
+
mongoOptions.tlsCAFile = systemConfig.DB.SSL_CA_FILE_PATH
|
|
79
64
|
}
|
|
80
65
|
}
|
|
81
66
|
|