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 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: 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 eafb853d..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 "test_12341234"; + public static String appStoreTesterLoginToken() { + return SecretConstants.appStoreTesterLoginToken(); } /** 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); 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..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,12 +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 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; }