diff --git a/src/main/resources/REST/json/Credential.json b/src/main/resources/REST/json/Credential.json index 2ebfe51b8e88194df9fdd31a45cc239f9ec66dec..750589c7cdcdff0e27b48c706114507dfff7a053 100644 --- a/src/main/resources/REST/json/Credential.json +++ b/src/main/resources/REST/json/Credential.json @@ -2,26 +2,78 @@ "for_proof":{ "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://w3id.org/security/suites/jws-2020/v1" + "https://www.w3.org/2018/credentials/examples/v1", + "https://www.schema.org" ], - "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", - "type": "VerifiablePresentation", - "verifiableCredential": [ - { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://w3id.org/security/suites/jws-2020/v1", - "https://schema.org" - ], - "credentialSubject": { - "allow": true, - "id": "https://gaiax.vereign.com/tsa/policy/example/examplePolicy/1.0" - }, - "issuanceDate": "2022-07-01T11:07:57.975459274Z", - "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", - "type": "VerifiableCredential" + "id": "http://example.edu/credentials/3732", + "type": ["VerifiableCredential", "UniversityDegreeCredential"], + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "issuanceDate": "2010-01-01T00:00:00Z", + "credentialSubject": { + "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "allow": true, + "num": 123, + "array": { + "txt1": "1", + "txt2": "2" } - ] + } + }, + "for_proof_alumni": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1" + ], + "id": "http://example.edu/credentials/3732", + "type": ["VerifiableCredential", "UniversityDegreeCredential"], + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "issuanceDate": "2010-01-01T00:00:00Z", + "credentialSubject": { + "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", + "degree": { + "type": "BachelorDegree", + "name": "Bachelor of Science and Arts" + } + } + }, + "for_proof_without_ID": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1", + "https://www.schema.org" + ], + "id": "http://example.edu/credentials/3732", + "type": ["VerifiableCredential", "UniversityDegreeCredential"], + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "issuanceDate": "2010-01-01T00:00:00Z", + "credentialSubject": { + "allow": true, + "num": 123, + "array": { + "txt1": "1", + "txt2": "2" + } + } + }, + "for_proof_incorrect_ID_space":{ + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1", + "https://www.schema.org" + ], + "id": "http://example.edu/credentials/3732", + "type": ["VerifiableCredential", "UniversityDegreeCredential"], + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "issuanceDate": "2010-01-01T00:00:00Z", + "credentialSubject": { + "id": " ", + "allow": true, + "num": 123, + "array": { + "txt1": "1", + "txt2": "2" + } + } }, "incorrect_id":{ "@context": [ @@ -46,5 +98,148 @@ "type": "VerifiableCredential" } ] + }, + "missing_proof": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1", + "https://www.schema.org" + ], + "credentialSubject": { + "allow": true, + "array": { + "txt1": "1", + "txt2": "2" + }, + "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "num": 123 + }, + "id": "http://example.edu/credentials/3732", + "issuanceDate": "2010-01-01T00:00:00Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": [ + "VerifiableCredential", + "UniversityDegreeCredential" + ] + }, + "modified_ID": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1", + "https://www.schema.org" + ], + "credentialSubject": { + "allow": true, + "array": { + "txt1": "1", + "txt2": "2" + }, + "id": "did:web:gaiax.XXXX.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "num": 123 + }, + "id": "http://example.edu/credentials/3732", + "issuanceDate": "2010-01-01T00:00:00Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "proof": { + "created": "2022-08-04T15:26:30.176376203Z", + "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIDq0c_zVTJeQbBLEPENCiJYQ1YTm4qI4mFVNhi_t5c1bAiABJacTO6fYXfNA4N0WqHhyEAl5F3BqwfPoc3R7iX2c9Q", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1" + }, + "type": [ + "VerifiableCredential", + "UniversityDegreeCredential" + ] + }, + "modified_issuanceDate": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1", + "https://www.schema.org" + ], + "credentialSubject": { + "allow": true, + "array": { + "txt1": "1", + "txt2": "2" + }, + "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "num": 123 + }, + "id": "http://example.edu/credentials/3732", + "issuanceDate": "2020-01-01T00:00:00Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "proof": { + "created": "2022-08-04T15:26:30.176376203Z", + "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIDq0c_zVTJeQbBLEPENCiJYQ1YTm4qI4mFVNhi_t5c1bAiABJacTO6fYXfNA4N0WqHhyEAl5F3BqwfPoc3R7iX2c9Q", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1" + }, + "type": [ + "VerifiableCredential", + "UniversityDegreeCredential" + ] + }, + "modified_credentialSubject_allow": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1", + "https://www.schema.org" + ], + "credentialSubject": { + "allow": false, + "array": { + "txt1": "1", + "txt2": "2" + }, + "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "num": 123 + }, + "id": "http://example.edu/credentials/3732", + "issuanceDate": "2010-01-01T00:00:00Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "proof": { + "created": "2022-08-04T15:26:30.176376203Z", + "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIDq0c_zVTJeQbBLEPENCiJYQ1YTm4qI4mFVNhi_t5c1bAiABJacTO6fYXfNA4N0WqHhyEAl5F3BqwfPoc3R7iX2c9Q", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1" + }, + "type": [ + "VerifiableCredential", + "UniversityDegreeCredential" + ] + }, + "modified_credentialSubject_array": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1", + "https://www.schema.org" + ], + "credentialSubject": { + "allow": true, + "array": { + "txt1": "I", + "txt2": "2" + }, + "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "num": 123 + }, + "id": "http://example.edu/credentials/3732", + "issuanceDate": "2010-01-01T00:00:00Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "proof": { + "created": "2022-08-04T15:26:30.176376203Z", + "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIDq0c_zVTJeQbBLEPENCiJYQ1YTm4qI4mFVNhi_t5c1bAiABJacTO6fYXfNA4N0WqHhyEAl5F3BqwfPoc3R7iX2c9Q", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1" + }, + "type": [ + "VerifiableCredential", + "UniversityDegreeCredential" + ] } } \ No newline at end of file diff --git a/src/main/resources/REST/json/Presentation.json b/src/main/resources/REST/json/Presentation.json index 1df59633e66c6165da11099295a626387191e58f..a5b7f26cb92e97c30359822d201c9291507e3856 100644 --- a/src/main/resources/REST/json/Presentation.json +++ b/src/main/resources/REST/json/Presentation.json @@ -69,7 +69,7 @@ } }] }, - "for_proof_missing_ID": { + "for_proof_without_ID": { "@context": [ "https://www.w3.org/2018/credentials/v1", "https://w3id.org/security/suites/jws-2020/v1" diff --git a/src/main/resources/REST/schemas/Signer_CredentialProof_alumni_schema.json b/src/main/resources/REST/schemas/Signer_CredentialProof_alumni_schema.json new file mode 100644 index 0000000000000000000000000000000000000000..41ed705ae098706a5ccdcb0316d95ec1f50cfb34 --- /dev/null +++ b/src/main/resources/REST/schemas/Signer_CredentialProof_alumni_schema.json @@ -0,0 +1,100 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "@context": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ] + }, + "credentialSubject": { + "type": "object", + "properties": { + "degree": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "name", + "type" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "degree", + "id" + ] + }, + "id": { + "type": "string" + }, + "issuanceDate": { + "type": "string" + }, + "issuer": { + "type": "string" + }, + "proof": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "jws": { + "type": "string" + }, + "proofPurpose": { + "type": "string" + }, + "type": { + "type": "string" + }, + "verificationMethod": { + "type": "string" + } + }, + "required": [ + "created", + "jws", + "proofPurpose", + "type", + "verificationMethod" + ] + }, + "type": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ] + } + }, + "required": [ + "@context", + "credentialSubject", + "id", + "issuanceDate", + "issuer", + "proof", + "type" + ] +} \ No newline at end of file diff --git a/src/main/resources/REST/schemas/Signer_CredentialProof_schema.json b/src/main/resources/REST/schemas/Signer_CredentialProof_schema.json index 23a7e9c24126cf981be9989e6739e5d00a00bdbc..f68169288579f91c30be5f8d6d083dedef22d186 100644 --- a/src/main/resources/REST/schemas/Signer_CredentialProof_schema.json +++ b/src/main/resources/REST/schemas/Signer_CredentialProof_schema.json @@ -8,17 +8,55 @@ { "type": "string" }, + { + "type": "string" + }, { "type": "string" } ] }, "credentialSubject": { - "type": "null" + "type": "object", + "properties": { + "allow": { + "type": "boolean" + }, + "array": { + "type": "object", + "properties": { + "txt1": { + "type": "string" + }, + "txt2": { + "type": "string" + } + }, + "required": [ + "txt1", + "txt2" + ] + }, + "id": { + "type": "string" + }, + "num": { + "type": "integer" + } + }, + "required": [ + "allow", + "array", + "id", + "num" + ] }, "id": { "type": "string" }, + "issuanceDate": { + "type": "string" + }, "issuer": { "type": "string" }, @@ -50,60 +88,13 @@ ] }, "type": { - "type": "string" - }, - "verifiableCredential": { "type": "array", "items": [ { - "type": "object", - "properties": { - "@context": { - "type": "array", - "items": [ - { - "type": "string" - }, - { - "type": "string" - }, - { - "type": "string" - } - ] - }, - "credentialSubject": { - "type": "object", - "properties": { - "allow": { - "type": "boolean" - }, - "id": { - "type": "string" - } - }, - "required": [ - "allow", - "id" - ] - }, - "issuanceDate": { - "type": "string" - }, - "issuer": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "@context", - "credentialSubject", - "issuanceDate", - "issuer", - "type" - ] + "type": "string" + }, + { + "type": "string" } ] } @@ -112,9 +103,9 @@ "@context", "credentialSubject", "id", + "issuanceDate", "issuer", "proof", - "type", - "verifiableCredential" + "type" ] } \ No newline at end of file diff --git a/src/main/resources/REST/schemas/Signer_CredentialProof_without_ID_schema.json b/src/main/resources/REST/schemas/Signer_CredentialProof_without_ID_schema.json new file mode 100644 index 0000000000000000000000000000000000000000..41627f77c3311dd882725927e1103f2615f27500 --- /dev/null +++ b/src/main/resources/REST/schemas/Signer_CredentialProof_without_ID_schema.json @@ -0,0 +1,79 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "@context": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ] + }, + "id": { + "type": "string" + }, + "type": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ] + }, + "issuer": { + "type": "string" + }, + "issuanceDate": { + "type": "string" + }, + "credentialSubject": { + "type": "object", + "properties": { + "allow": { + "type": "boolean" + }, + "num": { + "type": "integer" + }, + "array": { + "type": "object", + "properties": { + "txt1": { + "type": "string" + }, + "txt2": { + "type": "string" + } + }, + "required": [ + "txt1", + "txt2" + ] + } + }, + "required": [ + "allow", + "num", + "array" + ] + } + }, + "required": [ + "@context", + "id", + "type", + "issuer", + "issuanceDate", + "credentialSubject" + ] +} \ No newline at end of file diff --git a/src/test/java/api/test/rest/tsa/signer/SignerStepDefinitions.java b/src/test/java/api/test/rest/tsa/signer/SignerStepDefinitions.java index 2f1235917de27e787d68687d6922823f9e4ad95b..551ed9df6f857b2be19a8c1eeebbd4b9fd912d6e 100644 --- a/src/test/java/api/test/rest/tsa/signer/SignerStepDefinitions.java +++ b/src/test/java/api/test/rest/tsa/signer/SignerStepDefinitions.java @@ -67,4 +67,12 @@ public class SignerStepDefinitions extends BaseStepDefinitions { addRequest(currentRequest); addResponse(response); } + + @When("I verify credential proof via TSA Signer API") + public void iVerifyCredentialProofViaTSASignerAPI() { + currentRequest.setPath("/v1/credential/verify"); + Response response = RestClient.post(currentRequest); + addRequest(currentRequest); + addResponse(response); + } } diff --git a/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature b/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature index 54f282bfef53b9494a328f44b687f539e73e2403..53d77e5645bf73ae45f399d763b92293772df70f 100644 --- a/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature +++ b/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature @@ -27,14 +27,35 @@ Feature: API - TSA - Signer credential proof - v1/credential/proof POST Scenario: TSA - create credential proof - Positive When I load the REST request {Credential.json} with profile {for_proof} - When I create credential proof via TSA Signer API - And the status code should be {200} + And I create credential proof via TSA Signer API + Then the status code should be {200} And the response is valid according to the {Signer_CredentialProof_schema.json} REST schema And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} + Scenario: TSA - create credential proof alumni of - Positive + When I load the REST request {Credential.json} with profile {for_proof_alumni} + And I create credential proof via TSA Signer API + Then the status code should be {200} + And the response is valid according to the {Signer_CredentialProof_alumni_schema.json} REST schema + And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} + + Scenario: TSA - create credential proof without ID - Positive + When I load the REST request {Credential.json} with profile {for_proof_without_ID} + And I create credential proof via TSA Signer API + Then the status code should be {200} + And the response is valid according to the {Signer_CredentialProof_without_ID_schema.json} REST schema + And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} + @negative - Scenario: TSA - validate credential proof with empty body - Negative + Scenario: TSA - create credential proof with empty body - Negative When I set the following request body {{}} - When I create credential proof via TSA Signer API - And the status code should be {400} - And the field {message} has the value {build new credential: fill credential types from raw: credential type of unknown structure} + And I create credential proof via TSA Signer API + Then the status code should be {400} + And the field {message} contains the value {credential type of unknown structure} + + @negative + Scenario: TSA - create credential proof with incorrect ID (space)- Negative + When I load the REST request {Credential.json} with profile {for_proof_incorrect_ID_space} + And I create credential proof via TSA Signer API + Then the status code should be {400} + And the field {message} has the value {invalid format of subject id} diff --git a/src/test/resources/features/tsa/signer/v1/credential/verify/POST.feature b/src/test/resources/features/tsa/signer/v1/credential/verify/POST.feature new file mode 100644 index 0000000000000000000000000000000000000000..8f241deea2c24a55c7e6525c54bb913026a87ce2 --- /dev/null +++ b/src/test/resources/features/tsa/signer/v1/credential/verify/POST.feature @@ -0,0 +1,72 @@ +#Copyright (c) 2018 Vereign AG [https://www.vereign.com] +# +#This is free software: you can redistribute it and/or modify +#it under the terms of the GNU Affero General Public License as +#published by the Free Software Foundation, either version 3 of the +#License, or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU Affero General Public License for more details. +# +#You should have received a copy of the GNU Affero General Public License +#along with this program. If not, see <http://www.gnu.org/licenses/>. + +#https://gaiax.vereign.com/tsa/signer/v1/credential/verify +#Author: Georgi Michev georgi.michev@vereign.com + +@rest @all @tsa @signer +Feature: API - TSA - Signer credential verify - v1/credential/verify POST + As user + I want to verify a credential + So I know it is valid + + Background: + Given we are testing the TSA Signer Api + + Scenario: TSA - verify credential proof - Positive + When I load the REST request {Credential.json} with profile {for_proof} + And I create credential proof via TSA Signer API + Then the status code should be {200} + And the response is valid according to the {Signer_CredentialProof_schema.json} REST schema + And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} + Then I get the last response body and load it to the current request body + And I verify credential proof via TSA Signer API + And the status code should be {200} + And the field {valid} has the value {true} + + @negative + Scenario: TSA - verify credential proof with missing proof - Negative + When I load the REST request {Credential.json} with profile {missing_proof} + And I verify credential proof via TSA Signer API + Then the status code should be {400} + And the field {message} contains the value {verifiable credential must have proof section} + + @negative + Scenario: TSA - verify credential proof with missing proof - Negative + When I load the REST request {Credential.json} with profile {modified_ID} + And I verify credential proof via TSA Signer API + Then the status code should be {400} + And the field {message} contains the value {invalid signature} + + @negative + Scenario: TSA - verify credential proof with modified issuanceDate field - Negative + When I load the REST request {Credential.json} with profile {modified_issuanceDate} + And I verify credential proof via TSA Signer API + Then the status code should be {400} + And the field {message} contains the value {invalid signature} + + @negative + Scenario: TSA - verify credential proof with modified issuanceDate field - Negative + When I load the REST request {Credential.json} with profile {modified_credentialSubject_allow} + And I verify credential proof via TSA Signer API + Then the status code should be {400} + And the field {message} contains the value {invalid signature} + + @negative + Scenario: TSA - verify credential proof with modified issuanceDate field - Negative + When I load the REST request {Credential.json} with profile {modified_credentialSubject_array} + And I verify credential proof via TSA Signer API + Then the status code should be {400} + And the field {message} contains the value {invalid signature} diff --git a/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature b/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature index 9766b75275b33d31bfecdd8772e8c18fe9b6d9f5..32b4d2163130e9343ef12ea5ff77df4a7b90b3b4 100644 --- a/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature +++ b/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature @@ -27,40 +27,41 @@ Feature: API - TSA - Signer presentation proof - v1/presentation/proof POST Scenario: TSA - create presentation proof - Positive When I load the REST request {Presentation.json} with profile {for_proof} - When I create presentation proof via TSA Signer API - And the status code should be {200} + And I create presentation proof via TSA Signer API + Then the status code should be {200} And the response is valid according to the {Signer_PresentationProof_schema.json} REST schema And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} - Scenario: TSA - create presentation proof - Positive + Scenario: TSA - create presentation proof alumni of - Positive When I load the REST request {Presentation.json} with profile {for_proof_alumni} - When I create presentation proof via TSA Signer API - And the status code should be {200} + And I create presentation proof via TSA Signer API + Then the status code should be {200} And the response is valid according to the {Signer_PresentationProof_schema_alumni.json} REST schema - Scenario: TSA - create presentation proof missing ID - Positive - When I load the REST request {Presentation.json} with profile {for_proof_missing_ID} - When I create presentation proof via TSA Signer API - And the status code should be {200} + Scenario: TSA - create presentation proof without ID - Positive + When I load the REST request {Presentation.json} with profile {for_proof_without_ID} + And I create presentation proof via TSA Signer API + Then the status code should be {200} And the response is valid according to the {Signer_PresentationProof_schema.json} REST schema And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} @negative Scenario: TSA - validate presentation proof with empty body - Negative When I set the following request body {{}} - When I create presentation proof via TSA Signer API - And the status code should be {400} + And I create presentation proof via TSA Signer API + Then the status code should be {400} + And the field {message} contains the value {verifiable presentation is not valid} @negative Scenario: TSA - create presentation proof with incorrect ID (space) - Negative When I load the REST request {Presentation.json} with profile {for_proof_incorrect_ID_space} - When I create presentation proof via TSA Signer API - And the status code should be {400} + And I create presentation proof via TSA Signer API + Then the status code should be {400} And the field {message} has the value {invalid format of subject id} @negative Scenario: TSA - create presentation proof with incorrect ID (symbols) - Negative When I load the REST request {Presentation.json} with profile {for_proof_incorrect_ID_symbols} - When I create presentation proof via TSA Signer API - And the status code should be {400} + And I create presentation proof via TSA Signer API + Then the status code should be {400} And the field {message} has the value {invalid format of subject id} diff --git a/src/test/resources/features/tsa/signer/v1/presentation/verify/POST.feature b/src/test/resources/features/tsa/signer/v1/presentation/verify/POST.feature index 67c77bfee8c27fd07bf483265b5bf2bf0fb7e78e..73605f18c54c68e8359a8d30b12c291fd7d85103 100644 --- a/src/test/resources/features/tsa/signer/v1/presentation/verify/POST.feature +++ b/src/test/resources/features/tsa/signer/v1/presentation/verify/POST.feature @@ -48,39 +48,39 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST When I load the REST request {Presentation.json} with profile {modified_ID} And I verify presentation proof via TSA Signer API And the status code should be {400} - And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature} + And the field {message} contains the value {invalid signature} @negative Scenario: TSA - verify presentation proof with modified issuanceDate field - Negative When I load the REST request {Presentation.json} with profile {modified_issuanceDate} And I verify presentation proof via TSA Signer API And the status code should be {400} - And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature} + And the field {message} contains the value {invalid signature} @negative Scenario: TSA - verify presentation proof with modified first credentialSubject.allow field - Negative When I load the REST request {Presentation.json} with profile {modified_credentialSubject_1_allow} And I verify presentation proof via TSA Signer API And the status code should be {400} - And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature} + And the field {message} contains the value {invalid signature} @negative Scenario: TSA - verify presentation proof with modified second credentialSubject.allow field - Negative When I load the REST request {Presentation.json} with profile {modified_credentialSubject_2_allow} And I verify presentation proof via TSA Signer API And the status code should be {400} - And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature} + And the field {message} contains the value {invalid signature} @negative Scenario: TSA - verify presentation proof with modified first credentialSubject.ID field - Negative When I load the REST request {Presentation.json} with profile {modified_credentialSubject_1_ID} And I verify presentation proof via TSA Signer API And the status code should be {400} - And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature} + And the field {message} contains the value {invalid signature} @negative Scenario: TSA - verify presentation proof with modified second credentialSubject.ID field - Negative When I load the REST request {Presentation.json} with profile {modified_credentialSubject_2_ID} And I verify presentation proof via TSA Signer API And the status code should be {400} - And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature} + And the field {message} contains the value {invalid signature}