-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dynamic Security Analysis] Add endpoints for managing parameters and running computation #665
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
String endPointUrl = buildEndPointUrl(getBaseUri(), DYNAMIC_SECURITY_ANALYSIS_API_VERSION, DYNAMIC_SECURITY_ANALYSIS_END_POINT_PARAMETER); | ||
|
||
String url = UriComponentsBuilder | ||
.fromHttpUrl(endPointUrl + "{uuid}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this literal is used 3 times in the code. Define a constant instead.
} | ||
|
||
public void updateProvider(UUID parametersUuid, String provider) { | ||
Objects.requireNonNull(parametersUuid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use NonNull annotation instead of this kind of check :
public void updateProvider(@NonNull UUID parametersUuid, @NonNull String provider) { ...}
} | ||
|
||
public UUID createParameters(String parametersInfos) { | ||
Objects.requireNonNull(parametersInfos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NonNull annotation ?
Objects.requireNonNull(parametersUuid); | ||
Objects.requireNonNull(provider); | ||
|
||
String endPointUrl = buildEndPointUrl(getBaseUri(), DYNAMIC_SECURITY_ANALYSIS_API_VERSION, DYNAMIC_SECURITY_ANALYSIS_END_POINT_PARAMETER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is called in almost every function, maybe put it in class member attribute :
endpointUrl for example or class member function to avoid code duplication.
} | ||
|
||
public DynamicSecurityAnalysisStatus getStatus(UUID resultUuid) { | ||
if (resultUuid == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe simplify :
return resultUuid == null ? null : dynamicSecurityAnalysisClient.getStatus(resultUuid);
return dynamicSecurityAnalysisClient.getResultsCount(); | ||
} | ||
|
||
public void assertDynamicSecurityAnalysisNotRunning(UUID resultUuid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is not used !
public void invalidateStatus(List<UUID> resultUuids) { | ||
|
||
if (resultUuids.isEmpty()) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you check for not empty and in this case call the rest of the code ?
Signed-off-by: Thang PHAM <[email protected]>
Signed-off-by: Thang PHAM <[email protected]>
|
No description provided.