Commit bc51b1bd authored by Riabokon Stanislav(EPAM)'s avatar Riabokon Stanislav(EPAM)
Browse files

Merge branch 'partion-service-as-tenantinfo-provider' into 'master'

Partion service as tenantinfo provider(GONRG-2196)

See merge request !102
parents d89f65f8 6d5ab1c7
Pipeline #42533 failed with stages
in 34 minutes and 56 seconds
......@@ -37,6 +37,9 @@ In order to run the service locally or remotely, you will need to have the follo
| `SERVER_SERVLET_CONTEXPATH` | `/api/schema-service/v1` | Servlet context path | no | - |
| `AUTHORIZE_API` | ex `https://entitlements.com/entitlements/v1` | Entitlements API endpoint | no | output of infrastructure deployment |
| `ACCOUNT_ID_COMMON_PROJECT` | ex `common` | Shared account id | no | - |
| `SERVICE_PARTITION_ENABLED` | `true` OR `false` | Allow to configure TenantInfo provision by Partition service | no | - |
| `GOOGLE_AUDIENCES` | ex `*****.apps.googleusercontent.com` | Client ID for getting access to cloud resources | yes | https://console.cloud.google.com/apis/credentials |
| `PARTITION_API` | ex `http://localhost:8081/api/partition/v1` | Partition service endpoint | no | - |
| `GOOGLE_APPLICATION_CREDENTIALS` | ex `/path/to/directory/service-key.json` | Service account credentials, you only need this if running locally | yes | https://console.cloud.google.com/iam-admin/serviceaccounts |
| `GCLOUD_PROJECT` | `******` | Cloud project id, you only need this if running locally | no | https://console.cloud.google.com |
......
......@@ -55,7 +55,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>core-lib-gcp</artifactId>
<version>0.7.0</version>
<version>0.9.0-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -18,17 +18,12 @@
package org.opengroup.osdu.schema.configuration;
import org.opengroup.osdu.core.gcp.multitenancy.GcsMultiTenantAccess;
import org.opengroup.osdu.core.gcp.multitenancy.TenantFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.stereotype.Component;
@Component
public class StorageFactoryBean extends AbstractFactoryBean<GcsMultiTenantAccess> {
@Autowired
TenantFactory tenantFactory;
@Override
protected GcsMultiTenantAccess createInstance() throws Exception {
......
......@@ -17,12 +17,16 @@
package org.opengroup.osdu.schema.impl.schemainfostore;
import com.google.cloud.Timestamp;
import com.google.cloud.datastore.Datastore;
import com.google.cloud.datastore.DatastoreException;
import com.google.cloud.datastore.Entity;
import com.google.cloud.datastore.Key;
import java.text.MessageFormat;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory;
import org.opengroup.osdu.core.gcp.multitenancy.DatastoreFactory;
import org.opengroup.osdu.core.gcp.multitenancy.TenantFactory;
import org.opengroup.osdu.schema.constants.SchemaConstants;
import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.BadRequestException;
......@@ -32,12 +36,6 @@ import org.opengroup.osdu.schema.provider.interfaces.schemainfostore.IAuthorityS
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.google.cloud.Timestamp;
import com.google.cloud.datastore.Datastore;
import com.google.cloud.datastore.DatastoreException;
import com.google.cloud.datastore.Entity;
import com.google.cloud.datastore.Key;
/**
* Repository class to to register authority in Google store.
*
......@@ -53,7 +51,7 @@ public class GoogleAuthorityStore implements IAuthorityStore {
private DatastoreFactory dataStoreFactory;
@Autowired
private TenantFactory tenantFactory;
private ITenantFactory tenantFactory;
@Autowired
JaxRsDpsLog log;
......
......@@ -17,10 +17,15 @@
package org.opengroup.osdu.schema.impl.schemastore;
import com.google.cloud.storage.Blob;
import com.google.cloud.storage.BlobId;
import com.google.cloud.storage.BlobInfo;
import com.google.cloud.storage.Storage;
import com.google.cloud.storage.StorageException;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory;
import org.opengroup.osdu.core.gcp.multitenancy.GcsMultiTenantAccess;
import org.opengroup.osdu.core.gcp.multitenancy.TenantFactory;
import org.opengroup.osdu.schema.constants.SchemaConstants;
import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
......@@ -29,12 +34,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;
import com.google.cloud.storage.Blob;
import com.google.cloud.storage.BlobId;
import com.google.cloud.storage.BlobInfo;
import com.google.cloud.storage.Storage;
import com.google.cloud.storage.StorageException;
/**
* Repository class to to register resolved Schema in Google storage.
*
......@@ -50,7 +49,7 @@ public class GoogleSchemaStore implements ISchemaStore {
private GcsMultiTenantAccess storageFactory;
@Autowired
TenantFactory tenantFactory;
ITenantFactory tenantFactory;
@Value("${shared.tenant.name:common}")
private String sharedTenant;
......
......@@ -10,3 +10,6 @@ LOG_PREFIX=schema
# Use this property to name your shared tenant name
shared.tenant.name=common
google.audiences=123.apps.googleusercontent.com
partition.api=http://localhost:8081/api/partition/v1
......@@ -13,7 +13,7 @@
<properties>
<springfox-version>2.7.0</springfox-version>
<os-core-common.version>0.3.28</os-core-common.version>
<os-core-common.version>0.9.0-SNAPSHOT</os-core-common.version>
</properties>
<dependencies>
......
Markdown is supported
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