Commit 92bcc989 authored by Rucha Deshpande's avatar Rucha Deshpande
Browse files

Bug fix for list groups, update to latest os-core-lib-aws and update bootstrapping groups

commit f2c1024f 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon May 03 2021 17:25:51 GMT-0500 (Central Daylight Time) 

    fix groups


commit 8318bd4e 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon May 03 2021 17:05:58 GMT-0500 (Central Daylight Time) 

    update groups for integration tests


commit ab991127 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon May 03 2021 15:30:39 GMT-0500 (Central Daylight Time) 

    bug fix get groups api


commit 88fac5ef 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon May 03 2021 12:12:45 GMT-0500 (Central Daylight Time) 

    merge with dev


commit cd1a0dcb 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon May 03 2021 12:09:07 GMT-0500 (Central Daylight Time) 

    revert to dev version


commit 879c9bb7 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Thu Apr 29 2021 13:13:10 GMT-0500 (Central Daylight Time) 

    Fix groups for limited access user


commit 83d3a4e0 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Thu Apr 29 2021 11:40:34 GMT-0500 (Central Daylight Time) 

    Fix groups for SP and integration test user


commit 353d8087 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 28 2021 18:01:53 GMT-0500 (Central Daylight Time) 

    Add sp groups with common tenant


commit 38022d40 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 28 2021 17:52:03 GMT-0500 (Central Daylight Time) 

    Add additional groups to Service Principal json


commit 0a020901 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 28 2021 16:42:49 GMT-0500 (Central Daylight Time) 

    Add all required groups


commit 2df34660 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 28 2021 16:12:45 GMT-0500 (Central Daylight Time) 

    Add all required groups


commit c7e27c35 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 28 2021 14:38:37 GMT-0500 (Central Daylight Time) 

    add noaccess user groups


commit c75be322 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 28 2021 14:32:01 GMT-0500 (Central Daylight Time) 

    add groups


commit 3f507ca7 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 28 2021 14:01:10 GMT-0500 (Central Daylight Time) 

    Add groups required for Storage integration tests


commit 2ca46a3a 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 28 2021 12:02:46 GMT-0500 (Central Daylight Time) 

    Bug fix: response code could be 409


commit 8fd2c9e0 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 28 2021 12:02:27 GMT-0500 (Central Daylight Time) 

    Bug fix: response code could be 409


commit 63a3addf 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 28 2021 10:18:06 GMT-0500 (Central Daylight Time) 

    bug fix init tenant script


commit ad632356 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 26 2021 14:45:50 GMT-0500 (Central Daylight Time) 

    update os-core-lib-aws version


commit b1a35edf 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 26 2021 14:01:12 GMT-0500 (Central Daylight Time) 

    update os-core-lib-aws version


commit 8789e934 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 26 2021 13:39:53 GMT-0500 (Central Daylight Time) 

    update os-core-lib-aws and add integration test user bootstrapping


commit e99f9a5a 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 26 2021 13:39:28 GMT-0500 (Central Daylight Time) 

    update os-core-lib-aws and add integration test user bootstrapping


commit b0047a2b 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Thu Apr 22 2021 12:34:32 GMT-0500 (Central Daylight Time) 

    add test


commit c4ebdd53 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 13:00:28 GMT-0500 (Central Daylight Time) 

    Merge branch 'dev' into deshruch

# Conflicts:
#	provider/entitlements-v2-aws/src/main/resources/application.properties


commit c01052bb 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 12:56:09 GMT-0500 (Central Daylight Time) 

    add ssl properties


commit 2ec6c775 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 11:38:54 GMT-0500 (Central Daylight Time) 

    AWS API implementation, integration tests and bootstrap script

commit 8db9e8fd 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 11:23:58 GMT-0500 (Central Daylight Time) 

    Added a comment


commit a163cc86 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 11:20:17 GMT-0500 (Central Daylight Time) 

    Added a comment


commit 31c23b5e 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 09:00:18 GMT-0500 (Central Daylight Time) 

    remove comment from script


commit 89fdd8d3 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 08:58:01 GMT-0500 (Central Daylight Time) 

    Add copyright


commit c88ea34e 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Tue Apr 20 2021 17:06:20 GMT-0500 (Central Daylight Time) 

    add getProtectedMembers


commit e227c574 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Tue Apr 20 2021 16:55:33 GMT-0500 (Central Daylight Time) 

    update springfox version


commit 37a59a59 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Tue Apr 20 2021 10:02:16 GMT-0500 (Central Daylight Time) 

    remove comments


commit cd09da0c 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Tue Apr 20 2021 09:56:47 GMT-0500 (Central Daylight Time) 

    Add copyright stmt


commit 67ac467d 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Tue Apr 20 2021 09:31:19 GMT-0500 (Central Daylight Time) 

    remove unwanted properties


commit f619fd4d 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 19 2021 11:10:20 GMT-0500 (Central Daylight Time) 

    Add bootstrap scripts


commit c7ba3273 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Fri Apr 16 2021 13:41:20 GMT-0500 (Central Daylight Time) 

    Add chmod to sh files


commit 64c85c51 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Fri Apr 16 2021 13:33:53 GMT-0500 (Central Daylight Time) 

    delete unit test for now


commit 62fa1a54 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Fri Apr 16 2021 13:27:52 GMT-0500 (Central Daylight Time) 

    Add prepare-dist to build


commit 31205a13 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Fri Apr 16 2021 12:25:03 GMT-0500 (Central Daylight Time) 

    Add AWS impl


commit 5185fa58 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 12 2021 11:26:40 GMT-0500 (Central Daylight Time) 

    Add authorizer to interceptor


commit 52f5804a 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 12 2021 10:27:50 GMT-0500 (Central Daylight Time) 

    add qq to buildspec


commit 77477c68 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 12 2021 09:53:32 GMT-0500 (Central Daylight Time) 

    Add interceptor


commit c64ff655 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 10:17:53 GMT-0500 (Central Daylight Time) 

    merge with dev


commit fd4979f7 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 10:16:14 GMT-0500 (Central Daylight Time) 

    delete unwanted files


commit 6d0da95b 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 09:51:05 GMT-0500 (Central Daylight Time) 

    aws specific changes



commit 8db9e8fd 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 11:23:58 GMT-0500 (Central Daylight Time) 

    Added a comment


commit 4ff9291f 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 10:27:43 GMT-0500 (Central Daylight Time) 

    Entitlements V2 build and implementation stubs



commit 80a20ce6 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 10:17:53 GMT-0500 (Central Daylight Time) 

    merge with dev


commit 5716e57f 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 10:16:29 GMT-0500 (Central Daylight Time) 

    Merge remote-tracking branch 'remotes/origin/dev' into deshruch

# Conflicts:
#	entitlements-v2-core/src/main/java/org/opengroup/osdu/entitlements/v2/auth/JwtClaimExtractor.java


commit 4cfc8429 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 10:16:14 GMT-0500 (Central Daylight Time) 

    delete unwanted files


commit 6fd37ed1 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 09:51:05 GMT-0500 (Central Daylight Time) 

    aws specific changes


commit c0bff91c 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Thu Mar 25 2021 14:04:56 GMT-0500 (Central Daylight Time) 

    Add chmod perms to ssl for Windows


commit 5dc5e9cb 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Thu Mar 25 2021 10:03:05 GMT-0500 (Central Daylight Time) 

    Add default for service domain


commit 445e5aa4 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Thu Mar 25 2021 09:43:31 GMT-0500 (Central Daylight Time) 

    Add AWS builspec



commit a163cc86 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 11:20:17 GMT-0500 (Central Daylight Time) 

    Added a comment


commit 31c23b5e 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 09:00:18 GMT-0500 (Central Daylight Time) 

    remove comment from script


commit 89fdd8d3 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Apr 21 2021 08:58:01 GMT-0500 (Central Daylight Time) 

    Add copyright


commit c88ea34e 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Tue Apr 20 2021 17:06:20 GMT-0500 (Central Daylight Time) 

    add getProtectedMembers


commit e227c574 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Tue Apr 20 2021 16:55:33 GMT-0500 (Central Daylight Time) 

    update springfox version


commit 37a59a59 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Tue Apr 20 2021 10:02:16 GMT-0500 (Central Daylight Time) 

    remove comments


commit cd09da0c 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Tue Apr 20 2021 09:56:47 GMT-0500 (Central Daylight Time) 

    Add copyright stmt


commit 67ac467d 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Tue Apr 20 2021 09:31:19 GMT-0500 (Central Daylight Time) 

    remove unwanted properties


commit f619fd4d 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 19 2021 11:10:20 GMT-0500 (Central Daylight Time) 

    Add bootstrap scripts


commit c7ba3273 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Fri Apr 16 2021 13:41:20 GMT-0500 (Central Daylight Time) 

    Add chmod to sh files


commit 64c85c51 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Fri Apr 16 2021 13:33:53 GMT-0500 (Central Daylight Time) 

    delete unit test for now


commit 62fa1a54 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Fri Apr 16 2021 13:27:52 GMT-0500 (Central Daylight Time) 

    Add prepare-dist to build


commit 31205a13 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Fri Apr 16 2021 12:25:03 GMT-0500 (Central Daylight Time) 

    Add AWS impl


commit 5185fa58 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 12 2021 11:26:40 GMT-0500 (Central Daylight Time) 

    Add authorizer to interceptor


commit 52f5804a 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 12 2021 10:27:50 GMT-0500 (Central Daylight Time) 

    add qq to buildspec


commit 77477c68 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Mon Apr 12 2021 09:53:32 GMT-0500 (Central Daylight Time) 

    Add interceptor


commit c64ff655 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 10:17:53 GMT-0500 (Central Daylight Time) 

    merge with dev


commit fd4979f7 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 10:16:14 GMT-0500 (Central Daylight Time) 

    delete unwanted files


commit 6d0da95b 
Author: Rucha Deshpande <deshruch@amazon.com> 
Date: Wed Mar 31 2021 09:51:05 GMT-0500 (Central Daylight Time) 

    aws specific changes
parent 55d5b75f
......@@ -29,4 +29,4 @@ fi
export APP_KEY=""
export DATA_PARTITION=opendes
python $AWS_DEPLOYMENTS_SUBDIR/initTenant.py -u $AWS_ENTITLEMENTSV2_SERVICE_URL -t $DATA_PARTITION
python $AWS_DEPLOYMENTS_SUBDIR/initTenant.py -u $AWS_ENTITLEMENTSV2_SERVICE_URL -t $DATA_PARTITION -p $AWS_DEPLOYMENTS_SUBDIR
{
"Users": ["users","service.entitlements.user"],
"Storage":["service.storage.admin"]
}
{
"Users": ["users","service.entitlements.user"],
"Indexer":["service.indexer.admin","service.indexer.creator","service.indexer.viewer"],
"Schema":["service.schema-service.editors","service.schema-service.viewers"]
}
{
"Users": ["users","users.data.root","users.datalake.ops","users.datalake.admins","users.datalake.editors","users.datalake.viewers"],
"Entitlements":["service.entitlements.admin","service.entitlements.user"],
"Storage": ["service.storage.admin","service.storage.creator","service.storage.viewer","data.test1","data.integration.test"],
"Search":["service.search.admin","service.search.user"],
"Legal":["service.legal.admin","service.legal.editor","service.legal.user"],
"Indexer":["service.indexer.admin","service.indexer.creator","service.indexer.viewer"],
"Schema":["service.schema-service.editors","service.schema-service.viewers"],
"Unit": ["service.unit.admin","service.unit.creator","service.unit.viewer"],
"DataWorkflow":["service.workflow.admin","service.workflow.creator","service.workflow.viewer"],
"Ingestion":["service.ingest.admin","service.ingest.creator","service.ingest.viewer"],
"SeismicStore":["service.seismic-store.admin","service.seismic-store.creator","service.seismic-store.viewer"],
"BinaryDMS":["service.binarydms.admin","service.binarydms.creator","service.binarydms.viewer"],
"CSVParser":["service.csv-parser.admin","service.csv-parser.creator","service.csv-parser.viewer"],
"EDSDMS":["service.edsdms.admin","service.edsdms.creator","service.edsdms.viewer"],
"File":["service.file.editors","service.file.viewers"],
"Policy":["service.policy.admin","service.policy.creator","service.policy.viewer"],
"Other":["cron.job"]
}
......@@ -14,23 +14,56 @@
import argparse
import os
import requests
import json
parser = argparse.ArgumentParser()
parser.add_argument('-u', help='The complete URL to the Entitlements V2 Service.', default=None)
parser.add_argument('-t', help='The tenant for which groups are being provisioned.', default=None)
parser.add_argument('-t', help='The tenant for which groups are being provisioned.', default='opendes')
parser.add_argument('-c', help='The common data partition name for which groups are being provisioned.', default='common')
parser.add_argument('-p', help='Path to where the groups json is stored.', default=None)
parser.add_argument('-i', help='Integration test user email', default='admin@testing.com')
parser.add_argument('-l', help='Integration test limited access user email', default='noaccess@testing.com')
parser.add_argument('-d', help='Groups domain', default='contoso.com')
arguments = parser.parse_args()
if arguments.u is not None:
url = arguments.u
if arguments.t is not None:
tenant = arguments.t
if arguments.c is not None:
common_tenant = arguments.c
if arguments.p is not None:
groups_json_path = arguments.p
if arguments.i is not None:
integration_test_user=arguments.i
if arguments.l is not None:
integration_test_limited_access_user=arguments.l
if arguments.d is not None:
group_domain=arguments.d
token = os.environ.get('BEARER_TOKEN')
initTenantUrl=url+'tenant-provisioning'
#call init API to provision groups for Service Principal
#call init API to provision groups for Service Principal for opendes tenant
print(token)
print(initTenantUrl)
headers = {
'data-partition-id': tenant,
'Content-Type': 'application/json',
'Authorization': token
}
print(headers)
method = 'POST'
response = requests.request(method,initTenantUrl, headers=headers)
print(response.status_code)
if response.status_code==200:
print('The Entitlements V2 bootstrapping for ServicePrincipal successful for tenant:'+tenant)
else:
print('The Entitlements V2 bootstrapping for ServicePrincipal failed for tenant:'+tenant)
#call init API to provision groups for Service Principal for common tenant
headers = {
'data-partition-id': tenant,
'data-partition-id': common_tenant,
'Content-Type': 'application/json',
'Authorization': token
}
......@@ -38,7 +71,84 @@ method = 'POST'
response = requests.request(method,initTenantUrl, headers=headers)
print(response.status_code)
if response.status_code==200:
print('The Entitlements V2 bootstrapping successful for tenant:'+tenant)
print('The Entitlements V2 bootstrapping for ServicePrincipal successful for tenant:'+common_tenant)
else:
print('The Entitlements V2 bootstrapping failed for tenant:'+tenant)
print('The Entitlements V2 bootstrapping for ServicePrincipal failed for tenant:'+common_tenant)
#call Add Member API to provision groups for Integration test user for opendes partition
headers = {
'data-partition-id': tenant,
'Content-Type': 'application/json',
'Authorization': token
}
method = 'POST'
data = {'email': integration_test_user, 'role':'MEMBER'}
f = open(groups_json_path+'/groups_integration_test_user_opendes.json')
groups_data = json.load(f)
f.close()
for i in groups_data:
arr = groups_data[i]
for group_name in arr:
group_email= group_name+'@'+tenant+'.'+group_domain
addMemberUrl=url+'groups/'+group_email+'/members'
response = requests.request(method,addMemberUrl, headers=headers, data=json.dumps(data))
if response.status_code==200:
print('The Entitlements V2 bootstrapping for Integration test user successful for group_email:'+group_email)
elif response.status_code==409:
print('The Entitlements V2 group for Integration test user already exists for group_email:'+group_email)
else:
print('The Entitlements V2 bootstrapping for Integration test user failed for group_email:'+group_email+'Error response code: '+str(response.status_code))
#call Add Member API to provision groups for Integration test user for common data partition
headers = {
'data-partition-id': common_tenant,
'Content-Type': 'application/json',
'Authorization': token
}
method = 'POST'
data = {'email': integration_test_user, 'role':'MEMBER'}
f = open(groups_json_path+'/groups_integration_test_user_common.json')
groups_data = json.load(f)
f.close()
for i in groups_data:
arr = groups_data[i]
for group_name in arr:
group_email= group_name+'@'+common_tenant+'.'+group_domain
addMemberUrl=url+'groups/'+group_email+'/members'
response = requests.request(method,addMemberUrl, headers=headers, data=json.dumps(data))
if response.status_code==200:
print('The Entitlements V2 bootstrapping for Integration test user successful for group_email:'+group_email)
elif response.status_code==409:
print('The Entitlements V2 group for Integration test user already exists for group_email:'+group_email)
else:
print('The Entitlements V2 bootstrapping for Integration test user failed for group_email:'+group_email+'Error response code: '+str(response.status_code))
#call Add Member API to provision groups for Integration test limited access user
headers = {
'data-partition-id': tenant,
'Content-Type': 'application/json',
'Authorization': token
}
method = 'POST'
data = {'email': integration_test_limited_access_user, 'role':'OWNER'}
f = open(groups_json_path+'/groups_integration_test_limited_access_user_opendes.json')
groups_data = json.load(f)
f.close()
for i in groups_data:
arr = groups_data[i]
for group_name in arr:
group_email= group_name+'@'+tenant+'.'+group_domain
addMemberUrl=url+'groups/'+group_email+'/members'
response = requests.request(method,addMemberUrl, headers=headers, data=json.dumps(data))
if response.status_code==200:
print('The Entitlements V2 bootstrapping for Integration test limited access user successful for group_email:'+group_email)
elif response.status_code==409:
print('The Entitlements V2 group for Integration test limited access user already exists for group_email:'+group_email)
else:
print('The Entitlements V2 bootstrapping for IIntegration test limited access user failed for group_email:'+group_email+'Error response code: '+str(response.status_code))
......@@ -13,7 +13,7 @@
<artifactId>entitlements-v2-aws</artifactId>
<properties>
<core-lib-aws.version>0.3.16</core-lib-aws.version>
<core-lib-aws.version>0.9.1-SNAPSHOT</core-lib-aws.version>
<reactor.netty.version>0.9.5.RELEASE</reactor.netty.version>
<reactor.core.version>3.3.0.RELEASE</reactor.core.version>
<springfox-version>2.7.0</springfox-version>
......
......@@ -21,6 +21,7 @@ import io.lettuce.core.Value;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.async.RedisAsyncCommands;
import io.lettuce.core.api.sync.RedisCommands;
import javafx.scene.Parent;
import org.apache.commons.lang3.StringUtils;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
......@@ -40,17 +41,7 @@ import org.springframework.stereotype.Repository;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArraySet;
......@@ -241,7 +232,9 @@ public class AwsRetrieveGroupRepo implements RetrieveGroupRepo {
public ParentTreeDto loadAllParents(EntityNode memberNode) {
Set<String> visited = new CopyOnWriteArraySet<>();
List<ParentReference> directParents = loadDirectParents(memberNode.getDataPartitionId(), memberNode.getNodeId());
Set<ParentReference> allParents = new HashSet<>(directParents);
visited.add(memberNode.getNodeId());
Deque<List<ParentReference>> queue = new LinkedList<>();
if (!directParents.isEmpty()) {
......@@ -264,7 +257,16 @@ public class AwsRetrieveGroupRepo implements RetrieveGroupRepo {
visited.addAll(allNodeIds);
});
}
return ParentTreeDto.builder().parentReferences(allParents).maxDepth(maxDepth).build();
Set<ParentReference> filteredAllParents = new HashSet<>();
Iterator<ParentReference> it = allParents.iterator();
while(it.hasNext()){
ParentReference pf = it.next();
if(pf.getDataPartitionId().equals(memberNode.getDataPartitionId()))
{
filteredAllParents.add(pf);
}
}
return ParentTreeDto.builder().parentReferences(filteredAllParents).maxDepth(maxDepth).build();
}
@Override
......
......@@ -12,12 +12,7 @@ aws.environment=${ENVIRONMENT}
app.projectId=evd-ddl-us-services
app.domain=${SERVICE_DOMAIN_NAME:contoso.com}
#Need to read TenantInfo table
aws.dynamodb.table.prefix=${ENVIRONMENT}-
aws.dynamodb.endpoint=dynamodb.${AWS_REGION}.amazonaws.com
aws.parameter.prefix=/osdu/${ENVIRONMENT}
# Don't know the purpose yet. Needs to be moved to provider side. Issue submitted in GL
azure.keyvault.url=xx
......
......@@ -83,6 +83,81 @@
},
{
"groupName": "service.workflow.admin"
},
{
"groupName": "service.indexer.admin"
},
{
"groupName": "service.indexer.creator"
},
{
"groupName": "service.indexer.viewer"
},
{
"groupName": "service.unit.admin"
},
{
"groupName": "service.unit.creator"
},
{
"groupName": "service.unit.viewer"
},
{
"groupName": "service.ingest.admin"
},
{
"groupName": "service.ingest.creator"
},
{
"groupName": "service.ingest.viewer"
},
{
"groupName": "service.seismic-store.viewer"
},
{
"groupName": "service.seismic-store.admin"
},
{
"groupName": "service.seismic-store.creator"
},
{
"groupName": "service.binarydms.admin"
},
{
"groupName": "service.binarydms.creator"
},
{
"groupName": "service.binarydms.viewer"
},
{
"groupName": "service.edsdms.admin"
},
{
"groupName": "service.edsdms.creator"
},
{
"groupName": "service.edsdms.viewer"
},
{
"groupName": "service.csv-parser.admin"
},
{
"groupName": "service.csv-parser.creator"
},
{
"groupName": "service.csv-parser.viewer"
},
{
"groupName": "service.policy.admin"
},
{
"groupName": "service.policy.creator"
},
{
"groupName": "service.policy.viewer"
},
{
"groupName": "cron.job"
}
]
}
......@@ -299,6 +299,387 @@
"name": "users.datalake.admins"
}
]
},
{
"name": "service.indexer.viewer",
"description": "The viewer of the indexer service",
"members": [
{
"name": "users.datalake.viewers"
},
{
"name": "users.datalake.editors"
},
{
"name": "users.datalake.admins"
},
{
"name": "users.datalake.ops"
}
]
},
{
"name": "service.indexer.admin",
"description": "Datalake indexer admins",
"members": [
{
"name": "users.datalake.ops"
}
]
},
{
"name": "service.indexer.creator",
"description": "Datalake indexer creators",
"members": [
{
"name": "users.datalake.ops"
},
{
"name": "users.datalake.admins"
},
{
"name": "users.datalake.editors"
}
]
},
{
"name": "service.unit.viewer",
"description": "The viewer of the unit service",
"members": [
{
"name": "users.datalake.viewers"
},
{
"name": "users.datalake.editors"
},
{
"name": "users.datalake.admins"
},
{
"name": "users.datalake.ops"
}
]
},
{
"name": "service.unit.admin",
"description": "Datalake unit admins",
"members": [
{
"name": "users.datalake.ops"
}
]
},
{
"name": "service.unit.creator",
"description": "Datalake unit creators",
"members": [
{
"name": "users.datalake.ops"
},
{
"name": "users.datalake.admins"
},
{
"name": "users.datalake.editors"
}
]
},
{
"name": "service.ingest.viewer",
"description": "The viewer of the ingest service",
"members": [
{
"name": "users.datalake.viewers"
},
{
"name": "users.datalake.editors"
},
{
"name": "users.datalake.admins"
},
{
"name": "users.datalake.ops"
}
]
},
{
"name": "service.ingest.admin",
"description": "Datalake ingest admins",
"members": [
{
"name": "users.datalake.ops"
}
]
},
{
"name": "service.ingest.creator",
"description": "Datalake ingest creators",
"members": [
{
"name": "users.datalake.ops"
},
{
"name": "users.datalake.admins"
},
{
"name": "users.datalake.editors"
}
]
},
{
"name": "service.seismic-store.viewer",
"description": "The viewer of the seismic-store service",
"members": [
{
"name": "users.datalake.viewers"
},
{
"name": "users.datalake.editors"
},
{
"name": "users.datalake.admins"
},
{
"name": "users.datalake.ops"
}
]
},
{
"name": "service.seismic-store.admin",
"description": "Datalake seismic-store admins",
"members": [
{
"name": "users.datalake.ops"
}
]
},
{
"name": "service.seismic-store.creator",
"description": "Datalake seismic-store creators",
"members": [
{
"name": "users.datalake.ops"
},
{
"name": "users.datalake.admins"
},
{
"name": "users.datalake.editors"
}
]
},
{
"name": "service.binarydms.viewer",
"description": "The viewer of the datalake binarydms service",
"members": [
{
"name": "users.datalake.viewers"
},
{
"name": "users.datalake.editors"
},
{
"name": "users.datalake.admins"
},
{
"name": "users.datalake.ops"
}
]
},
{
"name": "service.binarydms.admin",
"description": "Datalake binarydms admins",
"members": [
{
"name": "users.datalake.ops"
}
]
},
{
"name": "service.binarydms.creator",
"description": "Datalake binarydms creators",
"members": [
{
"name": "users.datalake.ops"
},
{
"name": "users.datalake.admins"
},
{