From 2df06b30fd935b40c1a15b3c964d4d0423ca8e61 Mon Sep 17 00:00:00 2001 From: Raj Shah Date: Mon, 18 Sep 2023 11:44:40 +0530 Subject: [PATCH 1/5] Updated default test user code --- src/main/java/com/salessparrow/api/config/CoreConstants.java | 2 +- .../salessparrow/api/lib/globalConstants/SecretConstants.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/salessparrow/api/config/CoreConstants.java b/src/main/java/com/salessparrow/api/config/CoreConstants.java index eafb853d..dc78d65d 100644 --- a/src/main/java/com/salessparrow/api/config/CoreConstants.java +++ b/src/main/java/com/salessparrow/api/config/CoreConstants.java @@ -80,7 +80,7 @@ public static String defaultTestUserPassword() { } public static String defaultTestUserCode() { - return "test_12341234"; + return SecretConstants.defaultTestUserCode(); } /** diff --git a/src/main/java/com/salessparrow/api/lib/globalConstants/SecretConstants.java b/src/main/java/com/salessparrow/api/lib/globalConstants/SecretConstants.java index 0e10eefc..d7512652 100644 --- a/src/main/java/com/salessparrow/api/lib/globalConstants/SecretConstants.java +++ b/src/main/java/com/salessparrow/api/lib/globalConstants/SecretConstants.java @@ -148,6 +148,10 @@ public static String defaultTestUserPassword() { return getSecret("DEFAULT_TEST_USER_PASSWORD"); } + public static String defaultTestUserCode() { + return getSecret("DEFAULT_TEST_USER_CODE"); + } + /* Secrets end */ /** From a8a8f74d30ccf7fc3fcd26a2e59aaa44b4c27dfe Mon Sep 17 00:00:00 2001 From: Raj Shah Date: Mon, 18 Sep 2023 11:56:28 +0530 Subject: [PATCH 2/5] Updated tester user variable names --- sample.secrets.json | 5 +++-- .../com/salessparrow/api/config/CoreConstants.java | 12 ++++++------ .../api/lib/globalConstants/SecretConstants.java | 12 ++++++------ .../lib/salesforce/wrappers/SalesforceTokens.java | 4 ++-- .../api/services/salesforce/AuthService.java | 4 ++-- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/sample.secrets.json b/sample.secrets.json index f804c4e4..cbd22909 100644 --- a/sample.secrets.json +++ b/sample.secrets.json @@ -15,6 +15,7 @@ "ERROR_MAIL_TO": "", "COOKIE_DOMAIN": "", "OPENAI_API_KEY": "", - "DEFAULT_TEST_USER":"", - "DEFAULT_TEST_USER_PASSWORD":"" + "APP_STORE_TESTER_LOGIN_USER":"", + "APP_STORE_TESTER_LOGIN_PASSWORD":"", + "APP_STORE_TESTER_LOGIN_TOKEN": "" } \ No newline at end of file diff --git a/src/main/java/com/salessparrow/api/config/CoreConstants.java b/src/main/java/com/salessparrow/api/config/CoreConstants.java index dc78d65d..55d2739d 100644 --- a/src/main/java/com/salessparrow/api/config/CoreConstants.java +++ b/src/main/java/com/salessparrow/api/config/CoreConstants.java @@ -71,16 +71,16 @@ public static String localKmsEndpoint() { return SecretConstants.localKmsEndpoint(); } - public static String defaultTestUser() { - return SecretConstants.defaultTestUser(); + public static String appStoreTesterLoginUser() { + return SecretConstants.appStoreTesterLoginUser(); } - public static String defaultTestUserPassword() { - return SecretConstants.defaultTestUserPassword(); + public static String appStoreTesterLoginPassword() { + return SecretConstants.appStoreTesterLoginPassword(); } - public static String defaultTestUserCode() { - return SecretConstants.defaultTestUserCode(); + public static String appStoreTesterLoginToken() { + return SecretConstants.appStoreTesterLoginToken(); } /** diff --git a/src/main/java/com/salessparrow/api/lib/globalConstants/SecretConstants.java b/src/main/java/com/salessparrow/api/lib/globalConstants/SecretConstants.java index d7512652..d5444f60 100644 --- a/src/main/java/com/salessparrow/api/lib/globalConstants/SecretConstants.java +++ b/src/main/java/com/salessparrow/api/lib/globalConstants/SecretConstants.java @@ -140,16 +140,16 @@ public static String localKmsEndpoint() { return getSecret("LOCAL_KMS_ENDPOINT"); } - public static String defaultTestUser() { - return getSecret("DEFAULT_TEST_USER"); + public static String appStoreTesterLoginUser() { + return getSecret("APP_STORE_TESTER_LOGIN_USER"); } - public static String defaultTestUserPassword() { - return getSecret("DEFAULT_TEST_USER_PASSWORD"); + public static String appStoreTesterLoginPassword() { + return getSecret("APP_STORE_TESTER_LOGIN_PASSWORD"); } - public static String defaultTestUserCode() { - return getSecret("DEFAULT_TEST_USER_CODE"); + public static String appStoreTesterLoginToken() { + return getSecret("APP_STORE_TESTER_LOGIN_TOKEN"); } /* Secrets end */ diff --git a/src/main/java/com/salessparrow/api/lib/salesforce/wrappers/SalesforceTokens.java b/src/main/java/com/salessparrow/api/lib/salesforce/wrappers/SalesforceTokens.java index a1030a19..0dd96e91 100644 --- a/src/main/java/com/salessparrow/api/lib/salesforce/wrappers/SalesforceTokens.java +++ b/src/main/java/com/salessparrow/api/lib/salesforce/wrappers/SalesforceTokens.java @@ -46,8 +46,8 @@ public HttpResponse getTokens(String code, String redirectUri, Boolean isTestUse requestBody = String.format( "grant_type=%s&client_id=%s&client_secret=%s&username=%s&password=%s&redirect_uri=%s", salesforceConstants.passwordGrantType(), CoreConstants.salesforceClientId(), - CoreConstants.salesforceClientSecret(), CoreConstants.defaultTestUser(), - CoreConstants.defaultTestUserPassword(), redirectUri); + CoreConstants.salesforceClientSecret(), CoreConstants.appStoreTesterLoginUser(), + CoreConstants.appStoreTesterLoginPassword(), redirectUri); } Map headers = new HashMap<>(); diff --git a/src/main/java/com/salessparrow/api/services/salesforce/AuthService.java b/src/main/java/com/salessparrow/api/services/salesforce/AuthService.java index 6a7d6a87..c1ff549c 100644 --- a/src/main/java/com/salessparrow/api/services/salesforce/AuthService.java +++ b/src/main/java/com/salessparrow/api/services/salesforce/AuthService.java @@ -93,11 +93,11 @@ public AuthServiceDto connectToSalesforce(SalesforceConnectDto params, HttpServl this.isNewUser = true; // setting default value true to this variable, this will // be updated based on conditions in further processing - String testUserCode = CoreConstants.defaultTestUserCode(); + String appStoreTesterLoginToken = CoreConstants.appStoreTesterLoginToken(); Boolean isTestUser = false; code = params.getCode(); - if (code.equals(testUserCode)) { + if (code.equals(appStoreTesterLoginToken)) { isTestUser = true; } From c09c9ce57ff4de5d4f32aab9258ed06e27478a3b Mon Sep 17 00:00:00 2001 From: Raj Shah Date: Mon, 18 Sep 2023 12:51:24 +0530 Subject: [PATCH 3/5] Updated the release version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c9e70ecb..bc5dc2cc 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ com.salessparrow salessparrow-api - 0.2.0 + 0.2.2 api Salessparrow apis From 8ae5cf6f856efeda50a97bca8b5ad213cec3379c Mon Sep 17 00:00:00 2001 From: Raj Shah Date: Mon, 18 Sep 2023 12:58:52 +0530 Subject: [PATCH 4/5] Added 0.2.1 and 0.2.2 in changelog.md --- repo-docs/CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/repo-docs/CHANGELOG.md b/repo-docs/CHANGELOG.md index 50bd86b5..6ce8a514 100644 --- a/repo-docs/CHANGELOG.md +++ b/repo-docs/CHANGELOG.md @@ -1,5 +1,21 @@ # SalesSparrow APIs +## 0.2.2 + +### Enhancements: + +- Update Default Test User Login to use token from Environment [#92](https://github.com/TrueSparrowSystems/AI-SalesSparrow-API/issues/92) + +## 0.2.1 + +### New Features and Enhancements: + +- Default Test User Login in Connect Flow [#90](https://github.com/TrueSparrowSystems/AI-SalesSparrow-API/issues/90) + +### Bug Fixes: + +- Use Environment based Naming as Suffix in Cache Names [#91](https://github.com/TrueSparrowSystems/AI-SalesSparrow-API/issues/91) + ## 0.2.0 ### New Features and Enhancements: From 2918425c517083bca8dbca5ea3d197386a018a88 Mon Sep 17 00:00:00 2001 From: Raj Shah Date: Mon, 18 Sep 2023 13:58:44 +0530 Subject: [PATCH 5/5] Updated logs --- .../com/salessparrow/api/controllers/AccountController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/salessparrow/api/controllers/AccountController.java b/src/main/java/com/salessparrow/api/controllers/AccountController.java index 9bce08a7..adaa9ab5 100644 --- a/src/main/java/com/salessparrow/api/controllers/AccountController.java +++ b/src/main/java/com/salessparrow/api/controllers/AccountController.java @@ -35,7 +35,7 @@ public class AccountController { @GetMapping("") public ResponseEntity getAccounts(HttpServletRequest request, @Valid @ModelAttribute GetAccountsDto getAccountsDto) { - logger.info("Request received"); + logger.info("Get Accounts Request received"); GetAccountListResponseDto getAccountsResponse = getAccountListService.getAccounts(request, getAccountsDto); @@ -45,7 +45,7 @@ public ResponseEntity getAccounts(HttpServletRequest @GetMapping("/feed") public ResponseEntity getFeed(HttpServletRequest request, @Valid @ModelAttribute GetAccountsFeedDto getAccountsFeedDto) { - logger.info("Request received"); + logger.info("Get Account Feed Request received"); GetAccountsFeedResponseDto getAccountsFeedResponse = getAccountsFeedService.getAccountsFeed(request, getAccountsFeedDto);