From 89b36f8ad6e0116420e090256d6cbd1ab4d11a63 Mon Sep 17 00:00:00 2001 From: alexrodriguez <alejandro.rodriguez@tecnalia.com> Date: Mon, 12 Dec 2022 14:42:19 +0100 Subject: [PATCH] Disable dangerous method. --- .../urbanite/anonymize/rest/AnonymizerAPI.java | 3 ++- .../urbanite/anonymize/service/AnonymizerService.java | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/tecnalia/urbanite/anonymize/rest/AnonymizerAPI.java b/src/main/java/com/tecnalia/urbanite/anonymize/rest/AnonymizerAPI.java index d987c10..641218d 100644 --- a/src/main/java/com/tecnalia/urbanite/anonymize/rest/AnonymizerAPI.java +++ b/src/main/java/com/tecnalia/urbanite/anonymize/rest/AnonymizerAPI.java @@ -45,7 +45,8 @@ public class AnonymizerAPI { @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Successful operation."), @ApiResponse(responseCode = "400", description = "Bad request. (User unknow)")}) - @Operation(summary = "Anonymize property that has certain value", description = "Change the value {value} of the {property} for a hash.") + @Operation(summary = "Anonymize property that has certain value", description = "Change the value {value} of the {property} for a hash..\\n\"" + + "<br/><br/><b>THIS SERVICE HAS BEEN DISABLED IN THE TEST ENVIRONMENT</b> ") public ResponseEntity<String> anonymizeUser( @Parameter(description = "City where is the data to be processed") @PathVariable City city, @Parameter(description = "Model that is going to be anonymized.", example = "vehicle") @PathVariable String model, diff --git a/src/main/java/com/tecnalia/urbanite/anonymize/service/AnonymizerService.java b/src/main/java/com/tecnalia/urbanite/anonymize/service/AnonymizerService.java index 7e14b62..c45b6fc 100644 --- a/src/main/java/com/tecnalia/urbanite/anonymize/service/AnonymizerService.java +++ b/src/main/java/com/tecnalia/urbanite/anonymize/service/AnonymizerService.java @@ -45,14 +45,14 @@ public class AnonymizerService { JSONObject object = objects.getJSONObject(i); String propertyAnonimizied = Crypto.generateHash((String) object.get(property)); object.put(property, propertyAnonimizied); - JSONObject result = dataService.updateObjects(object, model, city,object.getString("id")); + //JSONObject result = dataService.updateObjects(object, model, city,object.getString("id")); - if (result.has("Error")) { + /*if (result.has("Error")) { return new ResponseEntity<>("Error while anonymizig:" + property + ". Please try again !!\n " + result.getString("Error"), HttpStatus.INTERNAL_SERVER_ERROR); } - else { - System.out.println(result.toString()); - } + else {*/ + System.out.println("THIS SERVICE HAS BEEN DISABLED IN THE TEST ENVIRONMENT");//result.toString()); + /*}*/ } } -- GitLab