diff --git a/devops/gc/configmap/README.md b/devops/gc/configmap/README.md index f3a74af3f4bfc0e067b516561908966894dbf86d..ed8e8ed0674a246d199c620acf064d7397374fb7 100644 --- a/devops/gc/configmap/README.md +++ b/devops/gc/configmap/README.md @@ -41,12 +41,6 @@ First you need to set variables in **values.yaml** file using any code editor. S **springProfilesActive** | active spring profile | string | gcp | yes **storageHost** | storage host | string | "http://storage" | yes -### Google Cloud variables - -| Name | Description | Type | Default |Required | -|------|-------------|------|---------|---------| -**googleAudiences** | your Google Cloud client ID | string | - | yes - ### Config variables | Name | Description | Type | Default |Required | diff --git a/devops/gc/configmap/templates/variables.yaml b/devops/gc/configmap/templates/variables.yaml index 0988de1435130fd0de537eb094eaf1518513b3d9..fd53ebd65dcbc7b78294e8a32a533c8197f3de0e 100644 --- a/devops/gc/configmap/templates/variables.yaml +++ b/devops/gc/configmap/templates/variables.yaml @@ -16,6 +16,3 @@ data: SECURITY_HTTPS_CERTIFICATE_TRUST: "{{ .Values.data.securityHttpsCertificateTrust }}" SPRING_PROFILES_ACTIVE: "{{ .Values.data.springProfilesActive }}" STORAGE_HOST: "{{ .Values.data.storageHost }}" - {{- if not .Values.conf.onPremEnabled }} - GOOGLE_AUDIENCES: "{{ .Values.data.googleAudiences }}" - {{- end }} diff --git a/devops/gc/configmap/values.yaml b/devops/gc/configmap/values.yaml index d66cad07278578f3b0b5a5c832ba64adca0f8458..bfa62d51641e884a5f38cf21874d7a4e86bacc6a 100644 --- a/devops/gc/configmap/values.yaml +++ b/devops/gc/configmap/values.yaml @@ -14,8 +14,6 @@ data: securityHttpsCertificateTrust: "true" springProfilesActive: "gcp" storageHost: "http://storage" - # Google Cloud - googleAudiences: "" conf: appName: "indexer" configmap: "indexer-config" diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/config/IndexerConfigurationProperties.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/config/IndexerConfigurationProperties.java index cff663d6ca875c6c3bddbbd0c7ba68653ac77ac1..c97fbc61591bed6af0af8b8b1777157191546ace 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/config/IndexerConfigurationProperties.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/config/IndexerConfigurationProperties.java @@ -67,7 +67,6 @@ public class IndexerConfigurationProperties { private String gaeVersion; private String googleCloudProject; private String googleCloudProjectRegion; - private String googleAudiences; public DeploymentEnvironment getDeploymentEnvironment(){ return DeploymentEnvironment.valueOf(deploymentEnvironment); diff --git a/provider/indexer-gc/docs/gc/README.md b/provider/indexer-gc/docs/gc/README.md index 981bcbade96336e5d612c4b617f6a3ba48664309..bfbbd9fbc5729535119ee38f8e164d2859499b65 100644 --- a/provider/indexer-gc/docs/gc/README.md +++ b/provider/indexer-gc/docs/gc/README.md @@ -8,7 +8,6 @@ Must have: | name | value | description | sensitive? | source | |----------------------------------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|---------------------------------------------------| -| `GOOGLE_AUDIENCES` | ex `*****.apps.googleusercontent.com` | Client ID for getting access to cloud resources | yes | <https://console.cloud.google.com/apis/credentials> | | `SPRING_PROFILES_ACTIVE` | ex `gcp` | Spring profile that activate default configuration for Google Cloud environment | false | - | | `<ELASTICSEARCH_USER_ENV_VARIABLE_NAME>` | ex `user` | Elasticsearch user, name of that variable not defined at the service level, the name will be received through partition service. Each tenant can have it's own ENV name value, and it must be present in ENV of Indexer service, see [Partition properties set](#Properties-set-in-Partition-service) | yes | - | | `<ELASTICSEARCH_PASSWORD_ENV_VARIABLE_NAME>` | ex `password` | Elasticsearch password, name of that variable not defined at the service level, the name will be received through partition service. Each tenant can have it's own ENV name value, and it must be present in ENV of Indexer service, see [Partition properties set](#Properties-set-in-Partition-service) | false | - | @@ -132,24 +131,23 @@ TBD You will need to have the following environment variables defined. -| name | value | description | sensitive? | source | -|-------------------------------------|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------|------------|------------------------------------------------------------| -| `ELASTIC_PASSWORD` | `********` | Password for Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_USER_NAME` | `********` | User name for Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_HOST` | ex `elastic.domain.com` | Host Elasticsearch | yes | output of infrastructure deployment | -| `ELASTIC_PORT` | ex `9243` | Port Elasticsearch | yes | output of infrastructure deployment | -| `GCLOUD_PROJECT` | ex `opendes` | Google Cloud Project Id | no | output of infrastructure deployment | +| name | value | description | sensitive? | source | +|-------------------------------------|----------------------------------------------------------------|---------------------------------------------------------------------------------------------------|------------|------------------------------------------------------------| +| `ELASTIC_PASSWORD` | `********` | Password for Elasticsearch | yes | output of infrastructure deployment | +| `ELASTIC_USER_NAME` | `********` | User name for Elasticsearch | yes | output of infrastructure deployment | +| `ELASTIC_HOST` | ex `elastic.domain.com` | Host Elasticsearch | yes | output of infrastructure deployment | +| `ELASTIC_PORT` | ex `9243` | Port Elasticsearch | yes | output of infrastructure deployment | +| `GCLOUD_PROJECT` | ex `opendes` | Google Cloud Project Id | no | output of infrastructure deployment | | `INDEXER_HOST` | ex `https://os-indexer-dot-opendes.appspot.com/api/indexer/v2/` | Indexer API endpoint | no | output of infrastructure deployment | | `ENTITLEMENTS_DOMAIN` | ex `opendes-gc.projects.com` | OSDU R2 to run tests under | no | - | -| `INTEGRATION_TEST_AUDIENCE` | `********` | client application ID | yes | <https://console.cloud.google.com/apis/credentials> | -| `OTHER_RELEVANT_DATA_COUNTRIES` | ex `US` | valid legal tag with a other relevant data countries | no | - | -| `LEGAL_TAG` | ex `opendes-demo-legaltag` | valid legal tag with a other relevant data countries from `DEFAULT_OTHER_RELEVANT_DATA_COUNTRIES` | no | - | -| `DEFAULT_DATA_PARTITION_ID_TENANT1` | ex `opendes` | HTTP Header 'Data-Partition-ID' | no | - | -| `DEFAULT_DATA_PARTITION_ID_TENANT2` | ex `opendes` | HTTP Header 'Data-Partition-ID' | no | - | +| `OTHER_RELEVANT_DATA_COUNTRIES` | ex `US` | valid legal tag with a other relevant data countries | no | - | +| `LEGAL_TAG` | ex `opendes-demo-legaltag` | valid legal tag with a other relevant data countries from `DEFAULT_OTHER_RELEVANT_DATA_COUNTRIES` | no | - | +| `DEFAULT_DATA_PARTITION_ID_TENANT1` | ex `opendes` | HTTP Header 'Data-Partition-ID' | no | - | +| `DEFAULT_DATA_PARTITION_ID_TENANT2` | ex `opendes` | HTTP Header 'Data-Partition-ID' | no | - | | `SEARCH_INTEGRATION_TESTER` | `********` | Service account for API calls. Note: this user must have entitlements configured already | yes | <https://console.cloud.google.com/iam-admin/serviceaccounts> | -| `SEARCH_HOST` | ex `http://localhost:8080/api/search/v2/` | Endpoint of search service | no | - | -| `STORAGE_HOST` | ex `http://os-storage-dot-opendes.appspot.com/api/storage/v2/` | Storage API endpoint | no | output of infrastructure deployment | -| `SECURITY_HTTPS_CERTIFICATE_TRUST` | ex `false` | Elastic client connection uses TrustSelfSignedStrategy(), if it is 'true' | false | output of infrastructure deployment | +| `SEARCH_HOST` | ex `http://localhost:8080/api/search/v2/` | Endpoint of search service | no | - | +| `STORAGE_HOST` | ex `http://os-storage-dot-opendes.appspot.com/api/storage/v2/` | Storage API endpoint | no | output of infrastructure deployment | +| `SECURITY_HTTPS_CERTIFICATE_TRUST` | ex `false` | Elastic client connection uses TrustSelfSignedStrategy(), if it is 'true' | false | output of infrastructure deployment | **Entitlements configuration for integration accounts** diff --git a/provider/indexer-gc/pom.xml b/provider/indexer-gc/pom.xml index 0d796679549938d81f574726b052bddb5cb2c7cd..4d835b4bd0c71eb516eda175e4794a5c0e547d5c 100644 --- a/provider/indexer-gc/pom.xml +++ b/provider/indexer-gc/pom.xml @@ -19,7 +19,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>core-lib-gcp</artifactId> - <version>0.19.0-rc2</version> + <version>0.19.0-rc3</version> </dependency> <dependency> <groupId>org.opengroup.osdu.indexer</groupId> diff --git a/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/Config.java b/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/Config.java index 1c16fb2c504355dd28c80c6337ee4a0cb954e625..247213e690389136eab11202e3fd38cfb6144bbc 100644 --- a/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/Config.java +++ b/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/Config.java @@ -16,8 +16,6 @@ public class Config { private static final String DEFAULT_DATA_PARTITION_ID_TENANT2 = ""; private static final String DEFAULT_SEARCH_INTEGRATION_TESTER = ""; - private static final String DEFAULT_TARGET_AUDIENCE = ""; - private static final String DEFAULT_LEGAL_TAG = ""; private static final String DEFAULT_OTHER_RELEVANT_DATA_COUNTRIES = ""; @@ -39,10 +37,6 @@ public class Config { return getEnvironmentVariableOrDefaultValue("LEGAL_TAG", DEFAULT_LEGAL_TAG); } - public static String getTargetAudience() { - return getEnvironmentVariableOrDefaultValue("INTEGRATION_TEST_AUDIENCE", DEFAULT_TARGET_AUDIENCE); - } - public static String getKeyValue() { return getEnvironmentVariableOrDefaultValue("SEARCH_INTEGRATION_TESTER", DEFAULT_SEARCH_INTEGRATION_TESTER); } diff --git a/testing/indexer-test-gc/src/test/java/org/opengroup/osdu/util/JwtTokenUtil.java b/testing/indexer-test-gc/src/test/java/org/opengroup/osdu/util/JwtTokenUtil.java index 7c13aaae6539701a93daf5793be42e12a2e9da3b..d42350bad53f95ed5c2f3b8f8cfba7159855ed33 100644 --- a/testing/indexer-test-gc/src/test/java/org/opengroup/osdu/util/JwtTokenUtil.java +++ b/testing/indexer-test-gc/src/test/java/org/opengroup/osdu/util/JwtTokenUtil.java @@ -66,8 +66,6 @@ class JwtTokenUtil { } private static String getJwt(String serviceAccountFile) throws IOException { - - String targetAudience = Config.getTargetAudience(); long currentTime = Clock.SYSTEM.currentTimeMillis(); InputStream stream = new ByteArrayInputStream(Base64.getDecoder().decode(serviceAccountFile)); @@ -83,7 +81,7 @@ class JwtTokenUtil { payload.setExpirationTimeSeconds(currentTime / 1000 + 3600); payload.setAudience("https://www.googleapis.com/oauth2/v4/token"); payload.setIssuer(credential.getServiceAccountId()); - payload.set("target_audience", targetAudience); + payload.set("target_audience", "osdu"); JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); String signedJwt = null; diff --git a/testing/readme.md b/testing/readme.md index 0d9166e071d7427a4cf2e050ac38be34142703ac..1d8b113686cc1ed0ad2c6e25bd8cfbc41e1fbdba 100644 --- a/testing/readme.md +++ b/testing/readme.md @@ -14,7 +14,6 @@ 5) Update **DEFAULT_SEARCH_INTEGRATION_TESTER** variable in Config file with base64 encoded value to service account json key 6) Update **DEFAULT_SEARCH_ON_BEHALF_INTEGRATION_TESTER** variable in Config file with base64 encoded value to service account json key (it will be used for slb-on-behalf-header) 7) Have credentials for Elastic Cluster and update **DEFAULT_ELASTIC_HOST**, **DEFAULT_ELASTIC_USER_NAME** and **DEFAULT_ELASTIC_PASSWORD**. -8) Update **DEFAULT_TARGET_AUDIENCE** with the Google audience Note: 1) Config (Config.java) file is present in org.opengroup.osdu.util package