Commit 6619429c authored by Matt Wise's avatar Matt Wise
Browse files

Merge branch 'aws-multitenant-v2' into 'master'

Multi-tenant/data split

See merge request !101
parents 52f5e4e8 59c176d7
Pipeline #40722 failed with stages
in 16 minutes and 30 seconds
This diff is collapsed.
......@@ -60,6 +60,6 @@ OTHER_RELEVANT_DATA_COUNTRIES=US
DEPLOY_ENV=empty
LEGAL_TAG=opendes-public-usa-dataset-1
TENANT_NAME=opendes
DOMAIN=testing.com
DOMAIN=example.com
DATASET_URL=<YOUR_API_URL>/api/dataset/v1/
LEGAL_URL=<YOUR_API_URL>/api/legal/v1/
\ No newline at end of file
......@@ -32,7 +32,7 @@
<packaging>jar</packaging>
<properties>
<aws.version>1.11.637</aws.version>
<aws.version>1.11.1018</aws.version>
<deployment.environment>dev</deployment.environment>
<version.number>0.9.0-SNAPSHOT</version.number>
</properties>
......@@ -58,7 +58,7 @@
<dependency>
<groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId>
<version>0.3.17</version>
<version>0.9.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
......
......@@ -22,7 +22,8 @@ import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import org.opengroup.osdu.core.aws.dynamodb.DynamoDBQueryHelper;
import org.opengroup.osdu.core.aws.dynamodb.DynamoDBQueryHelperV2;
import org.opengroup.osdu.core.aws.dynamodb.IDynamoDBQueryHelperFactory;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
......@@ -41,15 +42,6 @@ public class DatasetDmsServiceMapImpl implements IDatasetDmsServiceMap {
@Value("${DMS_API_BASE}")
private String DMS_API_BASE;
@Value("${aws.dynamodb.table.prefix}")
String tablePrefix;
@Value("${aws.region}")
String dynamoDbRegion;
@Value("${aws.dynamodb.endpoint}")
String dynamoDbEndpoint;
@Inject
DmsRegistrationCache cache;
......@@ -59,12 +51,21 @@ public class DatasetDmsServiceMapImpl implements IDatasetDmsServiceMap {
@Inject
private JaxRsDpsLog logger;
private DynamoDBQueryHelper queryHelper;
@Value("${aws.parameter.prefix}")
private String ssmParameterPrefix;
@Value("${aws.dynamodb.dmsRegistrationTable.ssm.relativePath:/common/dataset/DmsRegistrationTable}")
private String dmsRegistrationTableRelativePath;
private DynamoDBQueryHelperV2 queryHelper;
@Inject
private IDynamoDBQueryHelperFactory queryHelperFactory;
@PostConstruct
public void init() {
queryHelper = new DynamoDBQueryHelper(dynamoDbEndpoint, dynamoDbRegion, tablePrefix);
queryHelper = queryHelperFactory.getQueryHelperUsingSSM(ssmParameterPrefix, dmsRegistrationTableRelativePath);
}
@Override
......
......@@ -14,7 +14,7 @@
LOG_PREFIX=dataset
AUTHORIZE_API=${ENTITLEMENTS_BASE_URL}/api/entitlements/v1
AUTHORIZE_API=${ENTITLEMENTS_BASE_URL}/api/entitlements/v2
STORAGE_API=${STORAGE_BASE_URL}/api/storage/v2
SCHEMA_API=${SCHEMA_BASE_URL}/api/schema-service/v1
DMS_API_BASE=${DMS_BASE_URL}
......
......@@ -46,3 +46,5 @@ chmod +x "${INTEGRATION_TEST_OUTPUT_BIN_DIR}"/install-deps.sh
mvn clean -f "$INTEGRATION_TEST_SOURCE_DIR_AWS"/pom.xml
cp -R "$INTEGRATION_TEST_SOURCE_DIR_AWS"/* "${INTEGRATION_TEST_OUTPUT_DIR}"/
#copy testing parent pom to output
cp "$INTEGRATION_TEST_SOURCE_DIR/pom.xml" "${OUTPUT_DIR}/testing"
\ No newline at end of file
......@@ -40,7 +40,7 @@
<dependency>
<groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId>
<version>0.3.17</version>
<version>0.9.1-SNAPSHOT</version>
</dependency>
<dependency>
......@@ -52,7 +52,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cognitoidp</artifactId>
<version>1.11.676</version>
<version>1.11.1018</version>
</dependency>
<!-- third party Apache 2.0 license packages -->
......
......@@ -226,9 +226,9 @@ public abstract class Dataset extends TestBase {
//set acl
Acl acl = new Acl();
String[] viewers = new String[] { String.format("data.default.viewers@%s.testing.com", TenantUtils.getTenantName()) };
String[] viewers = new String[] { String.format("data.default.viewers@%s.example.com", TenantUtils.getTenantName()) };
acl.setViewers(viewers);
String[] owners = new String[] { String.format("data.default.owners@%s.testing.com", TenantUtils.getTenantName()) };
String[] owners = new String[] { String.format("data.default.owners@%s.example.com", TenantUtils.getTenantName()) };
acl.setOwners(owners);
datasetRegistry.setAcl(acl);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment