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_r295922258
##########
File path:
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/yaml/YamlResource.java
##########
@@ -375,6 +398,43 @@ void updateDetectionPipeline(long detectionID, String
payload, long startTime, l
}
}
+ private boolean isServiceAccount(ThirdEyePrincipal user) {
+ List<Predicate> predicates = new ArrayList<>();
+ predicates.add(Predicate.EQ("sessionKey", user.getSessionKey()));
+ predicates.add(Predicate.EQ("principalType", "SERVICE"));
+
+ List<SessionDTO> sessionDTO =
this.sessionDAO.findByPredicate(Predicate.AND(predicates.toArray(new
Predicate[0])));
+ return sessionDTO != null && !sessionDTO.isEmpty();
Review comment:
make sense
----------------------------------------------------------------
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]