Skip to content

Commit

Permalink
Merge pull request #1232 from Sohandey/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Sohandey authored Dec 4, 2023
2 parents 0846bcd + 9e51f05 commit f155649
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public class AdminTestUtil extends BaseTestCase {
public static final String AUTHORIZATHION_HEADERNAME = GlobalConstants.AUTHORIZATION;
public static final String AUTH_HEADER_VALUE = "Some String";
public static final String SIGNATURE_HEADERNAME = GlobalConstants.SIGNATURE;
public static String updatedPolicyId="";
public static BioDataUtility bioDataUtil = new BioDataUtility();

public static BioDataUtility getBioDataUtil() {
Expand Down Expand Up @@ -5502,12 +5503,12 @@ public static void createEditAndPublishPolicy() {
Response response = RestClient.postRequestWithCookie(url, actualrequestBody, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_JSON, GlobalConstants.AUTHORIZATION, token);
String responseBody = response.getBody().asString();
String policyId = new org.json.JSONObject(responseBody).getJSONObject(GlobalConstants.RESPONSE).getString("id");
updatedPolicyId = new org.json.JSONObject(responseBody).getJSONObject(GlobalConstants.RESPONSE).getString("id");

String url3 = ApplnURI + properties.getProperty("publishPolicyurl");

if (url3.contains("POLICYID")) {
url3 = url3.replace("POLICYID", policyId);
url3 = url3.replace("POLICYID", updatedPolicyId);
url3 = url3.replace("POLICYGROUPID", policygroupId);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class KeyCloakUserAndAPIKeyGeneration extends AdminTestUtil {
private static final Logger lOGGER = Logger.getLogger(KeyCloakUserAndAPIKeyGeneration.class);

static String partnerId = PartnerRegistration.partnerId;
static String updatedPolicyId =AdminTestUtil.updatedPolicyId;
static String emailId = PartnerRegistration.emailId;
static String emailIdForKyc = PartnerRegistration.emailIdForKyc;
static String role = PartnerRegistration.partnerType;
Expand Down Expand Up @@ -206,8 +207,11 @@ public static String createAPIKey(){
return apiKey;
}
public static String createAPIKeyForUpdatedPolicy(){
String url = ApplnURI + "/v1/partnermanager/partners/"+partnerId+"/generate/apikey";

String url = ApplnURI + "/v1/partnermanager/partners/" + partnerId + "/generate/apikey";

String updateApiKeyUrl = ApplnURI + "/v1/partnermanager/partners/" + partnerId + "/policy/" + updatedPolicyId
+ "/apiKey/status";

String token = kernelAuthLib.getTokenByRole("partnernew");


Expand All @@ -216,6 +220,8 @@ public static String createAPIKeyForUpdatedPolicy(){
requestBody.put("policyName", policyNameForUpdate);
requestBody.put("label", randomAbbreviation);



HashMap<String, Object> body = new HashMap<>();

body.put("id", GlobalConstants.STRING);
Expand All @@ -233,6 +239,25 @@ public static String createAPIKeyForUpdatedPolicy(){
String apiKey = responseValue.getString(GlobalConstants.APIKEY);
lOGGER.info(apiKey);

//UpdatedApiKey Call

HashMap<String, String> updatedRequestBody = new HashMap<>();
HashMap<String, Object> updatedRBody = new HashMap<>();

updatedRequestBody.put("label", randomAbbreviation);
updatedRequestBody.put("status", "Active");

updatedRBody.put("id", GlobalConstants.STRING);
updatedRBody.put(GlobalConstants.METADATA, new HashMap<>());
updatedRBody.put(GlobalConstants.REQUEST, updatedRequestBody);
updatedRBody.put(GlobalConstants.REQUESTTIME, generateCurrentUTCTimeStamp());
updatedRBody.put(GlobalConstants.VERSION, GlobalConstants.STRING);


Response updatedResponse = RestClient.patchRequestWithCookie(url, updatedRBody, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_JSON, GlobalConstants.AUTHORIZATION, token);
lOGGER.info(updatedResponse.asString());

return apiKey;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"requestTime": "{{requestTime}}",
"request": {
"identifier": "{{identifier}}",
"challengeInfo": {
"challenge": "{{challenge}}",
"format": "{{format}}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ChallengeVerfication:
Esignet_ChallengeVerfication_withValidParameters_smoke_Pos:
endPoint: /v1/signup/registration/verify-challenge
role: resident
restMethod: post
inputTemplate: esignetSignup/ChallengeVerfication/challengeVerfication
outputTemplate: esignetSignup/ChallengeVerfication/challengeVerficationResult
input: '{
"identifier": "+85534567890",
"challenge": "111111",
"format": "alpha-numeric",
"requesttime": "$TIMESTAMP$",
"sendOtp":{
"identifier": "+85534567890",
"captchaToken": "",
"requesttime": "$TIMESTAMP$"
"sendOtpReqTemplate": "esignetSignup/GenerateChallenge/generateChallenge",
"sendOtpEndPoint": "/v1/signup/registration/verify-challenge"
}
}'
output: '{
"status":"SUCCESS"
}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"response": {
"status": "{{status}}"
},
"errors": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"requestTime": "{{requestTime}}",
"request": {
"identifier": "{{identifier}}",
"captchaToken": "{{captchaToken}}"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
GenerateChallenge:
Esignet_GenerateChallenge_withValidParameters_smoke_Pos:
endPoint: /v1/signup/registration/verify-challenge
role: resident
restMethod: post
inputTemplate: esignet/GenerateChallenge/generateChallenge
outputTemplate: esignet/AddIdentity/generateChallengeResult
input: '{
"identifier": "+85534567890",
"captchaToken": "",
"requesttime": "$TIMESTAMP$"
}'
output: '{
"status":"SUCCESS"
}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"response": {
"status": "{{status}}"
},
"errors": []
}
68 changes: 67 additions & 1 deletion automationtests/src/main/resources/ida/BioAuth/BioAuth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ BioAuth:
role: resident
restMethod: post
inputTemplate: ida/BioAuth/BioAuth
outputTemplate: ida/BioAuth/BioAuthResult
outputTemplate: ida/BioAuth/error
input: '{
"bioSubType": "Right",
"bioType": "Iris",
Expand All @@ -1683,4 +1683,70 @@ BioAuth:
}'
output: '{
"authStatus": "true"
}'
auth_BioAuth_Biometric_Face_With_InValid_timestamp:
endPoint: /v1/identity/authenticate?moduleName=$MODULENAME$&certsDir=$CERTSDIR$&id=$ID:AddIdentity_Lock_UIN_Unlock_BioAuth_withValidParameters_smoke_Pos_UIN$&partnerUrlSuffix=$PartnerKeyURL$&keyFileNameByPartnerName=true&partnerName=$PartnerName$
role: resident
restMethod: post
inputTemplate: ida/BioAuth/BioAuth
outputTemplate: ida/BioAuth/error
input: '{
"bioSubType": "",
"bioType": "FACE",
"bioValue": "$FACE$",
"deviceCode": "bc0b6848-6d45-46d1-a9bd-b334410bf823",
"dateTime": "$DATETIME$",
"deviceProviderID": "1873299273",
"deviceServiceID": "",
"deviceServiceVersion": "SB.WIN.001",
"deviceProvider": "SYNCBYTE",
"deviceProviderId": "SYNCBYTE.LTC165",
"deviceSubType": "Single",
"make": "Logitech",
"model": "4d36e96c-e325-11ce-bfc1-08002be10318",
"serialNo": "78467171",
"type": "Face",
"transactionId": "$TRANSACTIONID$",
"timestamp": "53637sgsgsfv"
}'
output: '{
"errors": [
{
"errorCode": "$IGNORE$"
}
],
"authStatus": false
}'
auth_BioAuth_Biometric_Face_With_InValid_DATETIME:
endPoint: /v1/identity/authenticate?moduleName=$MODULENAME$&certsDir=$CERTSDIR$&id=$ID:AddIdentity_Lock_UIN_Unlock_BioAuth_withValidParameters_smoke_Pos_UIN$&partnerUrlSuffix=$PartnerKeyURL$&keyFileNameByPartnerName=true&partnerName=$PartnerName$
role: resident
restMethod: post
inputTemplate: ida/BioAuth/BioAuth
outputTemplate: ida/BioAuth/error
input: '{
"bioSubType": "",
"bioType": "FACE",
"bioValue": "$FACE$",
"deviceCode": "bc0b6848-6d45-46d1-a9bd-b334410bf823",
"dateTime": "$1526264$",
"deviceProviderID": "1873299273",
"deviceServiceID": "",
"deviceServiceVersion": "SB.WIN.001",
"deviceProvider": "SYNCBYTE",
"deviceProviderId": "SYNCBYTE.LTC165",
"deviceSubType": "Single",
"make": "Logitech",
"model": "4d36e96c-e325-11ce-bfc1-08002be10318",
"serialNo": "78467171",
"type": "Face",
"transactionId": "$TRANSACTIONID$",
"timestamp": "$TIMESTAMP$"
}'
output: '{
"errors": [
{
"errorCode": "$IGNORE$"
}
],
"authStatus": false
}'
58 changes: 58 additions & 0 deletions automationtests/src/main/resources/ida/EkycBio/EkycBio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1428,4 +1428,62 @@ EkycBio:
}'
output: '{
"kycStatus": "false"
}'
auth_EkycBio_Face_With_InValid_timestamp:
endPoint: /v1/identity/authenticate?moduleName=$MODULENAME$&certsDir=$CERTSDIR$&transactionId=$TRANSACTIONID$&id=$ID:AddIdentity_Positive_EKYC_smoke_UIN$&isKyc=true&partnerUrlSuffix=$KycPartnerKeyURL$&keyFileNameByPartnerName=true&partnerName=$KycPartnerName$
role: resident
kycFields: ["gender"]
restMethod: post
inputTemplate: ida/EkycBio/EkycBio
outputTemplate: ida/EkycBio/error
input: '{
"bioSubType": "",
"bioType": "FACE",
"bioValue": "$FACE$",
"deviceCode": "bc0b6848-6d45-46d1-a9bd-b334410bf823",
"dateTime": "$DATETIME$",
"deviceProviderID": "1873299273",
"deviceServiceID": "",
"deviceServiceVersion": "SB.WIN.001",
"deviceProvider": "SYNCBYTE",
"deviceProviderId": "SYNCBYTE.LTC165",
"deviceSubType": "Single",
"make": "Logitech",
"model": "4d36e96c-e325-11ce-bfc1-08002be10318",
"serialNo": "78467171",
"type": "Face",
"transactionId": "$TRANSACTIONID$",
"timestamp": "2827@3637"
}'
output: '{
"kycStatus": "false"
}'
auth_EkycBio_Face_With_InValid_DATETIME:
endPoint: /v1/identity/authenticate?moduleName=$MODULENAME$&certsDir=$CERTSDIR$&transactionId=$TRANSACTIONID$&id=$ID:AddIdentity_Positive_EKYC_smoke_UIN$&isKyc=true&partnerUrlSuffix=$KycPartnerKeyURL$&keyFileNameByPartnerName=true&partnerName=$KycPartnerName$
role: resident
kycFields: ["gender"]
restMethod: post
inputTemplate: ida/EkycBio/EkycBio
outputTemplate: ida/EkycBio/error
input: '{
"bioSubType": "",
"bioType": "FACE",
"bioValue": "$FACE$",
"deviceCode": "bc0b6848-6d45-46d1-a9bd-b334410bf823",
"dateTime": "22/02/2887262",
"deviceProviderID": "1873299273",
"deviceServiceID": "",
"deviceServiceVersion": "SB.WIN.001",
"deviceProvider": "SYNCBYTE",
"deviceProviderId": "SYNCBYTE.LTC165",
"deviceSubType": "Single",
"make": "Logitech",
"model": "4d36e96c-e325-11ce-bfc1-08002be10318",
"serialNo": "78467171",
"type": "Face",
"transactionId": "$TRANSACTIONID$",
"timestamp": "$TIMESTAMP$"
}'
output: '{
"kycStatus": "false"
}'

0 comments on commit f155649

Please sign in to comment.