Skip to content

Commit 0478411

Browse files
authored
Merge pull request #6680 from psiinon/auto/enable
automation: Do not warn if "enabled" or "alwaysRun" properties specified
2 parents 8a7c26f + 0c98a7d commit 0478411

File tree

9 files changed

+7
-17
lines changed

9 files changed

+7
-17
lines changed

addOns/automation/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1515
### Fixed
1616
- Bug in handling headers with colons in the values.
1717
- Use default authentication poll frequency when none specified, if the value is less than one a progress warning occurs.
18+
- Do not warn if "enabled" or "alwaysRun" properties specified.
1819

1920
## [0.51.0] - 2025-07-17
2021
### Added

addOns/automation/src/main/java/org/zaproxy/addon/automation/AutomationPlan.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public AutomationPlan(ExtensionAutomation ext, File file) throws IOException {
103103
}
104104
LinkedHashMap<?, ?> jobData = (LinkedHashMap<?, ?>) jobObj;
105105

106-
Object jobType = jobData.get("type");
106+
Object jobType = jobData.remove("type");
107107
if (jobType == null) {
108108
progress.error(
109109
Constant.messages.getString("automation.error.job.notype", jobType));
@@ -113,7 +113,7 @@ public AutomationPlan(ExtensionAutomation ext, File file) throws IOException {
113113
if (job != null) {
114114
try {
115115
job = job.newJob();
116-
Object jobName = jobData.get("name");
116+
Object jobName = jobData.remove("name");
117117
if (jobName != null) {
118118
if (jobName instanceof String) {
119119
job.setName((String) jobName);
@@ -132,7 +132,7 @@ public AutomationPlan(ExtensionAutomation ext, File file) throws IOException {
132132
continue;
133133
}
134134

135-
Object jobEnabled = jobData.get("enabled");
135+
Object jobEnabled = jobData.remove("enabled");
136136
if (jobEnabled != null) {
137137
if (jobEnabled instanceof Boolean enableBool) {
138138
job.setEnabled(enableBool);
@@ -143,7 +143,7 @@ public AutomationPlan(ExtensionAutomation ext, File file) throws IOException {
143143
}
144144
}
145145

146-
Object alwaysRun = jobData.get("alwaysRun");
146+
Object alwaysRun = jobData.remove("alwaysRun");
147147
if (alwaysRun != null) {
148148
if (alwaysRun instanceof Boolean jobBool) {
149149
job.setAlwaysRun(jobBool);

addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/ActiveScanConfigJob.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ public void verifyParameters(AutomationProgress progress) {
9595
JobUtils.verifyRegexes(jobData.get(key), key.toString(), progress));
9696
break;
9797

98-
case "name":
99-
case "type":
100-
break;
101-
10298
default:
10399
progress.warn(
104100
Constant.messages.getString(

addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/ActiveScanJob.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ public void verifyParameters(AutomationProgress progress) {
103103
params, this.parameters, this.getName(), null, progress);
104104
break;
105105
case "policyDefinition":
106-
case "name":
107106
case "tests":
108-
case "type":
109107
// Handled before we get here
110108
break;
111109
default:

addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/ActiveScanPolicyJob.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ public void verifyParameters(AutomationProgress progress) {
8989
policyDefinition.parsePolicyDefinition(
9090
jobData.get(key), this.getName(), progress);
9191
break;
92-
case "name":
9392
case "tests":
94-
case "type":
9593
// Handled before we get here
9694
break;
9795
default:

addOns/automation/src/test/java/org/zaproxy/addon/automation/jobs/ActiveScanJobUnitTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ void shouldReturnWarningOnUnexpectedElement() throws MalformedURLException {
419419
ActiveScanJob job = new ActiveScanJob();
420420
AutomationProgress progress = new AutomationProgress();
421421
LinkedHashMap<String, String> data = new LinkedHashMap<>();
422-
data.put("name", "blah");
423422
data.put("tests", "");
424423
// The only invalid one
425424
data.put("unexpected", "data");

addOns/automation/src/test/java/org/zaproxy/addon/automation/jobs/ActiveScanPolicyJobUnitTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ void shouldReturnWarningOnUnexpectedElement() throws MalformedURLException {
163163
ActiveScanPolicyJob job = new ActiveScanPolicyJob();
164164
AutomationProgress progress = new AutomationProgress();
165165
LinkedHashMap<String, String> data = new LinkedHashMap<>();
166-
data.put("name", "blah");
167166
data.put("tests", "");
168167
// The only invalid one
169168
data.put("unexpected", "data");

addOns/sequence/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ All notable changes to this add-on will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## Unreleased
7-
7+
### Changed
8+
- Maintenance changes.
89

910
## [8] - 2025-01-10
1011
### Added

addOns/sequence/src/main/java/org/zaproxy/zap/extension/sequence/automation/SequenceActiveScanJob.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ public void verifyParameters(AutomationProgress progress) {
116116
params, this.parameters, this.getName(), null, progress);
117117
break;
118118
case "policyDefinition":
119-
case "name":
120119
case "tests":
121-
case "type":
122120
// Handled before we get here
123121
break;
124122
default:

0 commit comments

Comments
 (0)