Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-34827 - Added test cases for L2 flow api's & MOSIP-36488 - Fixed bioAuth failure #954

Merged
merged 5 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad

JSONObject encryptedIdentityReqObject = new JSONObject(encryptedIdentityReq);

JSONObject objIdentityRequest = encryptedIdentityReqObject.getJSONObject(GlobalConstants.IDENTITYREQUEST);
logger.info(objIdentityRequest);
JSONArray arrayBiometrics = objIdentityRequest.getJSONArray(GlobalConstants.BIOMETRICS);
logger.info(encryptedIdentityReqObject);
JSONArray arrayBiometrics = encryptedIdentityReqObject.getJSONArray(GlobalConstants.BIOMETRICS);

String bioData = arrayBiometrics.toString();
logger.info(bioData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,15 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
testCaseDTO.setEndPoint(testCaseDTO.getEndPoint().replace("$SUNBIRDBASEURL$", ""));
}

response = getWithPathParamAndCookie(tempUrl + testCaseDTO.getEndPoint(),
getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()), COOKIENAME,
testCaseDTO.getRole(), testCaseDTO.getTestCaseName());
if (testCaseName.contains("_AuthToken_Xsrf_")) {
response = getRequestWithCookieAuthHeaderAndXsrfToken(tempUrl + testCaseDTO.getEndPoint(),
getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()), COOKIENAME,
testCaseDTO.getRole(), testCaseDTO.getTestCaseName());
} else {
response = getWithPathParamAndCookie(tempUrl + testCaseDTO.getEndPoint(),
getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()), COOKIENAME,
testCaseDTO.getRole(), testCaseDTO.getTestCaseName());
}
} else {
response = getWithPathParamAndCookie(ApplnURI + testCaseDTO.getEndPoint(),
getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()), auditLogCheck,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void test(TestCaseDTO testCaseDTO)
//tempUrl = ApplnURI.replace(GlobalConstants.API_INTERNAL, ConfigManager.getSunBirdBaseURL());
testCaseDTO.setEndPoint(testCaseDTO.getEndPoint().replace("$SUNBIRDBASEURL$", ""));
}
if (testCaseName.contains("_AuthorizationCode_")) {
if ((testCaseName.contains("_AuthorizationCode_")) || (testCaseName.contains("_AuthToken_Xsrf_"))) {
response = postRequestWithCookieAuthHeaderAndXsrfTokenForAutoGenId(
tempUrl + testCaseDTO.getEndPoint(), inputJson, COOKIENAME, testCaseDTO.getTestCaseName(),
idKeyName);
Expand Down
27 changes: 27 additions & 0 deletions api-test/src/main/resources/esignet/AddIdentity/AddIdentity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,31 @@ AddIdentity:
}'
output: '{
"status":"ACTIVATED"
}'

ESignet_AddIdentity_L2_Valid_Parameters_smoke_Pos:
endPoint: /idrepository/v1/identity/
role: idrepo
restMethod: post
inputTemplate: esignet/AddIdentity/addIdentity_$LANGNUMBER$
outputTemplate: esignet/AddIdentity/addIdentityResult
input: '{
"value": "$BIOVALUE$",
"id": "mosip.id.create",
"registrationId": "$RID$",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
"referenceIdentityNumber": "6789545678878",
"version": "v1",
"introducerRID": "212124324784879",
"introducerUIN": "212124324784879",
"category": "individualBiometrics",
"requesttime": "$TIMESTAMP$"
}'
output: '{
"status":"ACTIVATED"
}'
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"identityRequest": {
"biometrics": [
{
"data": {
Expand Down Expand Up @@ -35,5 +34,4 @@
],
"timestamp": "$DATETIME$",
"transactionID": "{{transactionId}}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,28 @@ OAuthDetailsRequestV3:
}'
output: '{

}'

ESignet_OAuthDetailsRequest_V3_WithClaimValues_AuthToken_Xsrf_uin_all_Valid_Smoke_sid:
endPoint: /v1/esignet/authorization/v3/oauth-details
role: resident
restMethod: post
checkErrorsOnlyInResponse: true
inputTemplate: esignet/OAuthDetailsRequestV3/OAuthDetailsWithClaimValueRequest
input: '{
"requestTime": "$TIMESTAMP$",
"clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY",
"scope": "openid profile",
"responseType": "code",
"redirectUri": "$IDPREDIRECTURI$",
"display": "popup",
"prompt": "login",
"acrValues": "mosip:idp:acr:generated-code",
"nonce": "973eieljzng",
"state": "urlInfo1724138417665",
"claimsLocales": "en",
"uiLocales": "en-US"
}'
output: '{

}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"requestTime": "{{requestTime}}",
"request": {
"clientId": "{{clientId}}",
"scope": "{{scope}}",
"responseType": "{{responseType}}",
"redirectUri": "{{redirectUri}}",
"display": "{{display}}",
"prompt": "{{prompt}}",
"acrValues": "{{acrValues}}",
"claims": {
"userinfo": {
"name": {
"essential": false
},
"phone_number": {
"essential": true
},
"verified_claims": [
{
"verification": {
"trust_framework": {
"value": ["de_aml", "jp_aml"]
},
"assurance-level": {
"value": "high"
},
"time": {
"max_age": 63113852
},
"evidence": [
{"type": { "value": "document" }},
{"method": { "value": "test" }}
]
},
"claims": {
"given_name": {
"value":["automation", "test"],
"purpose":"Name given by user",
"essential": true
},
"name": {
"value": "automation",
"values":["ab","cd"]
},
"phone_number": {
"value": "1234567890"
},
"email": {
"essential": true
}
}
}
]
},
"id_token": {}
},
"nonce" : "{{nonce}}",
"state" : "{{state}}",
"claimsLocales" : "{{claimsLocales}}",
"uiLocales" : "{{uiLocales}}"
}
}
8 changes: 4 additions & 4 deletions api-test/testNgXmlFiles/esignetSuite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@
</test> -->

<!-- Start of Sign up L2 phase test cases -->
<!-- <test name="OAuthDetailsRequestV3">
<test name="OAuthDetailsRequestV3">
<parameter name="ymlFile"
value="esignet/OAuthDetailsRequestV3/OAuthDetailsRequest.yml" />
<parameter name="idKeyName" value="transactionId,encodedResp" />
Expand Down Expand Up @@ -1083,13 +1083,13 @@
<class name="io.mosip.testrig.apirig.testscripts.SimplePost" />
</classes>
</test>
<test name="PrepareSignupRedirectNeg">
<test name="PrepareSignupRedirectNeg">
<parameter name="ymlFile"
value="esignet/PrepareSignupRedirectNeg/PrepareSignupRedirectNeg.yml" />
<parameter name="idKeyName" value="idToken" />
<classes>
<class name="io.mosip.testrig.apirig.testscripts.SimplePostForAutoGenId" />
</classes>
</test>-->
</test>
<!-- End of Sign up L2 phase test cases -->
</suite>
</suite>
Loading