Class ValidationUtils
- java.lang.Object
-
- io.jenkins.plugins.google.analyze.code.security.utils.ValidationUtils
-
public final class ValidationUtils extends Object
ValidationUtils provides validation helper methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkPermissions(Item item)
Ensures the executing user has the permissions to be running this step.static ValidationResponse
isValidFailureConfig(Boolean ignoreAssetViolation, List<AssetViolationConfig> assetViolationConfigs)
Validates if failureConfig is valid.static boolean
isValidJSON(@NonNull String json)
Validates if the JSON is valid.static boolean
isValidJSONFile(byte[] json)
Validates if the contents of file are valid JSON.static boolean
isValidOrgId(String orgID)
Validates if an orgID is valid.static boolean
isValidScanTimeOut(Integer scanTimeOut)
Validates if scanTimeOut Config is valid.
-
-
-
Method Detail
-
isValidJSON
public static boolean isValidJSON(@NonNull @NonNull String json)
Validates if the JSON is valid.
-
isValidJSONFile
public static boolean isValidJSONFile(byte[] json)
Validates if the contents of file are valid JSON.
-
isValidOrgId
public static boolean isValidOrgId(String orgID)
Validates if an orgID is valid.
-
isValidScanTimeOut
public static boolean isValidScanTimeOut(Integer scanTimeOut)
Validates if scanTimeOut Config is valid.
-
isValidFailureConfig
public static ValidationResponse isValidFailureConfig(Boolean ignoreAssetViolation, List<AssetViolationConfig> assetViolationConfigs)
Validates if failureConfig is valid.Following are conditions for a string to be a valid failureConfig: 1. It must contain atleast one Severity. 2. It must contain each Severity at most once
- Parameters:
ignoreAssetViolation
- build step config that determines if violations should be ignoredassetViolationConfigs
- threshold configs based on severity.
-
checkPermissions
public static void checkPermissions(Item item)
Ensures the executing user has the permissions to be running this step.
-
-