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/20 16:59:45 UTC

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

akshayrai 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_r295903348
 
 

 ##########
 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:
   Yes, session expiry is checked separately by the auth module.

----------------------------------------------------------------
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