use of com.contrastsecurity.models.Rules in project contrast-continuous-application-security-plugin by jenkinsci.
the class VulnerabilityTrendHelper method saveRules.
/**
* Retrieves the enabled rules for an organization
*
* @param sdk Contrast SDK object
* @param organizationUuid uuid of the organization
*/
public static List<VulnerabilityType> saveRules(ContrastSDK sdk, String organizationUuid) {
Rules rules;
List<VulnerabilityType> vulnerabilityTypes = new ArrayList<>();
try {
rules = sdk.getRules(organizationUuid);
} catch (IOException | UnauthorizedException e) {
return vulnerabilityTypes;
}
for (Rules.Rule rule : rules.getRules()) {
vulnerabilityTypes.add(new VulnerabilityType(rule.getName(), rule.getTitle()));
}
return vulnerabilityTypes;
}
Aggregations