You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/02/27 22:03:00 UTC

[GitHub] [incubator-gobblin] arjun4084346 commented on a change in pull request #2890: [GOBBLIN-1050] Verify requester when updating/deleting FlowConfig

arjun4084346 commented on a change in pull request #2890: [GOBBLIN-1050] Verify requester when updating/deleting FlowConfig
URL: https://github.com/apache/incubator-gobblin/pull/2890#discussion_r385397444
 
 

 ##########
 File path: gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigsResource.java
 ##########
 @@ -124,12 +124,38 @@ public UpdateResponse update(ComplexResourceKey<FlowId, EmptyRecord> key, FlowCo
    */
   @Override
   public UpdateResponse delete(ComplexResourceKey<FlowId, EmptyRecord> key) {
+    checkRequester(get(key), this.requesterService.findRequesters(this));
     String flowGroup = key.getKey().getFlowGroup();
     String flowName = key.getKey().getFlowName();
     FlowId flowId = new FlowId().setFlowGroup(flowGroup).setFlowName(flowName);
     return this.flowConfigsResourceHandler.deleteFlowConfig(flowId, getHeaders());
   }
 
+  /**
+   * Check that all {@link ServiceRequester}s in this request are contained within the original service requester list
+   * when the flow was submitted and throw a {@link FlowConfigLoggedException} if they are not.
+   *
+   * @param originalFlowConfig original flow config to find original requester
+   * @param requesterList list of requesters for this request
+   */
+  public static void checkRequester(FlowConfig originalFlowConfig, List<ServiceRequester> requesterList) {
 
 Review comment:
   I think this method should return a boolean.
   Or at least javadoc needs to have information on what it throws and what that means.

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