@sfdxy/mule-lint 1.19.0 → 1.21.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/README.md +128 -73
- package/dist/package.json +1 -1
- package/dist/src/core/XPathHelper.d.ts.map +1 -1
- package/dist/src/core/XPathHelper.js +8 -0
- package/dist/src/core/XPathHelper.js.map +1 -1
- package/dist/src/engine/LintEngine.d.ts +32 -0
- package/dist/src/engine/LintEngine.d.ts.map +1 -1
- package/dist/src/engine/LintEngine.js +166 -15
- package/dist/src/engine/LintEngine.js.map +1 -1
- package/dist/src/rules/api-led/ApikitConsoleProductionRule.d.ts +22 -0
- package/dist/src/rules/api-led/ApikitConsoleProductionRule.d.ts.map +1 -0
- package/dist/src/rules/api-led/ApikitConsoleProductionRule.js +43 -0
- package/dist/src/rules/api-led/ApikitConsoleProductionRule.js.map +1 -0
- package/dist/src/rules/api-led/ApikitMainFlowStructureRule.d.ts +24 -0
- package/dist/src/rules/api-led/ApikitMainFlowStructureRule.d.ts.map +1 -0
- package/dist/src/rules/api-led/ApikitMainFlowStructureRule.js +53 -0
- package/dist/src/rules/api-led/ApikitMainFlowStructureRule.js.map +1 -0
- package/dist/src/rules/api-led/ApikitStatusCodeVariableRule.d.ts +25 -0
- package/dist/src/rules/api-led/ApikitStatusCodeVariableRule.d.ts.map +1 -0
- package/dist/src/rules/api-led/ApikitStatusCodeVariableRule.js +59 -0
- package/dist/src/rules/api-led/ApikitStatusCodeVariableRule.js.map +1 -0
- package/dist/src/rules/connector/EventListenerNullGuardRule.d.ts +24 -0
- package/dist/src/rules/connector/EventListenerNullGuardRule.d.ts.map +1 -0
- package/dist/src/rules/connector/EventListenerNullGuardRule.js +58 -0
- package/dist/src/rules/connector/EventListenerNullGuardRule.js.map +1 -0
- package/dist/src/rules/connector/ReplayChannelConfigRule.d.ts +23 -0
- package/dist/src/rules/connector/ReplayChannelConfigRule.d.ts.map +1 -0
- package/dist/src/rules/connector/ReplayChannelConfigRule.js +52 -0
- package/dist/src/rules/connector/ReplayChannelConfigRule.js.map +1 -0
- package/dist/src/rules/dataweave/DataWeaveRules.d.ts +17 -4
- package/dist/src/rules/dataweave/DataWeaveRules.d.ts.map +1 -1
- package/dist/src/rules/dataweave/DataWeaveRules.js +36 -20
- package/dist/src/rules/dataweave/DataWeaveRules.js.map +1 -1
- package/dist/src/rules/dataweave/DuplicateTransformLogicRule.d.ts +25 -0
- package/dist/src/rules/dataweave/DuplicateTransformLogicRule.d.ts.map +1 -0
- package/dist/src/rules/dataweave/DuplicateTransformLogicRule.js +63 -0
- package/dist/src/rules/dataweave/DuplicateTransformLogicRule.js.map +1 -0
- package/dist/src/rules/error-handling/CatchAllLastRule.d.ts +24 -0
- package/dist/src/rules/error-handling/CatchAllLastRule.d.ts.map +1 -0
- package/dist/src/rules/error-handling/CatchAllLastRule.js +65 -0
- package/dist/src/rules/error-handling/CatchAllLastRule.js.map +1 -0
- package/dist/src/rules/error-handling/CorrelationIdRule.d.ts +22 -1
- package/dist/src/rules/error-handling/CorrelationIdRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/CorrelationIdRule.js +107 -6
- package/dist/src/rules/error-handling/CorrelationIdRule.js.map +1 -1
- package/dist/src/rules/error-handling/ErrorHandlerTypeCoverageRule.d.ts +28 -0
- package/dist/src/rules/error-handling/ErrorHandlerTypeCoverageRule.d.ts.map +1 -0
- package/dist/src/rules/error-handling/ErrorHandlerTypeCoverageRule.js +70 -0
- package/dist/src/rules/error-handling/ErrorHandlerTypeCoverageRule.js.map +1 -0
- package/dist/src/rules/error-handling/ErrorResponseStructureRule.d.ts +23 -0
- package/dist/src/rules/error-handling/ErrorResponseStructureRule.d.ts.map +1 -0
- package/dist/src/rules/error-handling/ErrorResponseStructureRule.js +73 -0
- package/dist/src/rules/error-handling/ErrorResponseStructureRule.js.map +1 -0
- package/dist/src/rules/error-handling/GenericErrorRule.d.ts +15 -3
- package/dist/src/rules/error-handling/GenericErrorRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/GenericErrorRule.js +58 -18
- package/dist/src/rules/error-handling/GenericErrorRule.js.map +1 -1
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.d.ts +16 -5
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.js +64 -21
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.js.map +1 -1
- package/dist/src/rules/error-handling/HttpStatusRule.d.ts +5 -0
- package/dist/src/rules/error-handling/HttpStatusRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/HttpStatusRule.js +15 -0
- package/dist/src/rules/error-handling/HttpStatusRule.js.map +1 -1
- package/dist/src/rules/error-handling/TryScopeRule.d.ts +5 -0
- package/dist/src/rules/error-handling/TryScopeRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/TryScopeRule.js +30 -7
- package/dist/src/rules/error-handling/TryScopeRule.js.map +1 -1
- package/dist/src/rules/http/ConnectionIdleTimeoutRule.d.ts +27 -0
- package/dist/src/rules/http/ConnectionIdleTimeoutRule.d.ts.map +1 -0
- package/dist/src/rules/http/ConnectionIdleTimeoutRule.js +46 -0
- package/dist/src/rules/http/ConnectionIdleTimeoutRule.js.map +1 -0
- package/dist/src/rules/http/HttpContentTypeRule.d.ts +28 -1
- package/dist/src/rules/http/HttpContentTypeRule.d.ts.map +1 -1
- package/dist/src/rules/http/HttpContentTypeRule.js +68 -7
- package/dist/src/rules/http/HttpContentTypeRule.js.map +1 -1
- package/dist/src/rules/index.d.ts +1 -1
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +50 -8
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/logging/LoggerPayloadRule.d.ts +15 -0
- package/dist/src/rules/logging/LoggerPayloadRule.d.ts.map +1 -1
- package/dist/src/rules/logging/LoggerPayloadRule.js +48 -4
- package/dist/src/rules/logging/LoggerPayloadRule.js.map +1 -1
- package/dist/src/rules/operations/FlowRefTargetExistsRule.d.ts +23 -0
- package/dist/src/rules/operations/FlowRefTargetExistsRule.d.ts.map +1 -0
- package/dist/src/rules/operations/FlowRefTargetExistsRule.js +58 -0
- package/dist/src/rules/operations/FlowRefTargetExistsRule.js.map +1 -0
- package/dist/src/rules/operations/UnusedFlowRule.d.ts +26 -1
- package/dist/src/rules/operations/UnusedFlowRule.d.ts.map +1 -1
- package/dist/src/rules/operations/UnusedFlowRule.js +96 -16
- package/dist/src/rules/operations/UnusedFlowRule.js.map +1 -1
- package/dist/src/rules/operations/UnusedVariableRule.d.ts +31 -0
- package/dist/src/rules/operations/UnusedVariableRule.d.ts.map +1 -0
- package/dist/src/rules/operations/UnusedVariableRule.js +103 -0
- package/dist/src/rules/operations/UnusedVariableRule.js.map +1 -0
- package/dist/src/rules/performance/ConnectionPoolingRule.d.ts +5 -0
- package/dist/src/rules/performance/ConnectionPoolingRule.d.ts.map +1 -1
- package/dist/src/rules/performance/ConnectionPoolingRule.js +18 -5
- package/dist/src/rules/performance/ConnectionPoolingRule.js.map +1 -1
- package/dist/src/rules/performance/ListenerReconnectForeverRule.d.ts +28 -0
- package/dist/src/rules/performance/ListenerReconnectForeverRule.d.ts.map +1 -0
- package/dist/src/rules/performance/ListenerReconnectForeverRule.js +56 -0
- package/dist/src/rules/performance/ListenerReconnectForeverRule.js.map +1 -0
- package/dist/src/rules/performance/ReconnectionStrategyRule.d.ts +10 -0
- package/dist/src/rules/performance/ReconnectionStrategyRule.d.ts.map +1 -1
- package/dist/src/rules/performance/ReconnectionStrategyRule.js +47 -14
- package/dist/src/rules/performance/ReconnectionStrategyRule.js.map +1 -1
- package/dist/src/rules/security/ConnectorCredentialsSecuredRule.d.ts +36 -0
- package/dist/src/rules/security/ConnectorCredentialsSecuredRule.d.ts.map +1 -0
- package/dist/src/rules/security/ConnectorCredentialsSecuredRule.js +124 -0
- package/dist/src/rules/security/ConnectorCredentialsSecuredRule.js.map +1 -0
- package/dist/src/rules/security/HardcodedCredentialsRule.d.ts +4 -0
- package/dist/src/rules/security/HardcodedCredentialsRule.d.ts.map +1 -1
- package/dist/src/rules/security/HardcodedCredentialsRule.js +15 -0
- package/dist/src/rules/security/HardcodedCredentialsRule.js.map +1 -1
- package/dist/src/rules/security/SecurePropertiesEncryptionRule.d.ts +25 -0
- package/dist/src/rules/security/SecurePropertiesEncryptionRule.d.ts.map +1 -0
- package/dist/src/rules/security/SecurePropertiesEncryptionRule.js +59 -0
- package/dist/src/rules/security/SecurePropertiesEncryptionRule.js.map +1 -0
- package/dist/src/rules/security/SecurePropertiesKeyRule.d.ts +23 -0
- package/dist/src/rules/security/SecurePropertiesKeyRule.d.ts.map +1 -0
- package/dist/src/rules/security/SecurePropertiesKeyRule.js +45 -0
- package/dist/src/rules/security/SecurePropertiesKeyRule.js.map +1 -0
- package/dist/src/rules/security/TlsKeystorePasswordRule.d.ts +25 -0
- package/dist/src/rules/security/TlsKeystorePasswordRule.d.ts.map +1 -0
- package/dist/src/rules/security/TlsKeystorePasswordRule.js +63 -0
- package/dist/src/rules/security/TlsKeystorePasswordRule.js.map +1 -0
- package/dist/src/rules/standards/ApikitRouteVariableConsistencyRule.d.ts +26 -0
- package/dist/src/rules/standards/ApikitRouteVariableConsistencyRule.d.ts.map +1 -0
- package/dist/src/rules/standards/ApikitRouteVariableConsistencyRule.js +61 -0
- package/dist/src/rules/standards/ApikitRouteVariableConsistencyRule.js.map +1 -0
- package/dist/src/rules/standards/ConfigPropertiesOrderingRule.d.ts +34 -0
- package/dist/src/rules/standards/ConfigPropertiesOrderingRule.d.ts.map +1 -0
- package/dist/src/rules/standards/ConfigPropertiesOrderingRule.js +76 -0
- package/dist/src/rules/standards/ConfigPropertiesOrderingRule.js.map +1 -0
- package/dist/src/rules/standards/MissingEnvPropertiesDeclarationRule.d.ts +25 -0
- package/dist/src/rules/standards/MissingEnvPropertiesDeclarationRule.d.ts.map +1 -0
- package/dist/src/rules/standards/MissingEnvPropertiesDeclarationRule.js +111 -0
- package/dist/src/rules/standards/MissingEnvPropertiesDeclarationRule.js.map +1 -0
- package/dist/src/rules/structure/StructureRules.d.ts +8 -1
- package/dist/src/rules/structure/StructureRules.d.ts.map +1 -1
- package/dist/src/rules/structure/StructureRules.js +11 -7
- package/dist/src/rules/structure/StructureRules.js.map +1 -1
- package/dist/src/rules/yaml/YamlRules.d.ts +6 -2
- package/dist/src/rules/yaml/YamlRules.d.ts.map +1 -1
- package/dist/src/rules/yaml/YamlRules.js +15 -11
- package/dist/src/rules/yaml/YamlRules.js.map +1 -1
- package/dist/src/types/Rule.d.ts +35 -0
- package/dist/src/types/Rule.d.ts.map +1 -1
- package/docs/best-practices/rules-catalog.md +444 -42
- package/docs/linter/architecture.md +119 -64
- package/package.json +1 -1
|
@@ -7,6 +7,10 @@ const BaseRule_1 = require("../base/BaseRule");
|
|
|
7
7
|
*
|
|
8
8
|
* Complex operations (DB calls, HTTP requests) should use Try scope
|
|
9
9
|
* for granular error isolation and handling.
|
|
10
|
+
*
|
|
11
|
+
* Enhanced to also check sub-flows containing http:request without
|
|
12
|
+
* Try scope — sub-flows are often called from multiple places and
|
|
13
|
+
* should handle their own errors for isolation.
|
|
10
14
|
*/
|
|
11
15
|
class TryScopeRule extends BaseRule_1.BaseRule {
|
|
12
16
|
id = 'ERR-001';
|
|
@@ -17,26 +21,45 @@ class TryScopeRule extends BaseRule_1.BaseRule {
|
|
|
17
21
|
issueType = 'bug';
|
|
18
22
|
validate(doc, _context) {
|
|
19
23
|
const issues = [];
|
|
20
|
-
// Find flows with
|
|
21
|
-
const flows = this.select('
|
|
24
|
+
// Find flows and sub-flows with risky operations
|
|
25
|
+
const flows = this.select('//mule:flow', doc);
|
|
26
|
+
const subFlows = this.select('//mule:sub-flow', doc);
|
|
22
27
|
for (const flow of flows) {
|
|
23
28
|
const flowElement = flow;
|
|
24
29
|
const flowName = flowElement.getAttribute('name') ?? 'unnamed';
|
|
25
30
|
// Count risky operations (DB, HTTP, external calls)
|
|
26
|
-
const
|
|
27
|
-
const httpRequests = this.select('.//*[local-name()="request" and namespace-uri()="http://www.mulesoft.org/schema/mule/http"]', flow);
|
|
28
|
-
const externalCalls = [...dbOperations, ...httpRequests];
|
|
31
|
+
const riskyOps = this.countRiskyOperations(flow);
|
|
29
32
|
// Check if Try scope exists
|
|
30
33
|
const tryScopes = this.select('.//*[local-name()="try"]', flow);
|
|
31
34
|
// If multiple external calls but no Try scope
|
|
32
|
-
if (
|
|
33
|
-
issues.push(this.createIssue(flow, `Flow "${flowName}" has ${
|
|
35
|
+
if (riskyOps >= 2 && tryScopes.length === 0) {
|
|
36
|
+
issues.push(this.createIssue(flow, `Flow "${flowName}" has ${String(riskyOps)} external calls without Try scope isolation`, {
|
|
34
37
|
suggestion: 'Wrap risky operations in Try scope for granular error handling and isolation',
|
|
35
38
|
}));
|
|
36
39
|
}
|
|
37
40
|
}
|
|
41
|
+
// Sub-flows with http:request should also use Try scope
|
|
42
|
+
for (const subFlow of subFlows) {
|
|
43
|
+
const subFlowElement = subFlow;
|
|
44
|
+
const subFlowName = subFlowElement.getAttribute('name') ?? 'unnamed';
|
|
45
|
+
const httpRequests = this.select('.//*[local-name()="request" and namespace-uri()="http://www.mulesoft.org/schema/mule/http"]', subFlow);
|
|
46
|
+
if (httpRequests.length > 0) {
|
|
47
|
+
const tryScopes = this.select('.//*[local-name()="try"]', subFlow);
|
|
48
|
+
if (tryScopes.length === 0) {
|
|
49
|
+
issues.push(this.createIssue(subFlow, `Sub-flow "${subFlowName}" contains http:request without Try scope — errors will propagate to all callers`, {
|
|
50
|
+
suggestion: 'Wrap the http:request in a Try scope within the sub-flow for isolated error handling',
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
38
55
|
return issues;
|
|
39
56
|
}
|
|
57
|
+
countRiskyOperations(node) {
|
|
58
|
+
const dbOps = this.select('.//*[namespace-uri()="http://www.mulesoft.org/schema/mule/db"]', node);
|
|
59
|
+
const httpReqs = this.select('.//*[local-name()="request" and namespace-uri()="http://www.mulesoft.org/schema/mule/http"]', node);
|
|
60
|
+
const wsConsumers = this.select('.//*[local-name()="consume" and namespace-uri()="http://www.mulesoft.org/schema/mule/wsc"]', node);
|
|
61
|
+
return dbOps.length + httpReqs.length + wsConsumers.length;
|
|
62
|
+
}
|
|
40
63
|
}
|
|
41
64
|
exports.TryScopeRule = TryScopeRule;
|
|
42
65
|
//# sourceMappingURL=TryScopeRule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TryScopeRule.js","sourceRoot":"","sources":["../../../../src/rules/error-handling/TryScopeRule.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C
|
|
1
|
+
{"version":3,"file":"TryScopeRule.js","sourceRoot":"","sources":["../../../../src/rules/error-handling/TryScopeRule.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C;;;;;;;;;GASG;AACH,MAAa,YAAa,SAAQ,mBAAQ;IACxC,EAAE,GAAG,SAAS,CAAC;IACf,IAAI,GAAG,yBAAyB,CAAC;IACjC,WAAW,GAAG,6DAA6D,CAAC;IAC5E,QAAQ,GAAG,MAAe,CAAC;IAC3B,QAAQ,GAAG,gBAAyB,CAAC;IACrC,SAAS,GAAc,KAAK,CAAC;IAE7B,QAAQ,CAAC,GAAa,EAAE,QAA2B;QACjD,MAAM,MAAM,GAAY,EAAE,CAAC;QAE3B,iDAAiD;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;QAErD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,WAAW,GAAG,IAAe,CAAC;YACpC,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;YAE/D,oDAAoD;YACpD,MAAM,QAAQ,GA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,IAAI,CAAC,MAAM,CAC1B,6FAA6F,EAC7F,IAAI,CACL,CAAC;QACF,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAC7B,4FAA4F,EAC5F,IAAI,CACL,CAAC;QACF,OAAO,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAC7D,CAAC;CACF;AArFD,oCAqFC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ValidationContext, Issue } from '../../types';
|
|
2
|
+
import { BaseRule } from '../base/BaseRule';
|
|
3
|
+
/**
|
|
4
|
+
* HTTP-004: Connection Idle Timeout
|
|
5
|
+
*
|
|
6
|
+
* HTTP request-connection elements should configure an idle timeout
|
|
7
|
+
* to prevent stale connections from accumulating in the pool.
|
|
8
|
+
* Without idle timeout, connections may linger and consume resources
|
|
9
|
+
* even when not actively in use.
|
|
10
|
+
*
|
|
11
|
+
* Accelerator pattern:
|
|
12
|
+
* <http:request-connection>
|
|
13
|
+
* <http:client-socket-properties>
|
|
14
|
+
* <sockets:tcp-client-socket-properties connectionTimeout="10000"
|
|
15
|
+
* clientTimeout="30000"/>
|
|
16
|
+
* </http:client-socket-properties>
|
|
17
|
+
* </http:request-connection>
|
|
18
|
+
*/
|
|
19
|
+
export declare class ConnectionIdleTimeoutRule extends BaseRule {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
severity: "info";
|
|
24
|
+
category: "http";
|
|
25
|
+
validate(doc: Document, _context: ValidationContext): Issue[];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=ConnectionIdleTimeoutRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionIdleTimeoutRule.d.ts","sourceRoot":"","sources":["../../../../src/rules/http/ConnectionIdleTimeoutRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,yBAA0B,SAAQ,QAAQ;IACrD,EAAE,SAAc;IAChB,IAAI,SAA6B;IACjC,WAAW,SACkF;IAC7F,QAAQ,EAAG,MAAM,CAAU;IAC3B,QAAQ,EAAG,MAAM,CAAU;IAE3B,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,KAAK,EAAE;CAiC9D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectionIdleTimeoutRule = void 0;
|
|
4
|
+
const BaseRule_1 = require("../base/BaseRule");
|
|
5
|
+
/**
|
|
6
|
+
* HTTP-004: Connection Idle Timeout
|
|
7
|
+
*
|
|
8
|
+
* HTTP request-connection elements should configure an idle timeout
|
|
9
|
+
* to prevent stale connections from accumulating in the pool.
|
|
10
|
+
* Without idle timeout, connections may linger and consume resources
|
|
11
|
+
* even when not actively in use.
|
|
12
|
+
*
|
|
13
|
+
* Accelerator pattern:
|
|
14
|
+
* <http:request-connection>
|
|
15
|
+
* <http:client-socket-properties>
|
|
16
|
+
* <sockets:tcp-client-socket-properties connectionTimeout="10000"
|
|
17
|
+
* clientTimeout="30000"/>
|
|
18
|
+
* </http:client-socket-properties>
|
|
19
|
+
* </http:request-connection>
|
|
20
|
+
*/
|
|
21
|
+
class ConnectionIdleTimeoutRule extends BaseRule_1.BaseRule {
|
|
22
|
+
id = 'HTTP-004';
|
|
23
|
+
name = 'Connection Idle Timeout';
|
|
24
|
+
description = 'HTTP request configs should configure connection/idle timeouts to prevent resource leaks';
|
|
25
|
+
severity = 'info';
|
|
26
|
+
category = 'http';
|
|
27
|
+
validate(doc, _context) {
|
|
28
|
+
const issues = [];
|
|
29
|
+
// Find HTTP request-config elements
|
|
30
|
+
const requestConfigs = this.select('//*[local-name()="request-config"]', doc);
|
|
31
|
+
for (const config of requestConfigs) {
|
|
32
|
+
const configName = this.getNameAttribute(config) ?? 'HTTP Request Config';
|
|
33
|
+
// Check for useSendBuffer, connectionIdleTimeout, or socket properties
|
|
34
|
+
const hasIdleTimeout = this.getAttribute(config, 'connectionIdleTimeout') !== null;
|
|
35
|
+
const hasSocketProps = this.exists('.//*[local-name()="tcp-client-socket-properties" or local-name()="client-socket-properties"]', config);
|
|
36
|
+
if (!hasIdleTimeout && !hasSocketProps) {
|
|
37
|
+
issues.push(this.createIssue(config, `HTTP request config "${configName}" has no connection idle timeout or socket properties configured`, {
|
|
38
|
+
suggestion: 'Add connectionIdleTimeout="30000" on the config, or configure <http:client-socket-properties> with tcp-client-socket-properties for fine-grained control',
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return issues;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.ConnectionIdleTimeoutRule = ConnectionIdleTimeoutRule;
|
|
46
|
+
//# sourceMappingURL=ConnectionIdleTimeoutRule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionIdleTimeoutRule.js","sourceRoot":"","sources":["../../../../src/rules/http/ConnectionIdleTimeoutRule.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C;;;;;;;;;;;;;;;GAeG;AACH,MAAa,yBAA0B,SAAQ,mBAAQ;IACrD,EAAE,GAAG,UAAU,CAAC;IAChB,IAAI,GAAG,yBAAyB,CAAC;IACjC,WAAW,GACT,0FAA0F,CAAC;IAC7F,QAAQ,GAAG,MAAe,CAAC;IAC3B,QAAQ,GAAG,MAAe,CAAC;IAE3B,QAAQ,CAAC,GAAa,EAAE,QAA2B;QACjD,MAAM,MAAM,GAAY,EAAE,CAAC;QAE3B,oCAAoC;QACpC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAC;QAE9E,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;YACpC,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,qBAAqB,CAAC;YAE1E,uEAAuE;YACvE,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,uBAAuB,CAAC,KAAK,IAAI,CAAC;YAEnF,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAChC,8FAA8F,EAC9F,MAAM,CACP,CAAC;YAEF,IAAI,CAAC,cAAc,IAAI,CAAC,cAAc,EAAE,CAAC;gBACvC,MAAM,CAAC,IAAI,CACT,IAAI,CAAC,WAAW,CACd,MAAM,EACN,wBAAwB,UAAU,kEAAkE,EACpG;oBACE,UAAU,EACR,0JAA0J;iBAC7J,CACF,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAzCD,8DAyCC"}
|
|
@@ -4,6 +4,25 @@ import { BaseRule } from '../base/BaseRule';
|
|
|
4
4
|
* MULE-402: HTTP Request Content-Type
|
|
5
5
|
*
|
|
6
6
|
* POST/PUT HTTP requests should include Content-Type header.
|
|
7
|
+
*
|
|
8
|
+
* The rule detects Content-Type in three patterns:
|
|
9
|
+
*
|
|
10
|
+
* Pattern A — Static <http:header> element:
|
|
11
|
+
* <http:headers>
|
|
12
|
+
* <http:header headerName="Content-Type" value="application/json"/>
|
|
13
|
+
* </http:headers>
|
|
14
|
+
*
|
|
15
|
+
* Pattern B — CDATA DataWeave expression block:
|
|
16
|
+
* <http:headers><![CDATA[#[output application/java --- {"Content-Type": "application/json"}]]]></http:headers>
|
|
17
|
+
*
|
|
18
|
+
* Pattern C — Inline DataWeave expression on value attribute:
|
|
19
|
+
* <http:headers value='#[{"Content-Type": "application/json"}]'/>
|
|
20
|
+
*
|
|
21
|
+
* When headers are set via DataWeave (patterns B/C), the rule performs a
|
|
22
|
+
* case-insensitive text search for "content-type" within the expression body.
|
|
23
|
+
* If a DataWeave expression is present but does not contain "content-type",
|
|
24
|
+
* the issue is downgraded to 'info' severity to acknowledge the static analysis
|
|
25
|
+
* limitation of evaluating dynamic expressions.
|
|
7
26
|
*/
|
|
8
27
|
export declare class HttpContentTypeRule extends BaseRule {
|
|
9
28
|
id: string;
|
|
@@ -12,6 +31,14 @@ export declare class HttpContentTypeRule extends BaseRule {
|
|
|
12
31
|
severity: "warning";
|
|
13
32
|
category: "http";
|
|
14
33
|
validate(doc: Document, _context: ValidationContext): Issue[];
|
|
15
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Check whether a Content-Type header is present on the given http:request element.
|
|
36
|
+
*
|
|
37
|
+
* @returns
|
|
38
|
+
* 'present' — Content-Type definitively found
|
|
39
|
+
* 'dynamic-unverified' — headers set via DW expression but Content-Type not visible
|
|
40
|
+
* 'missing' — no headers element or no Content-Type anywhere
|
|
41
|
+
*/
|
|
42
|
+
private checkContentTypeHeader;
|
|
16
43
|
}
|
|
17
44
|
//# sourceMappingURL=HttpContentTypeRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpContentTypeRule.d.ts","sourceRoot":"","sources":["../../../../src/rules/http/HttpContentTypeRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"HttpContentTypeRule.d.ts","sourceRoot":"","sources":["../../../../src/rules/http/HttpContentTypeRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,mBAAoB,SAAQ,QAAQ;IAC/C,EAAE,SAAc;IAChB,IAAI,SAA+B;IACnC,WAAW,SAA+D;IAC1E,QAAQ,EAAG,SAAS,CAAU;IAC9B,QAAQ,EAAG,MAAM,CAAU;IAE3B,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,KAAK,EAAE;IAqD7D;;;;;;;OAOG;IACH,OAAO,CAAC,sBAAsB;CAuC/B"}
|
|
@@ -6,6 +6,25 @@ const BaseRule_1 = require("../base/BaseRule");
|
|
|
6
6
|
* MULE-402: HTTP Request Content-Type
|
|
7
7
|
*
|
|
8
8
|
* POST/PUT HTTP requests should include Content-Type header.
|
|
9
|
+
*
|
|
10
|
+
* The rule detects Content-Type in three patterns:
|
|
11
|
+
*
|
|
12
|
+
* Pattern A — Static <http:header> element:
|
|
13
|
+
* <http:headers>
|
|
14
|
+
* <http:header headerName="Content-Type" value="application/json"/>
|
|
15
|
+
* </http:headers>
|
|
16
|
+
*
|
|
17
|
+
* Pattern B — CDATA DataWeave expression block:
|
|
18
|
+
* <http:headers><![CDATA[#[output application/java --- {"Content-Type": "application/json"}]]]></http:headers>
|
|
19
|
+
*
|
|
20
|
+
* Pattern C — Inline DataWeave expression on value attribute:
|
|
21
|
+
* <http:headers value='#[{"Content-Type": "application/json"}]'/>
|
|
22
|
+
*
|
|
23
|
+
* When headers are set via DataWeave (patterns B/C), the rule performs a
|
|
24
|
+
* case-insensitive text search for "content-type" within the expression body.
|
|
25
|
+
* If a DataWeave expression is present but does not contain "content-type",
|
|
26
|
+
* the issue is downgraded to 'info' severity to acknowledge the static analysis
|
|
27
|
+
* limitation of evaluating dynamic expressions.
|
|
9
28
|
*/
|
|
10
29
|
class HttpContentTypeRule extends BaseRule_1.BaseRule {
|
|
11
30
|
id = 'MULE-402';
|
|
@@ -25,26 +44,68 @@ class HttpContentTypeRule extends BaseRule_1.BaseRule {
|
|
|
25
44
|
const method = this.getAttribute(request, 'method')?.toUpperCase();
|
|
26
45
|
// Only check POST and PUT methods
|
|
27
46
|
if (method === 'POST' || method === 'PUT') {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
47
|
+
const result = this.checkContentTypeHeader(request);
|
|
48
|
+
if (result === 'missing') {
|
|
30
49
|
const docName = this.getDocName(request) ?? 'HTTP Request';
|
|
31
50
|
issues.push(this.createIssue(request, `${method} request "${docName}" is missing Content-Type header`, {
|
|
32
51
|
suggestion: 'Add header: <http:header headerName="Content-Type" value="application/json"/>',
|
|
33
52
|
}));
|
|
34
53
|
}
|
|
54
|
+
else if (result === 'dynamic-unverified') {
|
|
55
|
+
// Headers are set via a DataWeave expression but we cannot statically
|
|
56
|
+
// verify that Content-Type is included. Downgrade to info.
|
|
57
|
+
const docName = this.getDocName(request) ?? 'HTTP Request';
|
|
58
|
+
issues.push(this.createIssue(request, `${method} request "${docName}" sets headers via DataWeave expression — verify Content-Type is included`, {
|
|
59
|
+
severity: 'info',
|
|
60
|
+
suggestion: 'Ensure the DataWeave expression includes {"Content-Type": "application/json"} or equivalent',
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
// 'present' → no issue
|
|
35
64
|
}
|
|
36
65
|
}
|
|
37
66
|
return issues;
|
|
38
67
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Check whether a Content-Type header is present on the given http:request element.
|
|
70
|
+
*
|
|
71
|
+
* @returns
|
|
72
|
+
* 'present' — Content-Type definitively found
|
|
73
|
+
* 'dynamic-unverified' — headers set via DW expression but Content-Type not visible
|
|
74
|
+
* 'missing' — no headers element or no Content-Type anywhere
|
|
75
|
+
*/
|
|
76
|
+
checkContentTypeHeader(request) {
|
|
77
|
+
// Pattern A: Static <http:header headerName="Content-Type" ...>
|
|
78
|
+
const staticHeaders = this.select('.//*[local-name()="header"]', request);
|
|
79
|
+
for (const header of staticHeaders) {
|
|
42
80
|
const headerName = this.getAttribute(header, 'headerName') ?? '';
|
|
43
81
|
if (headerName.toLowerCase() === 'content-type') {
|
|
44
|
-
return
|
|
82
|
+
return 'present';
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// Patterns B & C: Check <http:headers> element for DataWeave expression content
|
|
86
|
+
const headersElements = this.select('.//*[local-name()="headers"]', request);
|
|
87
|
+
let hasDynamicHeaders = false;
|
|
88
|
+
for (const headersEl of headersElements) {
|
|
89
|
+
const element = headersEl;
|
|
90
|
+
// Pattern C: value attribute containing a DataWeave expression
|
|
91
|
+
const valueAttr = element.getAttribute('value') ?? '';
|
|
92
|
+
if (valueAttr.includes('#[')) {
|
|
93
|
+
hasDynamicHeaders = true;
|
|
94
|
+
if (valueAttr.toLowerCase().includes('content-type')) {
|
|
95
|
+
return 'present';
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Pattern B: CDATA block or text content inside <http:headers>
|
|
99
|
+
const textContent = headersEl.textContent ?? '';
|
|
100
|
+
if (textContent.trim().length > 0) {
|
|
101
|
+
// Any non-empty text content in <http:headers> is treated as a DW expression
|
|
102
|
+
hasDynamicHeaders = true;
|
|
103
|
+
if (textContent.toLowerCase().includes('content-type')) {
|
|
104
|
+
return 'present';
|
|
105
|
+
}
|
|
45
106
|
}
|
|
46
107
|
}
|
|
47
|
-
return
|
|
108
|
+
return hasDynamicHeaders ? 'dynamic-unverified' : 'missing';
|
|
48
109
|
}
|
|
49
110
|
}
|
|
50
111
|
exports.HttpContentTypeRule = HttpContentTypeRule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpContentTypeRule.js","sourceRoot":"","sources":["../../../../src/rules/http/HttpContentTypeRule.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C
|
|
1
|
+
{"version":3,"file":"HttpContentTypeRule.js","sourceRoot":"","sources":["../../../../src/rules/http/HttpContentTypeRule.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,mBAAoB,SAAQ,mBAAQ;IAC/C,EAAE,GAAG,UAAU,CAAC;I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,GAAG,SAAS,CAAC,WAAW,IAAI,EAAE,CAAC;YAChD,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAClC,6EAA6E;gBAC7E,iBAAiB,GAAG,IAAI,CAAC;gBACzB,IAAI,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;oBACvD,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,iBAAiB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,CAAC;CACF;AA3GD,kDA2GC"}
|
|
@@ -28,7 +28,7 @@ export { AsyncErrorHandlerRule } from './performance/AsyncErrorHandlerRule';
|
|
|
28
28
|
export { LargeChoiceBlockRule } from './performance/LargeChoiceBlockRule';
|
|
29
29
|
/**
|
|
30
30
|
* All available rules - instantiated and ready to use
|
|
31
|
-
* Total:
|
|
31
|
+
* Total: 82 rules (including operations, resilience, hygiene, API-led, connector, and code quality rules)
|
|
32
32
|
*/
|
|
33
33
|
export declare const ALL_RULES: Rule[];
|
|
34
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AAkHnC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,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EG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,CAE3D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAExD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAExC"}
|
package/dist/src/rules/index.js
CHANGED
|
@@ -28,6 +28,9 @@ const HttpStatusRule_1 = require("./error-handling/HttpStatusRule");
|
|
|
28
28
|
const CorrelationIdRule_1 = require("./error-handling/CorrelationIdRule");
|
|
29
29
|
const GenericErrorRule_1 = require("./error-handling/GenericErrorRule");
|
|
30
30
|
const TryScopeRule_1 = require("./error-handling/TryScopeRule");
|
|
31
|
+
const ErrorHandlerTypeCoverageRule_1 = require("./error-handling/ErrorHandlerTypeCoverageRule");
|
|
32
|
+
const ErrorResponseStructureRule_1 = require("./error-handling/ErrorResponseStructureRule");
|
|
33
|
+
const CatchAllLastRule_1 = require("./error-handling/CatchAllLastRule");
|
|
31
34
|
// Import all rules - Naming
|
|
32
35
|
const FlowNamingRule_1 = require("./naming/FlowNamingRule");
|
|
33
36
|
const FlowCasingRule_1 = require("./naming/FlowCasingRule");
|
|
@@ -40,6 +43,10 @@ const TlsVersionRule_1 = require("./security/TlsVersionRule");
|
|
|
40
43
|
const RateLimitingRule_1 = require("./security/RateLimitingRule");
|
|
41
44
|
const InputValidationRule_1 = require("./security/InputValidationRule");
|
|
42
45
|
const EncryptionKeyInLogsRule_1 = require("./security/EncryptionKeyInLogsRule");
|
|
46
|
+
const ConnectorCredentialsSecuredRule_1 = require("./security/ConnectorCredentialsSecuredRule");
|
|
47
|
+
const SecurePropertiesKeyRule_1 = require("./security/SecurePropertiesKeyRule");
|
|
48
|
+
const TlsKeystorePasswordRule_1 = require("./security/TlsKeystorePasswordRule");
|
|
49
|
+
const SecurePropertiesEncryptionRule_1 = require("./security/SecurePropertiesEncryptionRule");
|
|
43
50
|
// Import all rules - Logging
|
|
44
51
|
const LoggerCategoryRule_1 = require("./logging/LoggerCategoryRule");
|
|
45
52
|
const LoggerPayloadRule_1 = require("./logging/LoggerPayloadRule");
|
|
@@ -54,10 +61,17 @@ const AutoDiscoveryRule_1 = require("./standards/AutoDiscoveryRule");
|
|
|
54
61
|
const HttpPortPlaceholderRule_1 = require("./standards/HttpPortPlaceholderRule");
|
|
55
62
|
const CronExternalizedRule_1 = require("./standards/CronExternalizedRule");
|
|
56
63
|
const ApiKitValidationRule_1 = require("./standards/ApiKitValidationRule");
|
|
64
|
+
const ConfigPropertiesOrderingRule_1 = require("./standards/ConfigPropertiesOrderingRule");
|
|
65
|
+
const MissingEnvPropertiesDeclarationRule_1 = require("./standards/MissingEnvPropertiesDeclarationRule");
|
|
66
|
+
const ApikitRouteVariableConsistencyRule_1 = require("./standards/ApikitRouteVariableConsistencyRule");
|
|
57
67
|
// Import all rules - HTTP
|
|
58
68
|
const HttpUserAgentRule_1 = require("./http/HttpUserAgentRule");
|
|
59
69
|
const HttpContentTypeRule_1 = require("./http/HttpContentTypeRule");
|
|
60
70
|
const HttpTimeoutRule_1 = require("./http/HttpTimeoutRule");
|
|
71
|
+
const ConnectionIdleTimeoutRule_1 = require("./http/ConnectionIdleTimeoutRule");
|
|
72
|
+
// Import all rules - Connector
|
|
73
|
+
const ReplayChannelConfigRule_1 = require("./connector/ReplayChannelConfigRule");
|
|
74
|
+
const EventListenerNullGuardRule_1 = require("./connector/EventListenerNullGuardRule");
|
|
61
75
|
// Import all rules - Documentation
|
|
62
76
|
const FlowDescriptionRule_1 = require("./documentation/FlowDescriptionRule");
|
|
63
77
|
const MissingDocNameRule_1 = require("./documentation/MissingDocNameRule");
|
|
@@ -68,6 +82,7 @@ const AsyncErrorHandlerRule_1 = require("./performance/AsyncErrorHandlerRule");
|
|
|
68
82
|
const LargeChoiceBlockRule_1 = require("./performance/LargeChoiceBlockRule");
|
|
69
83
|
const ConnectionPoolingRule_1 = require("./performance/ConnectionPoolingRule");
|
|
70
84
|
const ReconnectionStrategyRule_1 = require("./performance/ReconnectionStrategyRule");
|
|
85
|
+
const ListenerReconnectForeverRule_1 = require("./performance/ListenerReconnectForeverRule");
|
|
71
86
|
// Import all rules - Complexity
|
|
72
87
|
const FlowComplexityRule_1 = require("./complexity/FlowComplexityRule");
|
|
73
88
|
// Import all rules - YAML
|
|
@@ -77,14 +92,20 @@ const StructureRules_1 = require("./structure/StructureRules");
|
|
|
77
92
|
// Import all rules - DataWeave
|
|
78
93
|
const DataWeaveRules_1 = require("./dataweave/DataWeaveRules");
|
|
79
94
|
const Java17DWErrorHandlingRule_1 = require("./dataweave/Java17DWErrorHandlingRule");
|
|
95
|
+
const DuplicateTransformLogicRule_1 = require("./dataweave/DuplicateTransformLogicRule");
|
|
80
96
|
// Import all rules - API-Led
|
|
81
97
|
const ApiLedRules_1 = require("./api-led/ApiLedRules");
|
|
82
98
|
const SingleSystemSapiRule_1 = require("./api-led/SingleSystemSapiRule");
|
|
99
|
+
const ApikitMainFlowStructureRule_1 = require("./api-led/ApikitMainFlowStructureRule");
|
|
100
|
+
const ApikitStatusCodeVariableRule_1 = require("./api-led/ApikitStatusCodeVariableRule");
|
|
101
|
+
const ApikitConsoleProductionRule_1 = require("./api-led/ApikitConsoleProductionRule");
|
|
83
102
|
// Import all rules - Experimental
|
|
84
103
|
const ExperimentalRules_1 = require("./experimental/ExperimentalRules");
|
|
85
104
|
// Import all rules - Operations & Hygiene
|
|
86
105
|
const CommentedCodeRule_1 = require("./operations/CommentedCodeRule");
|
|
87
106
|
const UnusedFlowRule_1 = require("./operations/UnusedFlowRule");
|
|
107
|
+
const FlowRefTargetExistsRule_1 = require("./operations/FlowRefTargetExistsRule");
|
|
108
|
+
const UnusedVariableRule_1 = require("./operations/UnusedVariableRule");
|
|
88
109
|
// Import all rules - Governance
|
|
89
110
|
const GovernanceRules_1 = require("./governance/GovernanceRules");
|
|
90
111
|
// Export individual rules - Error Handling
|
|
@@ -147,7 +168,7 @@ var LargeChoiceBlockRule_2 = require("./performance/LargeChoiceBlockRule");
|
|
|
147
168
|
Object.defineProperty(exports, "LargeChoiceBlockRule", { enumerable: true, get: function () { return LargeChoiceBlockRule_2.LargeChoiceBlockRule; } });
|
|
148
169
|
/**
|
|
149
170
|
* All available rules - instantiated and ready to use
|
|
150
|
-
* Total:
|
|
171
|
+
* Total: 82 rules (including operations, resilience, hygiene, API-led, connector, and code quality rules)
|
|
151
172
|
*/
|
|
152
173
|
exports.ALL_RULES = [
|
|
153
174
|
// Error Handling Rules (MULE-001, 003, 005, 007, 009)
|
|
@@ -157,6 +178,9 @@ exports.ALL_RULES = [
|
|
|
157
178
|
new CorrelationIdRule_1.CorrelationIdRule(),
|
|
158
179
|
new GenericErrorRule_1.GenericErrorRule(),
|
|
159
180
|
new TryScopeRule_1.TryScopeRule(), // ERR-001: Try Scope Best Practice
|
|
181
|
+
new ErrorHandlerTypeCoverageRule_1.ErrorHandlerTypeCoverageRule(), // ERR-002: APIKit Error Type Coverage
|
|
182
|
+
new ErrorResponseStructureRule_1.ErrorResponseStructureRule(), // ERR-003: Error Response Structure
|
|
183
|
+
new CatchAllLastRule_1.CatchAllLastRule(), // ERR-004: Catch-All Must Be Last
|
|
160
184
|
// Naming Rules (MULE-002, 101, 102)
|
|
161
185
|
new FlowNamingRule_1.FlowNamingRule(),
|
|
162
186
|
new FlowCasingRule_1.FlowCasingRule(),
|
|
@@ -178,10 +202,11 @@ exports.ALL_RULES = [
|
|
|
178
202
|
new ChoiceAntiPatternRule_1.ChoiceAntiPatternRule(),
|
|
179
203
|
new DwlStandardsRule_1.DwlStandardsRule(),
|
|
180
204
|
new DeprecatedComponentRule_1.DeprecatedComponentRule(),
|
|
181
|
-
// HTTP Rules (MULE-401, 402, 403)
|
|
205
|
+
// HTTP Rules (MULE-401, 402, 403, HTTP-004)
|
|
182
206
|
new HttpUserAgentRule_1.HttpUserAgentRule(),
|
|
183
207
|
new HttpContentTypeRule_1.HttpContentTypeRule(),
|
|
184
208
|
new HttpTimeoutRule_1.HttpTimeoutRule(),
|
|
209
|
+
new ConnectionIdleTimeoutRule_1.ConnectionIdleTimeoutRule(), // HTTP-004: Connection Idle Timeout
|
|
185
210
|
// Documentation Rules (MULE-601, 604)
|
|
186
211
|
new FlowDescriptionRule_1.FlowDescriptionRule(),
|
|
187
212
|
new MissingDocNameRule_1.MissingDocNameRule(),
|
|
@@ -200,37 +225,54 @@ exports.ALL_RULES = [
|
|
|
200
225
|
new StructureRules_1.ProjectStructureRule(),
|
|
201
226
|
new StructureRules_1.GlobalConfigRule(),
|
|
202
227
|
new StructureRules_1.MonolithicXmlRule(),
|
|
203
|
-
// DataWeave Rules (DW-001, 002, 003, 004)
|
|
228
|
+
// DataWeave Rules (DW-001, 002, 003, 004, 005)
|
|
204
229
|
new DataWeaveRules_1.ExternalDwlRule(),
|
|
205
230
|
new DataWeaveRules_1.DwlNamingRule(),
|
|
206
231
|
new DataWeaveRules_1.DwlModulesRule(),
|
|
207
232
|
new Java17DWErrorHandlingRule_1.Java17DWErrorHandlingRule(),
|
|
208
|
-
|
|
233
|
+
new DuplicateTransformLogicRule_1.DuplicateTransformLogicRule(), // DW-005: Duplicate Transform Logic
|
|
234
|
+
// API-Led Rules (API-001, 002, 003, 004, 006, 007, 008)
|
|
209
235
|
new ApiLedRules_1.ExperienceLayerRule(),
|
|
210
236
|
new ApiLedRules_1.ProcessLayerRule(),
|
|
211
237
|
new ApiLedRules_1.SystemLayerRule(),
|
|
212
238
|
new SingleSystemSapiRule_1.SingleSystemSapiRule(),
|
|
239
|
+
new ApikitMainFlowStructureRule_1.ApikitMainFlowStructureRule(), // API-006: APIKit Main Flow Structure
|
|
240
|
+
new ApikitStatusCodeVariableRule_1.ApikitStatusCodeVariableRule(), // API-007: APIKit Status Code Variable
|
|
241
|
+
new ApikitConsoleProductionRule_1.ApikitConsoleProductionRule(), // API-008: APIKit Console in Production
|
|
213
242
|
// Experimental Rules (EXP-001, 002, 003)
|
|
214
243
|
new ExperimentalRules_1.FlowRefDepthRule(),
|
|
215
244
|
new ExperimentalRules_1.ConnectorConfigNamingRule(),
|
|
216
245
|
new ExperimentalRules_1.MUnitCoverageRule(),
|
|
217
|
-
// Operations & Resilience Rules (RES-001, OPS-001, OPS-002, OPS-003)
|
|
246
|
+
// Operations & Resilience Rules (RES-001, RES-002, OPS-001, OPS-002, OPS-003)
|
|
218
247
|
new ReconnectionStrategyRule_1.ReconnectionStrategyRule(),
|
|
248
|
+
new ListenerReconnectForeverRule_1.ListenerReconnectForeverRule(), // RES-002: Listener Reconnect-Forever
|
|
219
249
|
new AutoDiscoveryRule_1.AutoDiscoveryRule(),
|
|
220
250
|
new HttpPortPlaceholderRule_1.HttpPortPlaceholderRule(),
|
|
221
251
|
new CronExternalizedRule_1.CronExternalizedRule(),
|
|
222
|
-
// Security Enhancement (SEC-006)
|
|
252
|
+
// Security Enhancement (SEC-006, SEC-007, SEC-008, SEC-009, SEC-010)
|
|
223
253
|
new EncryptionKeyInLogsRule_1.EncryptionKeyInLogsRule(),
|
|
224
|
-
|
|
254
|
+
new ConnectorCredentialsSecuredRule_1.ConnectorCredentialsSecuredRule(),
|
|
255
|
+
new SecurePropertiesKeyRule_1.SecurePropertiesKeyRule(),
|
|
256
|
+
new TlsKeystorePasswordRule_1.TlsKeystorePasswordRule(),
|
|
257
|
+
new SecurePropertiesEncryptionRule_1.SecurePropertiesEncryptionRule(),
|
|
258
|
+
// Code Hygiene Rules (HYG-001, HYG-002, HYG-003, HYG-004, HYG-005)
|
|
225
259
|
new ExcessiveLoggersRule_1.ExcessiveLoggersRule(),
|
|
226
260
|
new CommentedCodeRule_1.CommentedCodeRule(),
|
|
227
261
|
new UnusedFlowRule_1.UnusedFlowRule(),
|
|
228
|
-
|
|
262
|
+
new FlowRefTargetExistsRule_1.FlowRefTargetExistsRule(),
|
|
263
|
+
new UnusedVariableRule_1.UnusedVariableRule(), // HYG-005: Unused Variable
|
|
264
|
+
// Additional Standards (API-005, DOC-001, CFG-001, CFG-002, STD-001)
|
|
229
265
|
new ApiKitValidationRule_1.ApiKitValidationRule(),
|
|
230
266
|
new DisplayNameRule_1.DisplayNameRule(),
|
|
267
|
+
new ConfigPropertiesOrderingRule_1.ConfigPropertiesOrderingRule(), // CFG-001: Config Properties Ordering
|
|
268
|
+
new MissingEnvPropertiesDeclarationRule_1.MissingEnvPropertiesDeclarationRule(), // CFG-002: Missing Env Properties
|
|
269
|
+
new ApikitRouteVariableConsistencyRule_1.ApikitRouteVariableConsistencyRule(), // STD-001: APIKit Route Variable Consistency
|
|
231
270
|
// Governance Rules (PROJ-001, PROJ-002)
|
|
232
271
|
new GovernanceRules_1.PomValidationRule(),
|
|
233
272
|
new GovernanceRules_1.GitHygieneRule(),
|
|
273
|
+
// Connector Rules (SF-001, SF-002)
|
|
274
|
+
new ReplayChannelConfigRule_1.ReplayChannelConfigRule(), // SF-001: Salesforce Replay Channel Config
|
|
275
|
+
new EventListenerNullGuardRule_1.EventListenerNullGuardRule(), // SF-002: Event Listener Null Guard
|
|
234
276
|
];
|
|
235
277
|
/**
|
|
236
278
|
* Get rules by category
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAkSA,gDAEC;AAKD,kCAEC;AAKD,sCAEC;AAlTD,oBAAoB;AACpB,kDAAgC;AAChC,qDAAmC;AAEnC,oCAAoC;AACpC,oFAAiF;AACjF,sFAAmF;AACnF,oEAAiE;AACjE,0EAAuE;AACvE,wEAAqE;AACrE,gEAA6D;AAC7D,gGAA6F;AAC7F,4FAAyF;AACzF,wEAAqE;AAErE,4BAA4B;AAC5B,4DAAyD;AACzD,4DAAyD;AACzD,oEAAiE;AAEjE,8BAA8B;AAC9B,oEAAiE;AACjE,kFAA+E;AAC/E,g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EAAE,6CAA6C;IAEvF,wCAAwC;IACxC,IAAI,mCAAiB,EAAE;IACvB,IAAI,gCAAc,EAAE;IAEpB,mCAAmC;IACnC,IAAI,iDAAuB,EAAE,EAAE,2CAA2C;IAC1E,IAAI,uDAA0B,EAAE,EAAE,oCAAoC;CACvE,CAAC;AAEF;;GAEG;AACH,SAAgB,kBAAkB,CAAC,QAAgB;IACjD,OAAO,iBAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;AAChE,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,EAAU;IACpC,OAAO,iBAAS,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa;IAC3B,OAAO,iBAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -4,6 +4,14 @@ import { BaseRule } from '../base/BaseRule';
|
|
|
4
4
|
* MULE-301: Logger Payload Reference
|
|
5
5
|
*
|
|
6
6
|
* Loggers should not directly reference #[payload] for security/performance.
|
|
7
|
+
* This includes:
|
|
8
|
+
* - Direct payload reference: #[payload]
|
|
9
|
+
* - DataWeave write of full payload: write(payload, 'application/json')
|
|
10
|
+
* - output application/json --- payload (full payload serialization)
|
|
11
|
+
*
|
|
12
|
+
* Logging the entire payload risks exposing PII/sensitive customer data
|
|
13
|
+
* (names, addresses, SSNs, credit cards) and can degrade performance for
|
|
14
|
+
* large payloads.
|
|
7
15
|
*/
|
|
8
16
|
export declare class LoggerPayloadRule extends BaseRule {
|
|
9
17
|
id: string;
|
|
@@ -13,5 +21,12 @@ export declare class LoggerPayloadRule extends BaseRule {
|
|
|
13
21
|
category: "logging";
|
|
14
22
|
validate(doc: Document, _context: ValidationContext): Issue[];
|
|
15
23
|
private hasDirectPayloadReference;
|
|
24
|
+
/**
|
|
25
|
+
* Detect DataWeave patterns that serialize the full payload:
|
|
26
|
+
* - write(payload, 'application/json')
|
|
27
|
+
* - write(payload, "application/json")
|
|
28
|
+
* - output application/json --- payload
|
|
29
|
+
*/
|
|
30
|
+
private hasPayloadSerialization;
|
|
16
31
|
}
|
|
17
32
|
//# sourceMappingURL=LoggerPayloadRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggerPayloadRule.d.ts","sourceRoot":"","sources":["../../../../src/rules/logging/LoggerPayloadRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"LoggerPayloadRule.d.ts","sourceRoot":"","sources":["../../../../src/rules/logging/LoggerPayloadRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C,EAAE,SAAc;IAChB,IAAI,SAA8B;IAClC,WAAW,SAAoD;IAC/D,QAAQ,EAAG,SAAS,CAAU;IAC9B,QAAQ,EAAG,SAAS,CAAU;IAE9B,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,GAAG,KAAK,EAAE;IAuD7D,OAAO,CAAC,yBAAyB;IAUjC;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;CAWhC"}
|