You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/06/19 18:36:52 UTC

[GitHub] [incubator-pinot] jihaozh commented on a change in pull request #4341: [TE] Authorize service account to prevent config modification

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org