From 637c2e49782e53eace55e6b64286a0c5edf66696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Gonza=CC=81lez?= Date: Thu, 22 Aug 2024 09:50:51 +0200 Subject: [PATCH 1/2] Dismiss warning in `CmTool` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The permissions check is already performed by `FormValidation.validateExecutable()`. Signed-off-by: Miguel González --- .../java/com/codicesoftware/plugins/jenkins/tools/CmTool.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/codicesoftware/plugins/jenkins/tools/CmTool.java b/src/main/java/com/codicesoftware/plugins/jenkins/tools/CmTool.java index cb3b96f..d53dd81 100644 --- a/src/main/java/com/codicesoftware/plugins/jenkins/tools/CmTool.java +++ b/src/main/java/com/codicesoftware/plugins/jenkins/tools/CmTool.java @@ -166,6 +166,7 @@ public String getId() { return "plasticscm-cli"; } + @SuppressWarnings("lgtm[jenkins/no-permission-check]") @RequirePOST @Override public FormValidation doCheckHome(@QueryParameter File value) { From f8603b892447fb579ed5470f720d746d6235d48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Gonza=CC=81lez?= Date: Thu, 22 Aug 2024 09:51:56 +0200 Subject: [PATCH 2/2] Dismiss alerts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These methods aren't accessing sensitive information, just checking that the input values match the expected format. Signed-off-by: Miguel González --- .../java/com/codicesoftware/plugins/hudson/PlasticSCM.java | 2 ++ .../java/com/codicesoftware/plugins/hudson/PlasticSCMStep.java | 3 +++ .../codicesoftware/plugins/jenkins/mergebot/MergebotScm.java | 1 + .../plugins/jenkins/mergebot/MergebotScmStep.java | 1 + 4 files changed, 7 insertions(+) diff --git a/src/main/java/com/codicesoftware/plugins/hudson/PlasticSCM.java b/src/main/java/com/codicesoftware/plugins/hudson/PlasticSCM.java index b305286..29d31af 100644 --- a/src/main/java/com/codicesoftware/plugins/hudson/PlasticSCM.java +++ b/src/main/java/com/codicesoftware/plugins/hudson/PlasticSCM.java @@ -680,6 +680,7 @@ public String getDisplayName() { return "Plastic SCM"; } + @SuppressWarnings("lgtm[jenkins/no-permission-check]") @RequirePOST public static FormValidation doCheckSelector(@QueryParameter String value) { return FormChecker.doCheckSelector(value); @@ -767,6 +768,7 @@ public String getDirectory() { @Extension public static class DescriptorImpl extends Descriptor { + @SuppressWarnings("lgtm[jenkins/no-permission-check]") @RequirePOST public static FormValidation doCheckSelector(@QueryParameter String value) { return FormChecker.doCheckSelector(value); diff --git a/src/main/java/com/codicesoftware/plugins/hudson/PlasticSCMStep.java b/src/main/java/com/codicesoftware/plugins/hudson/PlasticSCMStep.java index 67697a3..5b0117f 100644 --- a/src/main/java/com/codicesoftware/plugins/hudson/PlasticSCMStep.java +++ b/src/main/java/com/codicesoftware/plugins/hudson/PlasticSCMStep.java @@ -175,16 +175,19 @@ public String getDisplayName() { return "Plastic SCM"; } + @SuppressWarnings("lgtm[jenkins/no-permission-check]") @RequirePOST public FormValidation doCheckBranch(@QueryParameter String value) { return FormChecker.doCheckBranch(value); } + @SuppressWarnings("lgtm[jenkins/no-permission-check]") @RequirePOST public FormValidation doCheckRepository(@QueryParameter String value) { return FormChecker.doCheckRepository(value); } + @SuppressWarnings("lgtm[jenkins/no-permission-check]") @RequirePOST public FormValidation doCheckServer(@QueryParameter String value) { return FormChecker.doCheckServer(value); diff --git a/src/main/java/com/codicesoftware/plugins/jenkins/mergebot/MergebotScm.java b/src/main/java/com/codicesoftware/plugins/jenkins/mergebot/MergebotScm.java index c44b962..662c7f1 100644 --- a/src/main/java/com/codicesoftware/plugins/jenkins/mergebot/MergebotScm.java +++ b/src/main/java/com/codicesoftware/plugins/jenkins/mergebot/MergebotScm.java @@ -222,6 +222,7 @@ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item item, @QueryPa return FormFiller.doFillCredentialsIdItems(item, credentialsId); } + @SuppressWarnings("lgtm[jenkins/no-permission-check]") @RequirePOST public static FormValidation doCheckSpeckAttributeName(@QueryParameter String value) { return Util.fixEmpty(value) == null diff --git a/src/main/java/com/codicesoftware/plugins/jenkins/mergebot/MergebotScmStep.java b/src/main/java/com/codicesoftware/plugins/jenkins/mergebot/MergebotScmStep.java index bdb6a41..ee2f9fa 100644 --- a/src/main/java/com/codicesoftware/plugins/jenkins/mergebot/MergebotScmStep.java +++ b/src/main/java/com/codicesoftware/plugins/jenkins/mergebot/MergebotScmStep.java @@ -93,6 +93,7 @@ public static String getDefaultSpecAttributeName() { return MergebotScm.UPDATE_TO_SPEC_PARAMETER_NAME; } + @SuppressWarnings("lgtm[jenkins/no-permission-check]") @RequirePOST public static FormValidation doCheckSpecAttributeName(@QueryParameter String value) { return Util.fixEmpty(value) == null