Commit accfecea authored by Aman Verma's avatar Aman Verma
Browse files

restoring few files to previous version

parent 4f4ba75d
Pipeline #62305 passed with stages
in 36 minutes and 47 seconds
variables:
GCP_BUILD_SUBDIR: provider/schema-gcp
GCP_INT_TEST_SUBDIR: testing/schema-test-azure
GCP_INT_TEST_SUBDIR: testing/schema-test-gcp
GCP_APPLICATION_NAME: os-schema
GCP_ENVIRONMENT: testing
GCP_PROJECT: opendes-evt
......@@ -9,14 +9,14 @@ variables:
GCP_DOMAIN: cloud.slb-ds.com
IBM_BUILD_SUBDIR: provider/schema-ibm
IBM_INT_TEST_SUBDIR: testing/schema-test-azure
IBM_INT_TEST_SUBDIR: testing/schema-test-core
IBM_TEST_CMD: verify
IBM_DEPLOYMENTS_SUBDIR: deployments/scripts/ibm
IBM_DEPLOYMENTS_SCRIPTS_SUBDIR: deployments/scripts
AZURE_SERVICE: schema
AZURE_BUILD_SUBDIR: provider/schema-azure
AZURE_TEST_SUBDIR: testing/schema-test-azure
AZURE_TEST_SUBDIR: testing/schema-test-core
AZURE_ONLY_TEST_SUBDIR: testing/schema-test-azure
AZURE_DEPLOYMENTS_SUBDIR: deployments/scripts/azure
AZURE_DEPLOYMENTS_SCRIPTS_SUBDIR: deployments/scripts
......@@ -28,7 +28,7 @@ variables:
AWS_BUILD_SUBDIR: provider/schema-aws/build-aws
AWS_TEST_SUBDIR: testing/schema-test-azure
AWS_TEST_SUBDIR: testing/schema-test-core
AWS_DEPLOYMENTS_SUBDIR: deployments/scripts/aws
AWS_SERVICE: schema
AWS_ENVIRONMENT: dev
......
......@@ -94,12 +94,6 @@
<artifactId>os-core-lib-ibm</artifactId>
<version>${os-core-lib-ibm.version}</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>core-lib-gcp</artifactId>
<version>0.9.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
......
......@@ -3,7 +3,6 @@ package org.opengroup.osdu.schema.util;
import com.google.common.base.Strings;
import org.opengroup.osdu.azure.util.AzureServicePrincipal;
import org.opengroup.osdu.core.aws.cognito.AWSCognitoClient;
import org.opengroup.osdu.core.gcp.auth.GoogleServiceAccount;
import org.opengroup.osdu.core.ibm.util.IdentityClient;
......@@ -11,26 +10,12 @@ public class AuthUtil {
public synchronized String getToken() throws Exception {
String token = null;
String vendor = System.getProperty("VENDOR", System.getenv("VENDOR"));
if (Strings.isNullOrEmpty(token) && vendor.equals("gcp")) {
String serviceAccountFile = System.getProperty("INTEGRATION_TESTER", System.getenv("INTEGRATION_TESTER"));
String audience = System.getProperty("INTEGRATION_TEST_AUDIENCE",
System.getenv("INTEGRATION_TEST_AUDIENCE"));
token = new GoogleServiceAccount(serviceAccountFile).getAuthToken(audience);
}else if (Strings.isNullOrEmpty(token) && vendor.equals("aws")) {
String awsCognitoClientId = System.getProperty("AWS_COGNITO_CLIENT_ID", System.getenv("AWS_COGNITO_CLIENT_ID"));
String awsCognitoAuthFlow = "USER_PASSWORD_AUTH";
String awsCognitoAuthParamsUser = System.getProperty("AWS_COGNITO_AUTH_PARAMS_USER", System.getenv("AWS_COGNITO_AUTH_PARAMS_USER"));
String awsCognitoAuthParamsPassword = System.getProperty("AWS_COGNITO_AUTH_PARAMS_PASSWORD", System.getenv("AWS_COGNITO_AUTH_PARAMS_PASSWORD"));
AWSCognitoClient client = new AWSCognitoClient(awsCognitoClientId, awsCognitoAuthFlow, awsCognitoAuthParamsUser, awsCognitoAuthParamsPassword);
token=client.getToken();
} else if (Strings.isNullOrEmpty(token) && vendor.equals("azure")) {
if (Strings.isNullOrEmpty(token) && vendor.equals("azure")) {
String sp_id = System.getProperty("INTEGRATION_TESTER", System.getenv("INTEGRATION_TESTER"));
String sp_secret = System.getProperty("TESTER_SERVICEPRINCIPAL_SECRET", System.getenv("TESTER_SERVICEPRINCIPAL_SECRET"));
String tenant_id = System.getProperty("AZURE_AD_TENANT_ID", System.getenv("AZURE_AD_TENANT_ID"));
String app_resource_id = System.getProperty("AZURE_AD_APP_RESOURCE_ID", System.getenv("AZURE_AD_APP_RESOURCE_ID"));
token = new AzureServicePrincipal().getIdToken(sp_id, sp_secret, tenant_id, app_resource_id);
} else if (Strings.isNullOrEmpty(token) && vendor.equals("ibm")) {
token = IdentityClient.getTokenForUserWithAccess();
}
return "Bearer " + token;
}
......
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