[
https://issues.apache.org/jira/browse/GOBBLIN-1304?focusedWorklogId=508556&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-508556
]
ASF GitHub Bot logged work on GOBBLIN-1304:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 06/Nov/20 18:19
Start Date: 06/Nov/20 18:19
Worklog Time Spent: 10m
Work Description: Will-Lo commented on a change in pull request #3142:
URL: https://github.com/apache/incubator-gobblin/pull/3142#discussion_r518924533
##########
File path:
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-client/src/test/java/org/apache/gobblin/service/FlowConfigV2Test.java
##########
@@ -185,20 +203,102 @@ public void testBadPartialUpdate() throws Exception {
_client.partialUpdateFlowConfig(flowId, flowConfigPatch);
}
- @Test (expectedExceptions = RestLiResponseException.class)
+ @Test
public void testDisallowedRequester() throws Exception {
- ServiceRequester testRequester = new ServiceRequester("testName",
"testType", "testFrom");
- _requesterService.setRequester(testRequester);
+ try {
+ ServiceRequester testRequester = new ServiceRequester("testName",
"testType", "testFrom");
+ _requesterService.setRequester(testRequester);
+
+ Map<String, String> flowProperties = Maps.newHashMap();
+ flowProperties.put("param1", "value1");
+
+ FlowConfig flowConfig = new FlowConfig().setId(new
FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME_4))
+ .setTemplateUris(TEST_TEMPLATE_URI)
+ .setProperties(new StringMap(flowProperties));
+ _client.createFlowConfig(flowConfig);
+
+ testRequester.setName("testName2");
+ _client.deleteFlowConfig(new
FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME_4));
+ } catch (RestLiResponseException e) {
+ Assert.assertEquals(e.getStatus(), HttpStatus.ORDINAL_401_Unauthorized);
+ }
+ }
+ @Test
+ public void testGroupRequesterAllowed() throws Exception {
+ ServiceRequester testRequester = new ServiceRequester("testName",
"USER_PRINCIPAL", "testFrom");
+ _requesterService.setRequester(testRequester);
Map<String, String> flowProperties = Maps.newHashMap();
- flowProperties.put("param1", "value1");
- FlowConfig flowConfig = new FlowConfig().setId(new
FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME))
- .setTemplateUris(TEST_TEMPLATE_URI).setProperties(new
StringMap(flowProperties));
- _client.createFlowConfig(flowConfig);
+ FlowConfig flowConfig = new FlowConfig().setId(new
FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME_5))
+ .setTemplateUris(TEST_TEMPLATE_URI)
+ .setProperties(new StringMap(flowProperties))
+ .setOwningGroup("testGroup");
+
+ _client.createFlowConfig(flowConfig);
testRequester.setName("testName2");
- _client.deleteFlowConfig(new
FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME));
+ _client.deleteFlowConfig(new
FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME_5));
+ }
+
+ @Test
+ public void testGroupRequesterRejected() throws Exception {
Review comment:
testDisallowedRequester doesn't test using owning groups, it was
originally used to test the requester service. This tests for a group member
that isn't part of a group that exists. They are pretty similar though.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 508556)
Time Spent: 1h 50m (was: 1h 40m)
> Group Ownership Service
> -----------------------
>
> Key: GOBBLIN-1304
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1304
> Project: Apache Gobblin
> Issue Type: Improvement
> Components: gobblin-service
> Reporter: William Lo
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> Add an option for users to specify owning_groups, so that other requesters
> within the same group can modify and delete flows.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)