@onlineapps/conn-orch-validator 2.0.25 → 2.0.27
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlineapps/conn-orch-validator",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.27",
|
|
4
4
|
"description": "Validation orchestrator for OA Drive microservices - coordinates validation across all layers (base, infra, orch, business)",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -158,12 +158,18 @@ class CookbookTestRunner {
|
|
|
158
158
|
const endpoint = await this.resolveOperation(step.service, step.operation);
|
|
159
159
|
|
|
160
160
|
// Build request
|
|
161
|
+
// Validation context headers:
|
|
162
|
+
// 1. x-validation-request: signals this is a validation probe (deterministic responses)
|
|
163
|
+
// 2. account-id: required by multitenancy middleware for /api/** endpoints
|
|
164
|
+
const validationAccountId = process.env.OA_VALIDATION_ACCOUNT_ID || '99999';
|
|
161
165
|
const request = {
|
|
162
166
|
method: endpoint.method,
|
|
163
167
|
url: `${this.serviceUrl}${endpoint.path}`,
|
|
164
168
|
data: step.input,
|
|
165
169
|
timeout: testConfig.timeout || this.timeout,
|
|
166
170
|
headers: {
|
|
171
|
+
'x-validation-request': 'true',
|
|
172
|
+
'account-id': validationAccountId,
|
|
167
173
|
...resolveHeaders(endpoint.headers),
|
|
168
174
|
...resolveHeaders(step.headers)
|
|
169
175
|
}
|
|
@@ -214,7 +214,16 @@ class ServiceReadinessValidator {
|
|
|
214
214
|
|
|
215
215
|
// Generate test input based on schema
|
|
216
216
|
const testInput = this.generateTestInput(operation.input);
|
|
217
|
-
|
|
217
|
+
|
|
218
|
+
// Validation context headers:
|
|
219
|
+
// 1. x-validation-request: signals this is a validation probe
|
|
220
|
+
// 2. account-id: required by multitenancy middleware for /api/** endpoints
|
|
221
|
+
const validationAccountId = process.env.OA_VALIDATION_ACCOUNT_ID || '99999';
|
|
222
|
+
const headers = {
|
|
223
|
+
'x-validation-request': 'true',
|
|
224
|
+
'account-id': validationAccountId,
|
|
225
|
+
...resolveHeaders(operation.headers)
|
|
226
|
+
};
|
|
218
227
|
|
|
219
228
|
// Make request
|
|
220
229
|
const response = await axios({
|
package/src/ServiceValidator.js
CHANGED
|
@@ -116,7 +116,11 @@ class ServiceValidator {
|
|
|
116
116
|
buildTestRequest(path, method, operation) {
|
|
117
117
|
const request = {
|
|
118
118
|
path,
|
|
119
|
-
headers: {
|
|
119
|
+
headers: {
|
|
120
|
+
// Validation context: ALWAYS add x-validation-request header to indicate this is a validation probe.
|
|
121
|
+
// This allows services to return deterministic responses without accessing external resources.
|
|
122
|
+
'x-validation-request': 'true'
|
|
123
|
+
},
|
|
120
124
|
query: {},
|
|
121
125
|
body: null
|
|
122
126
|
};
|
package/src/config.js
CHANGED
package/test-orchestrator.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Quick test of ValidationOrchestrator
|
|
6
6
|
*
|
|
7
7
|
* Usage: node test-orchestrator.js <serviceRoot>
|
|
8
|
-
* Example: node test-orchestrator.js
|
|
8
|
+
* Example: node test-orchestrator.js ../../../services/hello-service
|
|
9
9
|
*
|
|
10
10
|
* Loads service configuration from conn-config/config.json
|
|
11
11
|
*/
|