Skip to content

Commit

Permalink
added permission and csrf protection
Browse files Browse the repository at this point in the history
  • Loading branch information
jameeluddin committed Feb 9, 2022
1 parent abfbe8a commit e06b1ff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/java/io/jenkins/plugins/autonomiq/AutonomiqBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ public String getDisplayName() {
}

@SuppressWarnings("unused")
@POST
public ListBoxModel doFillProjectItems(@QueryParameter String aiqUrl,
@QueryParameter String login,
@QueryParameter Secret password,
Expand All @@ -661,6 +662,8 @@ public ListBoxModel doFillProjectItems(@QueryParameter String aiqUrl,
@QueryParameter String proxyUser,
@QueryParameter Secret proxyPassword,
@QueryParameter Boolean httpProxy) {
Jenkins.get().checkPermission(Jenkins.ADMINISTER);


// make sure other fields have been filled in
if (aiqUrl.length() > 0 && login.length() > 0 && Secret.toString(password).length() > 0) {
Expand All @@ -681,7 +684,10 @@ public ListBoxModel doFillProjectItems(@QueryParameter String aiqUrl,
}

@SuppressWarnings("unused")
@POST
public ListBoxModel doFillPlatformTestCasesItems() {
Jenkins.get().checkPermission(Jenkins.ADMINISTER);


String[] values = {"Linux"}; //, "Windows"};

Expand All @@ -690,7 +696,10 @@ public ListBoxModel doFillPlatformTestCasesItems() {
return new ListBoxModel(options);
}
@SuppressWarnings("unused")
@POST
public ListBoxModel doFillPlatformTestSuitesItems() {
Jenkins.get().checkPermission(Jenkins.ADMINISTER);


String[] values = {"Linux"}; //, "Windows"};

Expand All @@ -701,7 +710,10 @@ public ListBoxModel doFillPlatformTestSuitesItems() {


@SuppressWarnings("unused")
@POST
public ListBoxModel doFillBrowserTestCasesItems() {
Jenkins.get().checkPermission(Jenkins.ADMINISTER);


String[] values = {"Chrome", "Firefox"};

Expand All @@ -710,7 +722,9 @@ public ListBoxModel doFillBrowserTestCasesItems() {
return new ListBoxModel(options);
}
@SuppressWarnings("unused")
@POST
public ListBoxModel doFillBrowserTestSuitesItems() {
Jenkins.get().checkPermission(Jenkins.ADMINISTER);

String[] values = {"Chrome", "Firefox"};

Expand All @@ -720,7 +734,10 @@ public ListBoxModel doFillBrowserTestSuitesItems() {
}

@SuppressWarnings("unused")
@POST
public ListBoxModel doFillExecutionModeItems() {
Jenkins.get().checkPermission(Jenkins.ADMINISTER);


String[] values = {"serial", "parallel"};

Expand Down

0 comments on commit e06b1ff

Please sign in to comment.