From 87ef11e7f9d600e5aac41800e3f4e1a3cf1d8252 Mon Sep 17 00:00:00 2001 From: Rucha Deshpande <deshruch@amazon.com> Date: Mon, 16 Nov 2020 11:19:55 -0600 Subject: [PATCH] update core -lib and add debug stsms --- .../osdu/notification/api/PubsubEndpoint.java | 2 ++ provider/notification-aws/pom.xml | 2 +- .../aws/impl/ServiceAccountJwtAwsClientImpl.java | 11 +++-------- testing/notification-test-aws/pom.xml | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/api/PubsubEndpoint.java b/notification-core/src/main/java/org/opengroup/osdu/notification/api/PubsubEndpoint.java index 9ae87d9e0..01214bc5c 100644 --- a/notification-core/src/main/java/org/opengroup/osdu/notification/api/PubsubEndpoint.java +++ b/notification-core/src/main/java/org/opengroup/osdu/notification/api/PubsubEndpoint.java @@ -155,6 +155,8 @@ public class PubsubEndpoint { private String querySubscriptionAndUpdateCache(String notificationId) throws Exception { Map<String,String> hmap = headers.getHeaders(); + String auth_header = hmap.get("Authorization"); + System.out.println("Notification token before creating subscription service= "+auth_header); ISubscriptionService service = subscriptionFactory.create(headers); diff --git a/provider/notification-aws/pom.xml b/provider/notification-aws/pom.xml index 9ebc145a9..f4f41141f 100644 --- a/provider/notification-aws/pom.xml +++ b/provider/notification-aws/pom.xml @@ -50,7 +50,7 @@ <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> <artifactId>os-core-lib-aws</artifactId> - <version>0.3.14-feat-deshruch-oauth-changes-SNAPSHOT</version> + <version>0.3.14-oauth-feat-deshruch-oauth-changes-SNAPSHOT</version> </dependency> <!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-secretsmanager --> diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/ServiceAccountJwtAwsClientImpl.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/ServiceAccountJwtAwsClientImpl.java index 13a5fa6d7..6f9dfbc2c 100644 --- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/ServiceAccountJwtAwsClientImpl.java +++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/ServiceAccountJwtAwsClientImpl.java @@ -108,19 +108,14 @@ public class ServiceAccountJwtAwsClientImpl implements IServiceAccountJwtClient Parameter paramsResult = paramResult.getParameter(); client_credentials_clientid = paramsResult.getValue(); client_credentials_secret = getSecret(client_secret_secretName,amazonRegion,client_secret_key); - String token= getServicePrincipalCredentials(); - System.out.println(token); + } } @Override public String getIdToken(String s) { - String token= getServicePrincipalCredentials(); - System.out.println("Printing the client credentials token generated"); - System.out.println(token); return token; - } public String getServicePrincipalCredentials() @@ -147,13 +142,13 @@ public class ServiceAccountJwtAwsClientImpl implements IServiceAccountJwtClient { System.out.println("Could not parse AccessToken result to get access_token"); } - return token; + return "Bearer "+token; } public String getSecret(String secretName, String region,String secretKey) { -String secretVaue=""; + String secretVaue=""; // Create a Secrets Manager client AWSSecretsManager client = AWSSecretsManagerClientBuilder.standard() .withRegion(region) diff --git a/testing/notification-test-aws/pom.xml b/testing/notification-test-aws/pom.xml index 20f18a766..50ef297b5 100644 --- a/testing/notification-test-aws/pom.xml +++ b/testing/notification-test-aws/pom.xml @@ -44,7 +44,7 @@ <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> <artifactId>os-core-lib-aws</artifactId> - <version>0.3.14-feat-deshruch-oauth-changes-SNAPSHOT</version> + <version>0.3.14-oauth-feat-deshruch-oauth-changes-SNAPSHOT</version> </dependency> <dependency> <groupId>com.amazonaws</groupId> -- GitLab