Skip to content

Commit

Permalink
Identity API cleanup and password masking
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjana2310 authored and shreypatidar-beehyv committed Aug 22, 2023
1 parent 1cd247c commit 21b700f
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 42 deletions.
6 changes: 3 additions & 3 deletions src/main/environment/1097_dev.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# DataSource settings: set here your own configurations for the database

spring.datasource.url=jdbc:mysql://10.208.122.32:3306/db_1097_identity?autoReconnect=true&useSSL=false
encDbUserName=0YaEPoKpzM3TrEAHTLYQaf+DfR4mdaeP
encDbPass=V+g/nL6/+ely0bgD7Du0yX83xNRl1H9Y
spring.datasource.url=<Enter AMRIT 1097 DB URL here>
spring.datasource.username=<Enter your AMRIT 1097 DB username>
spring.datasource.password=<Enter your AMRIT 1097 DB password>
spring.datasource.driver-class-name=com.mysql.jdbc.Driver


6 changes: 3 additions & 3 deletions src/main/environment/1097_local.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# DataSource settings: set here your own configurations for the database

spring.datasource.url=jdbc:mysql://localhost:3306/db_1097_identity?autoReconnect=true&useSSL=false
encDbUserName=DSekNOtG9a+qythoUDNKuw==
encDbPass=DSekNOtG9a+qythoUDNKuw==
spring.datasource.url=<Enter AMRIT 1097 DB URL here>
spring.datasource.username=<Enter your AMRIT 1097 DB username>
spring.datasource.password=<Enter your AMRIT 1097 DB password>
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
6 changes: 3 additions & 3 deletions src/main/environment/1097_test.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# DataSource settings: set here your own configurations for the database

spring.datasource.url=jdbc:mysql://10.208.122.38:3306/db_1097_identity?autoReconnect=true&useSSL=false
encDbUserName=0YaEPoKpzM3TrEAHTLYQaf+DfR4mdaeP
encDbPass=V+g/nL6/+ely0bgD7Du0yX83xNRl1H9Y
spring.datasource.url=<Enter AMRIT 1097 DB URL here>
spring.datasource.username=<Enter your AMRIT 1097 DB username>
spring.datasource.password=<Enter your AMRIT 1097 DB password>
spring.datasource.driver-class-name=com.mysql.jdbc.Driver


6 changes: 3 additions & 3 deletions src/main/environment/1097_uat.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# DataSource settings: set here your own configurations for the database

spring.datasource.url=jdbc:mysql://172.16.19.43:3306/db_1097_identity?autoReconnect=true&useSSL=false
encDbUserName=0YaEPoKpzM3TrEAHTLYQaf+DfR4mdaeP
encDbPass=V+g/nL6/+ely0bgD7Du0yX83xNRl1H9Y
spring.datasource.url=<Enter AMRIT 1097 DB URL here>
spring.datasource.username=<Enter your AMRIT 1097 DB username>
spring.datasource.password=<Enter your AMRIT 1097 DB password>
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
6 changes: 3 additions & 3 deletions src/main/environment/common_dev.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DataSource settings: set here your own configurations for the database
spring.datasource.url=jdbc:mysql://10.208.122.32:3306/db_identity?autoReconnect=true&useSSL=false
encDbUserName=0YaEPoKpzM3TrEAHTLYQaf+DfR4mdaeP
encDbPass=V+g/nL6/+ely0bgD7Du0yX83xNRl1H9Y
spring.datasource.url=<Enter AMRIT DB URL here>
spring.datasource.username=<Enter your AMRIT DB username>
spring.datasource.password=<Enter your AMRIT DB password>
spring.datasource.driver-class-name=com.mysql.jdbc.Driver


6 changes: 3 additions & 3 deletions src/main/environment/common_local.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DataSource settings: set here your own configurations for the database
spring.datasource.url=jdbc:mysql://localhost:3306/db_identity?autoReconnect=true&useSSL=false
encDbUserName=DSekNOtG9a+qythoUDNKuw==
encDbPass=DSekNOtG9a+qythoUDNKuw==
spring.datasource.url=<Enter AMRIT DB URL here>
spring.datasource.username=<Enter your AMRIT DB username>
spring.datasource.password=<Enter your AMRIT DB password>
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
4 changes: 2 additions & 2 deletions src/main/environment/common_test.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DataSource settings: set here your own configurations for the database
spring.datasource.url=<Enter AMRIT DB URL here>
encDbUserName=<Enter your AMRIT DB username>
encDbPass=<Enter your AMRIT DB password>
spring.datasource.username=<Enter your AMRIT DB username>
spring.datasource.password=<Enter your AMRIT DB password>
spring.datasource.driver-class-name=com.mysql.jdbc.Driver


6 changes: 3 additions & 3 deletions src/main/environment/common_uat.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# DataSource settings: set here your own configurations for the database
spring.datasource.url=jdbc:mysql://172.16.19.43:3306/db_identity?autoReconnect=true&useSSL=false
encDbUserName=0YaEPoKpzM3TrEAHTLYQaf+DfR4mdaeP
encDbPass=V+g/nL6/+ely0bgD7Du0yX83xNRl1H9Y
spring.datasource.url=<Enter AMRIT DB URL here>
spring.datasource.username=<Enter your AMRIT DB username>
spring.datasource.password=<Enter your AMRIT DB password>
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private ApiInfo metaData()
{
ApiInfoBuilder builder = new ApiInfoBuilder();
builder.contact(new Contact("AMRIT", "https://psmri.github.io/PSMRI/", "[email protected]"));
builder.description("A microservice for the creation and management of beneficaries.");
builder.description("A microservice for the creation and management of beneficiaries.");
builder.version("1.0");
builder.title("Identity API");
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
import com.google.gson.JsonParser;
import com.google.gson.JsonPrimitive;
import com.iemr.common.identity.domain.MBeneficiarymapping;
import com.iemr.common.identity.dto.BenIdImportDTO;
import com.iemr.common.identity.dto.BeneficiariesDTO;
import com.iemr.common.identity.dto.BeneficiariesPartialDTO;
import com.iemr.common.identity.dto.BeneficiaryCreateResp;
import com.iemr.common.identity.dto.IdentityDTO;
import com.iemr.common.identity.dto.IdentityEditDTO;
import com.iemr.common.identity.dto.IdentitySearchDTO;
import com.iemr.common.identity.dto.ReserveIdentityDTO;
import com.iemr.common.identity.exception.MissingMandatoryFieldsException;
import com.iemr.common.identity.mapper.IdentityMapper;
import com.iemr.common.identity.mapper.InputMapper;
Expand All @@ -77,6 +85,7 @@ public class IdentityController {
IdentityMapper mapper;

@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Get beneficiaries by advance search")
@PostMapping(path = "/advanceSearch", headers = "Authorization")
public @ResponseBody String getBeneficiaries(
@ApiParam(value = "{\"firstName\":\"String\",\"genderId\":\"Integer\",\"fatherName\":\"String\","
Expand Down Expand Up @@ -105,6 +114,7 @@ public class IdentityController {
}

@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Search beneficiary based on beneficiary registration id")
@PostMapping(path = "/getByBenRegId", headers = "Authorization")
public @ResponseBody String getBeneficiariesByBeneficiaryRegId(
@ApiParam(value = "\"Integer\"") @RequestParam String benRegId) {
Expand Down Expand Up @@ -141,6 +151,7 @@ public class IdentityController {
}

@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Search identity based on beneficiary registration id")
@PostMapping(path = "/getByBenId", headers = "Authorization")
public @ResponseBody String getBeneficiariesByBeneficiaryId(
@ApiParam(value = "\"Integer\"") @RequestParam String benId) {
Expand Down Expand Up @@ -177,6 +188,7 @@ public class IdentityController {
}

@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Search beneficiary based on phone number")
@PostMapping(path = "/getByPhoneNum", headers = "Authorization")
public @ResponseBody String getBeneficiariesByPhoneNum(
@ApiParam(value = "\"String\"") @RequestParam String phoneNum) {
Expand Down Expand Up @@ -207,8 +219,8 @@ public class IdentityController {
return response;
}

// search beneficiary by healthid / ABHA_Address
@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Search beneficiary based on health ID / ABHA Address")
@PostMapping(path = "/getByAbhaAddress", headers = "Authorization")
public @ResponseBody String searhBeneficiaryByABHAAddress(
@ApiParam(value = "\"String\"") @RequestParam String healthID) {
Expand Down Expand Up @@ -240,8 +252,8 @@ public class IdentityController {
return response;
}

// search beneficiary by healthid / ABHA_Address
@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Search beneficiary based on health ID number / ABHA ID number")
@PostMapping(path = "/getByAbhaIdNo", headers = "Authorization")
public @ResponseBody String searhBeneficiaryByABHAIdNo(
@ApiParam(value = "\"String\"") @RequestParam String healthIDNo) {
Expand Down Expand Up @@ -273,8 +285,8 @@ public class IdentityController {
return response;
}

// search beneficiary by family id
@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Search beneficiary based on family id")
@PostMapping(path = "/searchByFamilyId", headers = "Authorization")
public @ResponseBody String searhBeneficiaryByFamilyId(
@ApiParam(value = "\"String\"") @RequestParam String familyId) {
Expand Down Expand Up @@ -329,8 +341,8 @@ public class IdentityController {
return response;
}

// search beneficiary by gov identity - aadhar, pan, voter id etc
@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Search beneficiary based on government identity number")
@PostMapping(path = "/searhByGovIdentity", headers = "Authorization")
public @ResponseBody String searhBeneficiaryByGovIdentity(
@ApiParam(value = "\"String\"") @RequestParam String identity) {
Expand Down Expand Up @@ -365,6 +377,7 @@ public class IdentityController {
* @return
*/
@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Edit identity by agent")
@PostMapping(path = "/edit", headers = "Authorization")
public @ResponseBody String editIdentity(@ApiParam(value = "{\r\n" + " \"eventTypeName\": \"String\",\r\n"
+ " \"eventTypeDate\": \"Timestamp\",\r\n" + " \"agentId\": \"Integer\",\r\n"
Expand Down Expand Up @@ -497,6 +510,7 @@ public class IdentityController {
* @return
*/
@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Create identity by agent")
@PostMapping(path = "/create", headers = "Authorization")
public @ResponseBody String createIdentity(@ApiParam(value = "{\r\n" + " \"eventTypeName\": \"String\",\r\n"
+ " \"eventTypeDate\": \"Timestamp\",\r\n" + " \"agentId\": \"Integer\",\r\n"
Expand Down Expand Up @@ -615,6 +629,7 @@ public class IdentityController {
}

@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Reserve identity by agent")
@PostMapping(path = "/reserve", headers = "Authorization")
public @ResponseBody String reserveIdentity(@RequestBody String reserveIdentity) {
logger.info("IdentityController.reserveIdentity - start");
Expand All @@ -635,6 +650,7 @@ public class IdentityController {
}

@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Unreserve identity by agent")
@PostMapping(path = "/unreserve", headers = "Authorization")
public @ResponseBody String unreserveIdentity(@RequestBody String unreserve) {
logger.info("IdentityController.unreserveIdentity - start");
Expand All @@ -661,6 +677,7 @@ public class IdentityController {
* @return
*/
@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Get beneficiaries partial details by beneficiary registration id list")
@PostMapping(path = "/getByPartialBenRegIdList", headers = "Authorization")
public @ResponseBody String getPartialBeneficiariesByBenRegIds(
@ApiParam(value = "[Integer,Integer…..(array of benRegId)]") @RequestBody String benRegIds) {
Expand Down Expand Up @@ -693,6 +710,7 @@ public class IdentityController {
* @return
*/
@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Get beneficiaries by beneficiary registration id")
@PostMapping(path = "/getByBenRegIdList", headers = "Authorization")
public @ResponseBody String getBeneficiariesByBenRegIds(
@ApiParam(value = " {\"beneficiaryRegID\": \"Long\"}") @RequestBody String benRegIds) {
Expand Down Expand Up @@ -832,6 +850,7 @@ public String getJsonAsString(Object obj) {
}

@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Get finite beneficiaries")
@PostMapping(path = "/finiteSearch", headers = "Authorization")
public @ResponseBody String getFiniteBeneficiaries(@RequestBody String searchFilter) {
logger.info("IdentityController.getFiniteBeneficiaries - start");
Expand Down Expand Up @@ -862,6 +881,7 @@ public String getJsonAsString(Object obj) {

// New API for getting beneficiary image only.
@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Get beneficiary image by beneficiary registration id")
@PostMapping(path = "/benImageByBenRegID", headers = "Authorization")
public @ResponseBody String getBeneficiaryImageByBenRegID(@RequestBody String identityData) {
String benImage = null;
Expand All @@ -876,6 +896,7 @@ public String getJsonAsString(Object obj) {
}

@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Edit education or community by agent")
@PostMapping(path = "/editEducationOrCommunity", headers = "Authorization")
public @ResponseBody String editIdentityEducationOrCommunity(@ApiParam(value = "{\r\n"
+ " \"eventTypeName\": \"String\",\r\n" + " \"eventTypeDate\": \"Timestamp\",\r\n"
Expand Down Expand Up @@ -1003,7 +1024,7 @@ public String getJsonAsString(Object obj) {
}

@CrossOrigin()
@ApiOperation(value = "Check available BENID in local", consumes = "application/json", produces = "application/json")
@ApiOperation(value = "Check available beneficary id in local server", consumes = "application/json", produces = "application/json")
@GetMapping(path = "/checkAvailablBenIDLocalServer", headers = "Authorization")
public @ResponseBody String checkAvailablBenIDLocalServer() {
com.iemr.common.identity.utils.response.OutputResponse response = new com.iemr.common.identity.utils.response.OutputResponse();
Expand All @@ -1018,7 +1039,7 @@ public String getJsonAsString(Object obj) {
}

@CrossOrigin(origins = { "*commonapi*" })
@ApiOperation(value = "Save Server generated BeneficiaryID & BenRegID to local server", consumes = "application/json", produces = "application/json")
@ApiOperation(value = "Save server generated beneficiary ID & beneficiary registration ID to local server", consumes = "application/json", produces = "application/json")
@PostMapping(path = "/saveGeneratedBenIDToLocalServer", headers = "Authorization")
public @ResponseBody String saveGeneratedBenIDToLocalServer(
@ApiParam(value = "{\r\n" + " \"vanID\": \"Integer\",\r\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class FamilyTaggingController {
private FamilyTagService familyTagService;

@CrossOrigin()
@ApiOperation(value = "Create and Modify family tagging", consumes = "application/json", produces = "application/json")
@ApiOperation(value = "Create and modify family tagging", consumes = "application/json", produces = "application/json")
@RequestMapping(value = { "/addTag" }, method = { RequestMethod.POST })
public String saveFamilyTagging(@RequestBody String comingReq) {
String s;
Expand All @@ -60,7 +60,7 @@ public String saveFamilyTagging(@RequestBody String comingReq) {
}

@CrossOrigin()
@ApiOperation(value = "Create Family", consumes = "application/json", produces = "application/json")
@ApiOperation(value = "Create family", consumes = "application/json", produces = "application/json")
@RequestMapping(value = { "/createFamily" }, method = { RequestMethod.POST })
public String createFamily(@RequestBody String comingReq) {
String s;
Expand All @@ -76,7 +76,7 @@ public String createFamily(@RequestBody String comingReq) {
}

@CrossOrigin()
@ApiOperation(value = "Search Family", consumes = "application/json", produces = "application/json")
@ApiOperation(value = "Search family", consumes = "application/json", produces = "application/json")
@RequestMapping(value = { "/searchFamily" }, method = { RequestMethod.POST })
public String searchFamily(@RequestBody String comingReq) {
String s;
Expand Down Expand Up @@ -124,7 +124,7 @@ public String untagFamily(@RequestBody String comingReq) {
}

@CrossOrigin()
@ApiOperation(value = "edit beneficiary family details", consumes = "application/json", produces = "application/json")
@ApiOperation(value = "Edit beneficiary family details", consumes = "application/json", produces = "application/json")
@RequestMapping(value = { "/editFamilyTagging" }, method = { RequestMethod.POST })
public String editFamilyDetails(@RequestBody String comingReq) {
String s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,21 @@
import io.swagger.annotations.ApiParam;

/**
* @date : 13-02-2019,
* @apiNote API will be exposed to public domain for RMNCH mobile data sync to
* AMRIT platform
* @author NE298657
*/
@RestController
@RequestMapping(value = "/rmnch", headers = "Authorization")
public class RmnchMobileAppController {
public class RMNCHMobileAppController {

private Logger logger = LoggerFactory.getLogger(RmnchMobileAppController.class);
private Logger logger = LoggerFactory.getLogger(RMNCHMobileAppController.class);

@Autowired
@Qualifier("rmnchServiceImpl")
RmnchDataSyncService rmnchDataSyncService;

@RequestMapping(value = "/syncDataToAmrit", method = RequestMethod.POST)
@ApiOperation(value = "sync data to amrit for already regestered beneficiary with AMRIT beneficiary id ", consumes = "application/json", produces = "application/json")
@ApiOperation(value = "Sync data to AMRIT for already regestered beneficiary with AMRIT beneficiary id ", consumes = "application/json", produces = "application/json")
public String syncDataToAmrit(@ApiParam(value = "{\r\n" + " \"beneficiaryDetails\": [\r\n" + " {\r\n"
+ " \"BenRegId\": \"Long\",\r\n" + " \"Countyid\": \"Integer\",\r\n"
+ " \"Processed\": \"String\",\r\n" + " \"ProviderServiceMapID\": \"Integer\",\r\n"
Expand Down Expand Up @@ -136,7 +134,7 @@ public String syncDataToAmrit(@ApiParam(value = "{\r\n" + " \"beneficiaryDetail

// @Deprecated
@RequestMapping(value = "/getBeneficiaryDataForVillage", method = RequestMethod.POST)
@ApiOperation(value = "get beneficiary data for given village ", consumes = "application/json", produces = "application/json")
@ApiOperation(value = "Get beneficiary data for given village ", consumes = "application/json", produces = "application/json")
public String getBeneficiaryData(
@ApiParam(value = "{\r\n" + "\"villageID\":\"Integer\",\r\n" + "\"fromDate\":\"DateTime\",\r\n"
+ "\"toDate\":\"DateTime\",\r\n" + "\"pageNo\":\"Integer\"\r\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@

import com.iemr.common.identity.utils.response.OutputResponse;

import io.swagger.annotations.ApiOperation;

@RestController
public class VersionController {

private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());

@CrossOrigin()
@ApiOperation(value = "Get version information", consumes = "application/json", produces = "application/json")
@RequestMapping(value = "/version", method = { RequestMethod.GET })
public String versionInformation() {
OutputResponse output = new OutputResponse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.iemr.common.identity.controller.rmnch.RmnchMobileAppController;
import com.iemr.common.identity.controller.rmnch.RMNCHMobileAppController;
import com.iemr.common.identity.data.rmnch.BenHealthIDDetails;
import com.iemr.common.identity.data.rmnch.GetBenRequestHandler;
import com.iemr.common.identity.data.rmnch.NcdTbHrpData;
Expand Down Expand Up @@ -83,7 +83,7 @@
@PropertySource("classpath:application.properties")
public class RmnchDataSyncServiceImpl implements RmnchDataSyncService {

private Logger logger = LoggerFactory.getLogger(RmnchMobileAppController.class);
private Logger logger = LoggerFactory.getLogger(RMNCHMobileAppController.class);
private ConfigProperties properties;
@Value("${door-to-door-page-size}")
private String door_to_door_page_size;
Expand Down

0 comments on commit 21b700f

Please sign in to comment.