Skip to content
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

fix : fix DatasetResources.java and DatasetService in it #732

Conversation

HugoBouttes
Copy link
Contributor

@HugoBouttes HugoBouttes commented Aug 21, 2024

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
E Security Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@@ -73,21 +75,21 @@
@PathVariable("id") String datasetId,
@Parameter(description = "Dataset", required = true) @RequestBody String body) throws RmesException {

return this.datasetService.update(datasetId, body);
return datasetService.update(datasetId, body);

Check failure

Code scanning / SonarCloud

Endpoints should not be vulnerable to reflected cross-site scripting (XSS) attacks High

Change this code to not reflect user-controlled data. See more on SonarCloud
}

@PreAuthorize("isAdmin() || isDatasetContributorWithStamp(#datasetId)")
@PutMapping("/{id}/validate")
@Operation(operationId = "publishDataset", summary = "Publish a dataset",
responses = {@ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = Distribution.class))))})
public String publishDataset(@PathVariable(Constants.ID) String datasetId) throws RmesException {
return this.datasetService.publishDataset(datasetId);
return datasetService.publishDataset(datasetId);

Check failure

Code scanning / SonarCloud

Endpoints should not be vulnerable to reflected cross-site scripting (XSS) attacks High

Change this code to not reflect user-controlled data. See more on SonarCloud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix code scanning alert - Endpoints should not be vulnerable to reflected cross-site scripting (XSS) attacks
1 participant