Skip to content

Commit

Permalink
Remove more CSP issues (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
timja authored Nov 17, 2024
1 parent 1a5b0db commit 573775e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.verb.POST;

public class WAStoragePublisher extends Recorder implements SimpleBuildStep {
private static final Logger LOGGER = Logger.getLogger(WAStoragePublisher.class.getName());
Expand Down Expand Up @@ -639,6 +640,7 @@ public boolean configure(StaplerRequest req, JSONObject formData)
* @throws IOException

Check warning on line 640 in src/main/java/com/microsoftopentechnologies/windowsazurestorage/WAStoragePublisher.java

View check run for this annotation

ci.jenkins.io / Java Compiler

spotbugs:spotbugs

NORMAL: warning: no description for @throws
* @throws ServletException

Check warning on line 641 in src/main/java/com/microsoftopentechnologies/windowsazurestorage/WAStoragePublisher.java

View check run for this annotation

ci.jenkins.io / Java Compiler

spotbugs:spotbugs

NORMAL: warning: no description for @throws

Check warning on line 641 in src/main/java/com/microsoftopentechnologies/windowsazurestorage/WAStoragePublisher.java

View check run for this annotation

ci.jenkins.io / JavaDoc

JavaDoc @throws

NORMAL: no description for @throws
*/
@POST
public FormValidation doCheckAccount(
//CHECKSTYLE:OFF
@QueryParameter String was_storageAccName,
Expand Down Expand Up @@ -671,17 +673,8 @@ public FormValidation doCheckAccount(
return FormValidation.ok(Messages.WAStoragePublisher_SA_val());
}

/**
* Checks for valid container name.
*
* @param request
* @return FormValidation result
* @throws IOException
* @throws ServletException
*/
public FormValidation doCheckContainerName(StaplerRequest request)
throws IOException, ServletException {
final String containerName = request.getParameter("val");
@POST
public FormValidation doCheckContainerName(@QueryParameter("value") String containerName) {
if (!StringUtils.isBlank(containerName)) {
// Token resolution happens dynamically at runtime , so for
// basic validations
Expand All @@ -696,8 +689,8 @@ public FormValidation doCheckContainerName(StaplerRequest request)
}
}

public FormValidation doCheckFileShareName(StaplerRequest request) {
final String fileShareName = request.getParameter("val");
@POST
public FormValidation doCheckFileShareName(@QueryParameter("value") String fileShareName) {
if (!StringUtils.isBlank(fileShareName)) {
// Token resolution happens dynamically at runtime , so for
// basic validations
Expand All @@ -712,14 +705,16 @@ public FormValidation doCheckFileShareName(StaplerRequest request) {
}
}

public FormValidation doCheckPath(@QueryParameter String val) {
if (StringUtils.isBlank(val)) {
@POST
public FormValidation doCheckFilesPath(@QueryParameter String value) {
if (StringUtils.isBlank(value)) {

Check warning on line 710 in src/main/java/com/microsoftopentechnologies/windowsazurestorage/WAStoragePublisher.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 710 is not covered by tests
return FormValidation.error(Messages
.WAStoragePublisher_artifacts_req());
}
return FormValidation.ok();
}

@POST
public FormValidation doCheckBlobName(@QueryParameter String val) {
if (StringUtils.isBlank(val)) {
return FormValidation.error(Messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<c:select expressionAllowed="false"/>
</f:entry>
<f:entry title="${%filesPath_title}" field="filesPath" help="/plugin/windows-azure-storage/help-filesPath.html">
<f:textbox
checkUrl="'${rootURL}/publisher/WAStoragePublisher/checkPath?val='+encodeURIComponent(this.value)"/>
<f:textbox />
</f:entry>

<f:section title="${%storageType_title}">
Expand All @@ -17,8 +16,7 @@
<f:nested>
<f:entry title="${%containerName_title}" field="containerName"
help="/plugin/windows-azure-storage/help-containerName.html">
<f:textbox
checkUrl="'${rootURL}/publisher/WAStoragePublisher/checkContainerName?val='+escape(this.value)"/>
<f:textbox />
</f:entry>
</f:nested>
</f:radioBlock>
Expand All @@ -28,8 +26,7 @@
<f:nested>
<f:entry title="${%fileShareName_title}" field="fileShareName"
help="/plugin/windows-azure-storage/help-azureFileShareName.html">
<f:textbox
checkUrl="'${rootURL}/publisher/WAStoragePublisher/checkFileShareName?val='+escape(this.value)"/>
<f:textbox />
</f:entry>
</f:nested>
</f:radioBlock>
Expand Down

0 comments on commit 573775e

Please sign in to comment.