jihaozh commented on a change in pull request #4341: [TE] Authorize service 
account to prevent config modification
URL: https://github.com/apache/incubator-pinot/pull/4341#discussion_r295446667
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/yaml/YamlResource.java
 ##########
 @@ -222,12 +230,23 @@ private Response processServerErrorResponse(String type, 
String operation, Strin
     return Response.serverError().entity(responseMessage).build();
   }
 
+  private Response processBadAuthorizationResponse(String type, String 
operation, String payload, NotAuthorizedException e) {
+    Map<String, String> responseMessage = new HashMap<>();
+    LOG.warn("Authorization error while {} {} with payload {}", operation, 
type, payload, e);
+    responseMessage.put(type + "Msg", "Authorization Error!");
+    responseMessage.put(type + "Msg-moreInfo", "Configure owners property in " 
+ type + " config");
+    return 
Response.status(Response.Status.UNAUTHORIZED).entity(responseMessage).build();
+  }
+
   @POST
   @Path("/create-alert")
   @Produces(MediaType.APPLICATION_JSON)
   @Consumes(MediaType.APPLICATION_JSON)
+  @PermitAll
 
 Review comment:
   Why `PermitAll`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to