Skip to content

Commit

Permalink
Merge pull request #1142 from nandhu-kumar/develop
Browse files Browse the repository at this point in the history
MOSIP-29715
  • Loading branch information
Sohandey authored Oct 16, 2023
2 parents a18600b + 9ad42c3 commit e125c0e
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,64 @@ GenerateTokenVCIVidNegTC:
}'
output: '{
"error": "pkce_failed"
}'

ESignet_GenerateTokenVCI_Vid_NegCredScen1_Smoke_sid:
endPoint: /v1/esignet/oauth/v2/token
role: resident
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/VCIVidNegTC/GenerateTokenVCI/GenerateTokenVCI
outputTemplate: esignet/VCIVidNegTC/GenerateTokenVCI/GenerateTokenVCIResult
input: '{
"grant_type": "authorization_code",
"code": "$ID:AuthorizationCode_VCI_Vid_NegCredScen1_Valid_Smoke_sid_code$",
"client_id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$",
"client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
"client_assertion": "$CLIENT_ASSERTION_JWK$",
"redirect_uri": "$IDPREDIRECTURI$",
"code_verifier": "$CODEVERIFIER$"
}'
output: '{
"token_type": "Bearer"
}'

ESignet_GenerateTokenVCI_Vid_NegCredScen2_Smoke_sid:
endPoint: /v1/esignet/oauth/v2/token
role: resident
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/VCIVidNegTC/GenerateTokenVCI/GenerateTokenVCI
outputTemplate: esignet/VCIVidNegTC/GenerateTokenVCI/GenerateTokenVCIResult
input: '{
"grant_type": "authorization_code",
"code": "$ID:AuthorizationCode_VCI_Vid_NegCredScen2_Valid_Smoke_sid_code$",
"client_id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$",
"client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
"client_assertion": "$CLIENT_ASSERTION_JWK$",
"redirect_uri": "$IDPREDIRECTURI$",
"code_verifier": "$CODEVERIFIER$"
}'
output: '{
"token_type": "Bearer"
}'

ESignet_GenerateTokenVCI_Vid_NegCredScen3_Smoke_sid:
endPoint: /v1/esignet/oauth/v2/token
role: resident
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/VCIVidNegTC/GenerateTokenVCI/GenerateTokenVCI
outputTemplate: esignet/VCIVidNegTC/GenerateTokenVCI/GenerateTokenVCIResult
input: '{
"grant_type": "authorization_code",
"code": "$ID:AuthorizationCode_VCI_Vid_NegCredScen3_Valid_Smoke_sid_code$",
"client_id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$",
"client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
"client_assertion": "$CLIENT_ASSERTION_JWK$",
"redirect_uri": "$IDPREDIRECTURI$",
"code_verifier": "$CODEVERIFIER$"
}'
output: '{
"token_type": "Bearer"
}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
GetCredentialVidNegTC:
ESignet_GetCredential_Vid_IdpAccessToken_NegCredScen1_Invalid_Format_Neg:
endPoint: /v1/esignet/vci/credential
role: resident
checkErrorsOnlyInResponse: true
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/VCIVidNegTC/GetCredential/GetCredential
outputTemplate: esignet/error2
input: '{
"client_id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$",
"idpAccessToken": "$ID:GenerateTokenVCI_Vid_NegCredScen1_Smoke_sid_access_token$",
"format": "dfsfd",
"type": [{types: "VerifiableCredential"}, {types: "MOSIPVerifiableCredential"}],
"@context": [{context: "$VCICONTEXTURL$"}],
"proof_type": "jwt",
"proof_jwt": "$PROOFJWT$"
}'
output: '{
"error":"unsupported_credential_format"
}'

ESignet_GetCredential_Vid_IdpAccessToken_NegCredScen2_Invalid_Proof_Neg:
endPoint: /v1/esignet/vci/credential
role: resident
checkErrorsOnlyInResponse: true
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/VCIVidNegTC/GetCredential/GetCredential
outputTemplate: esignet/error2
input: '{
"client_id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$",
"idpAccessToken": "$ID:GenerateTokenVCI_Vid_NegCredScen2_Smoke_sid_access_token$",
"format": "ldp_vc",
"type": [{types: "VerifiableCredential"}, {types: "MOSIPVerifiableCredential"}],
"@context": [{context: "$VCICONTEXTURL$"}],
"proof_type": "jwt",
"proof_jwt": "wewrt"
}'
output: '{
"error":"invalid_proof"
}'

ESignet_GetCredential_Vid_IdpAccessToken_Missing_Format_Neg:
endPoint: /v1/esignet/vci/credential
role: resident
checkErrorsOnlyInResponse: true
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/VCIVidNegTC/GetCredential/GetCredential
outputTemplate: esignet/error2
input: '{
"client_id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$",
"idpAccessToken": "$ID:GenerateTokenVCI_Vid_NegCredScen3_Smoke_sid_access_token$",
"format": "$REMOVE$",
"type": [{types: "VerifiableCredential"}, {types: "MOSIPVerifiableCredential"}],
"@context": [{context: "$VCICONTEXTURL$"}],
"proof_type": "jwt",
"proof_jwt": "$PROOFJWT$"
}'
output: '{
"error": "invalid_vc_format"
}'
14 changes: 7 additions & 7 deletions automationtests/testNgXmlFiles/esignetSuite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,13 @@
<class name="io.mosip.testrig.apirig.testscripts.SimplePostForAutoGenIdForUrlEncoded" />
</classes>
</test>
<test name="GetCredentialVidNegTC">
<parameter name="ymlFile"
value="esignet/VCIVidNegTC/GetCredential/GetCredential.yml" />
<classes>
<class name="io.mosip.testrig.apirig.testscripts.SimplePost" />
</classes>
</test>
<test name="WellKnownVCI">
<parameter name="ymlFile"
value="esignet/VCI/WellKnownVCI/WellKnownVCI.yml" />
Expand Down Expand Up @@ -611,13 +618,6 @@
<class name="io.mosip.testrig.apirig.testscripts.KycAuth" />
</classes>
</test>
<test name="GetCredentialVidNegTC">
<parameter name="ymlFile"
value="esignet/VCIVidNegTC/GetCredential/GetCredential.yml" />
<classes>
<class name="io.mosip.testrig.apirig.testscripts.SimplePost" />
</classes>
</test>
<test name="LinkedSendOtp">
<parameter name="ymlFile"
value="esignet/LinkedSendOtp/LinkedSendOtp.yml" />
Expand Down

0 comments on commit e125c0e

Please sign in to comment.