Skip to content

Commit

Permalink
Mege dev2 to 1.2.0 rc2 sprint3-1 (#697)
Browse files Browse the repository at this point in the history
* Added default filter attributes to configuration (#596)

* Added default filter attributes to configuration

* Code updated

* Mosip 18119 auto allow new dynamic attributes for authentication (#598)

* Fixes in demo auth dynamic attributes

* Fixed error message for decoding failure

* Fix in fetching postal code for auth anonym profile

* WIP for dynamic attribute auto match

* Allow new dynamic attrib for auth without mapping

* Removed unwanted comment

* Fix age not match err msg (#599)

* Fixes in demo auth dynamic attributes

* Fixed error message for decoding failure

* Fix in fetching postal code for auth anonym profile

* WIP for dynamic attribute auto match

* Allow new dynamic attrib for auth without mapping

* Removed unwanted comment

* Fix in age not match error msg

* Fix bio auth type check issue due to case sensitive check (#600)

* Fix bio auth type check issue due to case sensitive check

* Minor fix

* junit test cases for AuthAnonymousProfileServiceImpl.java (#604)

* Mosip 18252 dsl bio auth fix (#609)

* Fix bio auth type check issue due to case sensitive check

* Minor fix

* Added missing Face for ekyc request in filter

* Fixed otp kyc filter NPE issue due to null bio (#615)

* Fixed multi modal auth cbeff load issue (#617)

* Fixed ekyc face retrival issue (#619)

* MOSIP-18366,MOSIP-18370 bio type subtype error message correction (#621)

* Fixed biotype,biosubtype related error messages

* Fix NPE for null idtype

* Test fixes

* Revert debug code for idserviceimpl

* test cases updated (#620)

* IdInfoHelper Test cases updated (#623)

* Fix dynamic attribute language code issue (#624)

* KycController updated with test cases (#625)

* Fixed test case failure (#626)

* updated test cases (#627)

* Revert "updated test cases" (#628)

This reverts commit 5cb0b79758ede70509ff7e0cbe864e9589434cff.

* Mosip 18411,MOSIP-17587 fix filter attrip for ekyc (#632)

* Fixed keymanager bean loading issue

* MOSIP-18411 fixed kyc attribute filtered out issue

* MOSIP-17587-Fix status for ekyc auth in anonym profile

* Mosip 18191 fix bio auth segment timestamp validation issue (#633)

* Fix duplicate type code in kyc auth txn entry

* MOSIP-18191 fix segment timestamp validation not working

* Added null check for auth type code duplicate condition

* MOSIP-18265 Added column to key alias table (#638)

* CredentialServiceImplTest (#636)

Co-authored-by: Vipul Dhurve <[email protected]>

* MOSIP-18053-fixed duplicate match inputs for multiple dynamic attrib in auth req (#640)

* MOSIP-18053-fixed duplicate match inputs for multiple dynamic attrib in req

* added jdoc

* [MOSIP-18119] Updated Notification timestamp based on timezone in prop (#641)

* [MOSIP-18119] Updated Notification timestamp based on timezone in prop (#643)

* [MOSIP-18119] Updated Notification timestamp based on timezone in prop

* [MOSIP-18119] Fixed test case failures

* Removed unnecessary db call (#645)

* MOSIP-18377 Column addition to indices (#649)

* MOSIP-16182 Add unique constraint to cert thumbprint column (#651)

* CredentialStoreServiceImplTest (#654)

* CredentialStoreServiceImplTest update

* CredentialStoreServiceImplTest update

Co-authored-by: Vipul Dhurve <[email protected]>

* MatchInputBuilderTest test cases (#655)

* [MOSIP-17776] added temp logging for debugging (#658)

* [MOSIP-17776] reverted debugging code (#659)

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] reverted debugging code

* AuthTransactionHelperTest updated with test cases (#657)

* [MOSIP-9803] Updated swagger to accept Authorization header (#661)

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] reverted debugging code

* [MOSIP-9803] Updated swagger to accept Authorization header

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-9803] Updated swagger to accept Authorization header

* Created test class for HotlistServiceImpl (#660)

* CredentialStoreServiceImplTest update

* CredentialStoreServiceImplTest update

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Mosip 18419 integrate with auth adapter for offline token validation (#656)

* Using RestHelper from ID Repo Core

* Fixes in rest helper config

* Added auth adapter download in docker cmd

* Fix compilation issue

* Mosip 18419 integrate with auth adapter for offline token validation 2 (#662)

* Using RestHelper from ID Repo Core

* Fixes in rest helper config

* Added auth adapter download in docker cmd

* Fix compilation issue

* Fixed missing env declaration in dockerfile

* Mosip 18419 integrate with auth adapter for offline token validation 3 (#663)

* Using RestHelper from ID Repo Core

* Fixes in rest helper config

* Added auth adapter download in docker cmd

* Fix compilation issue

* Fixed missing env declaration in dockerfile

* Added jar to classpath

* Mosip 18523 perf fixes (#665)

* Add cacheable to uin hash salt repo

* Minor refactor

* Fix to cache key

* MOSIP-16182 Composite unique key for ca cert store (#667)

* Created test class for WebSubHelper (#669)

* CredentialStoreServiceImplTest update

* CredentialStoreServiceImplTest update

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for WebSubHelper: WebSubHelperTest

* Created Test class for WebSubHelper: WebSubHelperTest

* Created Test class for WebSubHelper: WebSubHelperTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Integrate with resthelper-issue-fix (#671)

* Fix perf issue to use substring based logic for salt key calculation instead of modulo (#670)

* Added @transactional to handle duplicate requests (#678)

* Merge sonar coverage (#680)

* updated test cases

* updated test cases

* KycFacadeImplTest class test cases updated

* Test fix

Co-authored-by: Neosoft_MamtaA <[email protected]>

* Merge sonar coverage 2 (#681)

* updated test cases

* updated test cases

* KycFacadeImplTest class test cases updated

* Test fix

* Added json to classpath

Co-authored-by: Neosoft_MamtaA <[email protected]>

* Merge sonar coverage 2 (#682)

* updated test cases

* updated test cases

* KycFacadeImplTest class test cases updated

* Test fix

* Added json to classpath

* Test fix

Co-authored-by: Neosoft_MamtaA <[email protected]>

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest (#683)

Co-authored-by: Vipul Dhurve <[email protected]>

* Created Test Class for IdAuthFraudAnalysisEventManager (#684)

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest

* Created Test Class for IdAuthFraudAnalysisEventManager =>IdAuthFraudAnalysisEventManagerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Created Test class for PartnerServiceCallbackController (#685)

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest

* Created Test Class for IdAuthFraudAnalysisEventManager =>IdAuthFraudAnalysisEventManagerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Created test class for PartnerServiceEventsInitializer (#686)

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest

* Created Test Class for IdAuthFraudAnalysisEventManager =>IdAuthFraudAnalysisEventManagerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created test class for PartnerServiceEventsInitializer => PartnerServiceEventsInitializerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Fix in setting the policy metadata for authToken issue (#687)

* Mosip 18612 perf fix resp to map conversion 3 (#690)

* Fixed repeated request body parsing

* WIP - updated controller side

* Added missing class

* setting id version on respnse obj creation

* Fixed respTime, transaction ID Store, send Error

* Store auth txn and anonym profile

* Test fixes

* Fix to load missing bean

* WIP - Fixes in id version and anonym prof

* Fix in errors in anonym prof

* Reverted debug idserviceimpl

* Fix for error code in anonym prof for match failure

* Fixes to store auth txn and anonym prof on err

* Revert debug idserviceimpl

* Fix test failure

* reated test class for IdChangeEventsInitializer  (#692)

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest

* Created Test Class for IdAuthFraudAnalysisEventManager =>IdAuthFraudAnalysisEventManagerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created test class for PartnerServiceEventsInitializer => PartnerServiceEventsInitializerTest

* Created test class for IdChangeEventsInitializer => IdChangeEventsInitializerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Moved test classes to test src (#693)

* Mosip 17586 sonar fix (#694)

* Moved test classes to test src

* fix package

* Fix unique ID creation logic (#696)

Co-authored-by: Nagarjuna K <[email protected]>
Co-authored-by: mamta-344 <[email protected]>
Co-authored-by: rambhatt1591 <[email protected]>
Co-authored-by: vipuldhurve02 <[email protected]>
Co-authored-by: Vipul Dhurve <[email protected]>
Co-authored-by: Manoj SP <[email protected]>
Co-authored-by: Neosoft_MamtaA <[email protected]>
  • Loading branch information
8 people authored Dec 7, 2021
1 parent ae94eaf commit 6bfdabd
Show file tree
Hide file tree
Showing 80 changed files with 4,039 additions and 1,266 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
package io.mosip.authentication.common.service.builder;

import java.text.SimpleDateFormat;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.TimeZone;
import java.util.stream.Stream;

import io.mosip.authentication.common.service.util.IdaRequestResponsConsumerUtil;
import io.mosip.authentication.core.indauth.dto.AuthError;
import io.mosip.authentication.core.indauth.dto.AuthResponseDTO;
import io.mosip.authentication.core.indauth.dto.AuthStatusInfo;
import io.mosip.authentication.core.indauth.dto.ResponseDTO;
import io.mosip.kernel.core.util.DateUtils;

/**
* The builder class of AuthResponseDTO.
Expand All @@ -20,9 +25,6 @@
*/
public class AuthResponseBuilder {

/** The date format to use */
private SimpleDateFormat dateFormat;

/** The built flag. */
private boolean built;

Expand All @@ -32,15 +34,17 @@ public class AuthResponseBuilder {
/** The auth status infos. */
private List<AuthStatusInfo> authStatusInfos;

private String dateTimePattern;

/**
* Instantiates a new auth response builder.
*
* @param dateTimePattern the date time pattern
*/
private AuthResponseBuilder(String dateTimePattern) {
this.dateTimePattern = dateTimePattern;
responseDTO = new AuthResponseDTO();
authStatusInfos = new ArrayList<>();
dateFormat = new SimpleDateFormat(dateTimePattern);
}

/**
Expand Down Expand Up @@ -118,18 +122,25 @@ public AuthResponseBuilder setVersion(String ver) {
* @param tokenID the auth token ID
* @return the auth response DTO
*/
public AuthResponseDTO build(String tokenID) {
public AuthResponseDTO build(String tokenID, String requestTime) {
assertNotBuilt();
boolean status = !authStatusInfos.isEmpty() && authStatusInfos.stream().allMatch(AuthStatusInfo::isStatus);
ResponseDTO res = new ResponseDTO();
res.setAuthStatus(status);
res.setAuthToken(tokenID);
responseDTO.setResponse(res);

responseDTO.setResponseTime(dateFormat.format(new Date()));
String resTime = IdaRequestResponsConsumerUtil.getResponseTime(requestTime, dateTimePattern);
responseDTO.setResponseTime(resTime);
AuthError[] authErrors = authStatusInfos.stream().flatMap(statusInfo -> Optional.ofNullable(statusInfo.getErr())
.map(List<AuthError>::stream).orElseGet(Stream::empty)).toArray(size -> new AuthError[size]);
addErrors(authErrors);
if(authErrors.length > 0) {
addErrors(authErrors);
}

if(responseDTO.getErrors() != null && responseDTO.getErrors().isEmpty()) {
responseDTO.setErrors(null);
}

built = true;
return responseDTO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package io.mosip.authentication.common.service.builder;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

import org.springframework.core.env.Environment;
import org.springframework.core.env.PropertyResolver;

import io.mosip.authentication.common.service.entity.AutnTxn;
import io.mosip.authentication.common.service.helper.AuditHelper;
Expand All @@ -27,7 +26,6 @@
import io.mosip.kernel.core.exception.ParseException;
import io.mosip.kernel.core.logger.spi.Logger;
import io.mosip.kernel.core.util.DateUtils;
import io.mosip.kernel.core.util.UUIDUtils;

/**
* The builder to build {@code AutnTxn} instance.
Expand Down Expand Up @@ -246,7 +244,7 @@ public AutnTxn build(Environment env, IdaUinHashSaltRepo uinHashSaltRepo,
AutnTxn autnTxn = new AutnTxn();
autnTxn.setRefId(idvId == null ? null : IdAuthSecurityManager.generateHashAndDigestAsPlainText(idvId.getBytes()));
autnTxn.setRefIdType(idvIdType);
String id = createId(token, env);
String id = createId();
autnTxn.setToken(token);
autnTxn.setId(id);
autnTxn.setCrBy(env.getProperty(IdAuthConfigKeyConstants.APPLICATION_ID));
Expand Down Expand Up @@ -330,11 +328,8 @@ public AutnTxn build(Environment env, IdaUinHashSaltRepo uinHashSaltRepo,
* @param env the env
* @return the string
*/
private String createId(String token, PropertyResolver env) {
String currentDate = DateUtils.formatDate(new Date(),
env.getProperty(IdAuthConfigKeyConstants.DATE_TIME_PATTERN));
String tokenAndDate = token + "-" + currentDate;
return UUIDUtils.getUUID(UUIDUtils.NAMESPACE_OID, tokenAndDate).toString();
private String createId() {
return UUID.randomUUID().toString();
}

/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@

import com.fasterxml.jackson.databind.exc.InvalidFormatException;

import io.mosip.authentication.common.service.util.IdaRequestResponsConsumerUtil;
import io.mosip.authentication.core.authtype.dto.AuthtypeResponseDto;
import io.mosip.authentication.core.autntxn.dto.AutnTxnResponseDto;
import io.mosip.authentication.core.constant.IdAuthCommonConstants;
import io.mosip.authentication.core.constant.IdAuthenticationErrorConstants;
import io.mosip.authentication.core.dto.ObjectWithIdVersionTransactionID;
import io.mosip.authentication.core.dto.ObjectWithMetadata;
import io.mosip.authentication.core.exception.IDAuthenticationUnknownException;
import io.mosip.authentication.core.exception.IDDataValidationException;
Expand Down Expand Up @@ -208,6 +210,11 @@ protected ResponseEntity<Object> handleIdAppException(IdAuthenticationBaseExcept
* @return Object .
*/
public static Object buildExceptionResponse(Exception ex, HttpServletRequest request) {
List<AuthError> errors = getAuthErrors(ex);
return buildExceptionResponse(ex, request, errors);
}

public static Object buildExceptionResponse(Exception ex, HttpServletRequest request, List<AuthError> errors) {
mosipLogger.debug(IdAuthCommonConstants.SESSION_ID, "Building exception response",
"Entered buildExceptionResponse", PREFIX_HANDLING_EXCEPTION + ex.getClass().toString());
String type = null;
Expand All @@ -218,16 +225,33 @@ public static Object buildExceptionResponse(Exception ex, HttpServletRequest req
String reqUrl = (request).getRequestURL().toString();
type = fetchInternalAuthtype(reqUrl);
}
List<AuthError> errors = getAuthErrors(ex);
if (errors != null && !errors.isEmpty()) {
Object response = frameErrorResponse(requestReceived, type, errors);
if(ex instanceof ObjectWithMetadata && response instanceof ObjectWithMetadata) {
//Try copying ID, version and transaction ID from request metadata
if(request instanceof ObjectWithMetadata && response instanceof ObjectWithIdVersionTransactionID) {
ObjectWithMetadata requestWithMetadata = (ObjectWithMetadata) request;
ObjectWithIdVersionTransactionID responsWithMetadata = (ObjectWithIdVersionTransactionID) response;
if(requestWithMetadata.getMetadata() != null) {
IdaRequestResponsConsumerUtil.setIdVersionToResponse(requestWithMetadata, responsWithMetadata);
IdaRequestResponsConsumerUtil.setTransactionIdToResponse(requestWithMetadata, responsWithMetadata);
}
}

//Try copying ID, version and transaction ID from exception metadata
if(ex instanceof ObjectWithMetadata && response instanceof ObjectWithIdVersionTransactionID) {
ObjectWithMetadata exceptionWithMetadata = (ObjectWithMetadata) ex;
ObjectWithMetadata responsWithMetadata = (ObjectWithMetadata) response;
ObjectWithIdVersionTransactionID responsWithMetadata = (ObjectWithIdVersionTransactionID) response;
if(exceptionWithMetadata.getMetadata() != null) {
exceptionWithMetadata.copyAllMetadaTo(responsWithMetadata);
IdaRequestResponsConsumerUtil.setIdVersionToResponse(exceptionWithMetadata, responsWithMetadata);
IdaRequestResponsConsumerUtil.setTransactionIdToResponse(exceptionWithMetadata, responsWithMetadata);
}
}

if(ex instanceof ObjectWithMetadata) {
ObjectWithMetadata exceptionWithMetadata = (ObjectWithMetadata) ex;
//This errors list is used some times by the caller for storing in auth transaction
exceptionWithMetadata.putMetadata(IdAuthCommonConstants.ERRORS, errors);
}
mosipLogger.debug(IdAuthCommonConstants.SESSION_ID, "Response", ex.getClass().getName(),
response.toString());
return response;
Expand Down Expand Up @@ -337,10 +361,8 @@ private static Object frameErrorResponse(String requestReceived, String type, Li
switch (requestReceived) {
case "kyc":
KycAuthResponseDTO kycAuthResponseDTO = new KycAuthResponseDTO();
//KycResponseDTO kycResponseDTO = new KycResponseDTO();
kycAuthResponseDTO.setErrors(errors);
kycAuthResponseDTO.setResponseTime(responseTime);
//kycAuthResponseDTO.setResponse(kycResponseDTO);
return kycAuthResponseDTO;
case "otp":
OtpResponseDTO otpResponseDTO = new OtpResponseDTO();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@

import io.mosip.authentication.common.service.builder.AuthResponseBuilder;
import io.mosip.authentication.common.service.builder.AuthTransactionBuilder;
import io.mosip.authentication.common.service.builder.MatchInputBuilder;
import io.mosip.authentication.common.service.entity.AutnTxn;
import io.mosip.authentication.common.service.helper.AuditHelper;
import io.mosip.authentication.common.service.helper.AuthTransactionHelper;
import io.mosip.authentication.common.service.helper.IdInfoHelper;
import io.mosip.authentication.common.service.integration.TokenIdManager;
import io.mosip.authentication.common.service.transaction.manager.IdAuthSecurityManager;
import io.mosip.authentication.common.service.util.AuthTypeUtil;
import io.mosip.authentication.common.service.util.IdaRequestResponsConsumerUtil;
import io.mosip.authentication.common.service.validator.AuthFiltersValidator;
import io.mosip.authentication.core.constant.AuditEvents;
import io.mosip.authentication.core.constant.AuditModules;
Expand Down Expand Up @@ -125,11 +125,8 @@ public class AuthFacadeImpl implements AuthFacade {
private AuthFiltersValidator authFiltersValidator;

@Autowired
public MatchInputBuilder matchInputBuilder;
private IdInfoHelper idInfoHelper;

@Autowired
public IdInfoHelper idInfoHelper;

/*
* (non-Javadoc)
*
Expand All @@ -139,7 +136,7 @@ public class AuthFacadeImpl implements AuthFacade {
*/
@Override
public AuthResponseDTO authenticateIndividual(AuthRequestDTO authRequestDTO, boolean isAuth, String partnerId,
String partnerApiKey, boolean markVidConsumed) throws IdAuthenticationBusinessException {
String partnerApiKey, boolean markVidConsumed, ObjectWithMetadata requestWrapperMetadata) throws IdAuthenticationBusinessException {

String idvid = authRequestDTO.getIndividualId();
String idvIdType = IdType.getIDTypeStrOrDefault(authRequestDTO.getIndividualIdType());
Expand Down Expand Up @@ -177,11 +174,10 @@ public AuthResponseDTO authenticateIndividual(AuthRequestDTO authRequestDTO, boo
.get(AuthTransactionBuilder.class.getSimpleName());
authTxnBuilder.withToken(token);

ObjectWithMetadata objectWithMetadata = null;

String transactionID = authRequestDTO.getTransactionID();
try {
idInfo = IdInfoFetcher.getIdInfo(idResDTO);
authResponseBuilder.setTxnID(authRequestDTO.getTransactionID());
authResponseBuilder.setTxnID(transactionID);
authTokenId = authTokenRequired && isAuth ? getToken(authRequestDTO, partnerId, partnerApiKey, idvid, token)
: null;

Expand All @@ -193,31 +189,32 @@ public AuthResponseDTO authenticateIndividual(AuthRequestDTO authRequestDTO, boo
partnerId, authTxnBuilder);
authStatusList.stream().filter(Objects::nonNull).forEach(authResponseBuilder::addAuthStatusInfo);
} catch (IdAuthenticationBusinessException e) {
objectWithMetadata = e;
throw e;
} finally {
// Set response token
if (authTokenRequired) {
authResponseDTO = authResponseBuilder.build(authTokenId);
authResponseDTO = authResponseBuilder.build(authTokenId, authRequestDTO.getRequestTime());
} else {
authResponseDTO = authResponseBuilder.build(null);
authResponseDTO = authResponseBuilder.build(null, authRequestDTO.getRequestTime());
}

if (objectWithMetadata == null) {
// In catch block this is assigned with exception, if null, assign with response
// DTO
objectWithMetadata = authResponseDTO;

IdaRequestResponsConsumerUtil.setIdVersionToResponse(requestWrapperMetadata, authResponseDTO);
if(authResponseDTO.getTransactionID() == null && transactionID != null) {
authResponseDTO.setTransactionID(transactionID);
}

authTxnBuilder.withStatus(authResponseDTO.getResponse().isAuthStatus());
boolean authStatus = authResponseDTO.getResponse().isAuthStatus();
authTxnBuilder.withStatus(authStatus);
authTxnBuilder.withAuthToken(authTokenId);

// This is sent back for the consumption by the caller for example
// KYCFacadeImpl. Whole metadata will be removed at the end by filter.
objectWithMetadata.putMetadata(IdAuthCommonConstants.IDENTITY_DATA, idResDTO);
objectWithMetadata.putMetadata(IdAuthCommonConstants.IDENTITY_INFO, idInfo);
// KYCFacadeImpl, Base IDA Filter.
requestWrapperMetadata.putMetadata(IdAuthCommonConstants.IDENTITY_DATA, idResDTO);
requestWrapperMetadata.putMetadata(IdAuthCommonConstants.IDENTITY_INFO, idInfo);
requestWrapperMetadata.putMetadata(IdAuthCommonConstants.STATUS, authStatus);
requestWrapperMetadata.putMetadata(IdAuthCommonConstants.ERRORS, authResponseDTO.getErrors());

authTransactionHelper.setAuthTransactionEntityMetadata(objectWithMetadata, authTxnBuilder);
authTransactionHelper.setAuthTransactionEntityMetadata(requestWrapperMetadata, authTxnBuilder);

logger.info(IdAuthCommonConstants.SESSION_ID, env.getProperty(IdAuthConfigKeyConstants.APPLICATION_ID),
AUTH_FACADE, "authenticateApplicant status : " + authResponseDTO.getResponse().isAuthStatus());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,32 +237,6 @@ protected Map<String, Object> decipherRequest(Map<String, Object> requestBody) t
return requestBody;
}

/**
* encipherResponse method is used to encoded and encrypt the response received
* while returning the KYC response.
*
* @param responseBody the response received after authentication
* @return the map the final encoded and enciphered response
* @throws IdAuthenticationAppException the id authentication app exception
*/
protected Map<String, Object> encipherResponse(Map<String, Object> responseBody)
throws IdAuthenticationAppException {
return responseBody;
}

/*
* (non-Javadoc)
*
* @see
* io.mosip.authentication.service.filter.BaseIDAFilter#transformResponse(java.
* util.Map)
*/
@Override
protected Map<String, Object> transformResponse(Map<String, Object> responseMap)
throws IdAuthenticationAppException {
return encipherResponse(responseMap);
}

/**
* validateRequestHMAC method is used to validate the HMAC of the request with
* the deciphered request block and requestHMAC received in the request body.
Expand Down
Loading

0 comments on commit 6bfdabd

Please sign in to comment.