forked from fortify-ps/FortifyBugTrackerUtility
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SSC 'Add Existing Bugs' bug tracker implementation
- Loading branch information
Ruud Senden
committed
Sep 12, 2017
1 parent
f1516d3
commit 3fa6d7c
Showing
9 changed files
with
258 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2017 Hewlett Packard Enterprise | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to permit | ||
persons to whom the Software is furnished to do so, subject to the | ||
following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY | ||
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
DEALINGS IN THE SOFTWARE. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<!-- | ||
(c) Copyright 2017 Hewlett Packard Enterprise Development LP | ||
Permission is hereby granted, free of charge, to any person obtaining a | ||
copy of this software and associated documentation files (the Software"), | ||
to deal in the Software without restriction, including without limitation | ||
the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
and/or sell copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included | ||
in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY | ||
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
IN THE SOFTWARE. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.fortify.pub.bugtracker.plugin.add-existing-bug</groupId> | ||
<artifactId>ssc-bugtracker-add-existing-bug</artifactId> | ||
<version>1.0</version> | ||
<description><![CDATA[ | ||
This SSC bug tracker plugin allows for adding existing bug links to vulnerabilities. | ||
]]> | ||
</description> | ||
<organization> | ||
<name>HPE Security Fortify</name> | ||
<url>http://www8.hp.com/us/en/software-solutions/application-security/</url> | ||
</organization> | ||
<licenses> | ||
<license> | ||
<name>MIT License</name> | ||
<url>http://www.opensource.org/licenses/mit-license.php</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<developers> | ||
<developer> | ||
<id>rsenden</id> | ||
<name>Ruud Senden</name> | ||
<organization>HPE Security Fortify</organization> | ||
</developer> | ||
</developers> | ||
<inceptionYear>2017</inceptionYear> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.fortify.ssc</groupId> | ||
<artifactId>fortify-public</artifactId> | ||
<version>17.10.0158</version> | ||
<scope>system</scope> | ||
<systemPath>${project.basedir}/lib/fortify-public-17.10.0.0158.jar</systemPath> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.11</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.fortify.ssc</groupId> | ||
<artifactId>fortify-public</artifactId> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<version>2.2.1</version> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
130 changes: 130 additions & 0 deletions
130
...java/com/fortify/pub/bugtracker/plugin/addexistingbug/AddExistingBugBugTrackerPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
/******************************************************************************* | ||
* (c) Copyright 2017 Hewlett Packard Enterprise Development LP | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included | ||
* in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY | ||
* KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
******************************************************************************/ | ||
package com.fortify.pub.bugtracker.plugin.addexistingbug; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.fortify.pub.bugtracker.plugin.AbstractBatchBugTrackerPlugin; | ||
import com.fortify.pub.bugtracker.plugin.BugTrackerPluginImplementation; | ||
import com.fortify.pub.bugtracker.support.Bug; | ||
import com.fortify.pub.bugtracker.support.BugParam; | ||
import com.fortify.pub.bugtracker.support.BugParamText; | ||
import com.fortify.pub.bugtracker.support.BugSubmission; | ||
import com.fortify.pub.bugtracker.support.BugTrackerConfig; | ||
import com.fortify.pub.bugtracker.support.IssueDetail; | ||
import com.fortify.pub.bugtracker.support.MultiIssueBugSubmission; | ||
import com.fortify.pub.bugtracker.support.UserAuthenticationStore; | ||
|
||
@BugTrackerPluginImplementation | ||
public class AddExistingBugBugTrackerPlugin extends AbstractBatchBugTrackerPlugin { | ||
|
||
public List<BugParam> getBatchBugParameters(UserAuthenticationStore paramUserAuthenticationStore) { | ||
BugParam bp = new BugParamText(); | ||
bp.setIdentifier("existingBugLink"); | ||
bp.setDisplayLabel("Existing bug link"); | ||
bp.setRequired(true); | ||
return Arrays.asList(bp); | ||
} | ||
|
||
public List<BugParam> onBatchBugParameterChange(String paramString, List<BugParam> paramList, UserAuthenticationStore paramUserAuthenticationStore) { | ||
return getBatchBugParameters(paramUserAuthenticationStore); | ||
} | ||
|
||
public Bug fileMultiIssueBug(MultiIssueBugSubmission paramMultiIssueBugSubmission, UserAuthenticationStore paramUserAuthenticationStore) { | ||
String existingBugLink = paramMultiIssueBugSubmission.getParams().get("existingBugLink"); | ||
return new Bug(existingBugLink, ""); | ||
} | ||
|
||
public boolean isBugOpen(Bug paramBug, UserAuthenticationStore paramUserAuthenticationStore) { | ||
return true; | ||
} | ||
|
||
public boolean isBugClosed(Bug paramBug, UserAuthenticationStore paramUserAuthenticationStore) { | ||
return false; | ||
} | ||
|
||
public boolean isBugClosedAndCanReOpen(Bug paramBug, UserAuthenticationStore paramUserAuthenticationStore) { | ||
return false; | ||
} | ||
|
||
public void reOpenBug(Bug paramBug, String paramString, UserAuthenticationStore paramUserAuthenticationStore) { | ||
throw new IllegalAccessError("Not implemented"); | ||
} | ||
|
||
public void addCommentToBug(Bug paramBug, String paramString, UserAuthenticationStore paramUserAuthenticationStore) { | ||
throw new IllegalAccessError("Not implemented"); | ||
} | ||
|
||
public Bug fetchBugDetails(String existingBugLink, UserAuthenticationStore paramUserAuthenticationStore) { | ||
return new Bug(existingBugLink, ""); | ||
} | ||
|
||
public Bug fileBug(BugSubmission paramBugSubmission, UserAuthenticationStore paramUserAuthenticationStore) { | ||
String existingBugLink = paramBugSubmission.getParams().get("existingBugLink"); | ||
return new Bug(existingBugLink, ""); | ||
} | ||
|
||
public String getBugDeepLink(String existingBugLink) { | ||
return existingBugLink; | ||
} | ||
|
||
public List<BugParam> getBugParameters(IssueDetail paramIssueDetail, UserAuthenticationStore paramUserAuthenticationStore) { | ||
return getBatchBugParameters(paramUserAuthenticationStore); | ||
} | ||
|
||
public List<BugTrackerConfig> getConfiguration() { | ||
return Arrays.asList(new BugTrackerConfig[]{}); | ||
} | ||
|
||
public String getLongDisplayName() { | ||
return getShortDisplayName(); | ||
} | ||
|
||
public String getShortDisplayName() { | ||
return "Add Existing Bugs"; | ||
} | ||
|
||
public List<BugParam> onParameterChange(IssueDetail paramIssueDetail, String paramString, List<BugParam> paramList, UserAuthenticationStore paramUserAuthenticationStore) { | ||
return getBatchBugParameters(paramUserAuthenticationStore); | ||
} | ||
|
||
public boolean requiresAuthentication() { | ||
return false; | ||
} | ||
|
||
public void setConfiguration(Map<String, String> paramMap) { | ||
// Nothing to do | ||
} | ||
|
||
public void testConfiguration(UserAuthenticationStore paramUserAuthenticationStore) { | ||
// Nothing to do | ||
} | ||
|
||
public void validateCredentials(UserAuthenticationStore paramUserAuthenticationStore) { | ||
// Nothing to do | ||
} | ||
|
||
} |