diff --git a/src/main/resources/REST/json/Presentation.json b/src/main/resources/REST/json/Presentation.json index 59434ed31a9ce50d9af36da2bb5b40c0c9bf8afc..1779b1cd1c44447376657d9285ed2cad358690bb 100644 --- a/src/main/resources/REST/json/Presentation.json +++ b/src/main/resources/REST/json/Presentation.json @@ -2,8 +2,7 @@ "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://w3id.org/security/suites/jws-2020/v1" ], "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", "type": "VerifiablePresentation", @@ -12,11 +11,11 @@ "@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://schema.org" ], "credentialSubject": { "allow": true, - "id": "example/examplePolicy/1.0" + "id": "https://gaiax.vereign.com/tsa/policy/example/ProofRequestResponse/1.0" }, "issuanceDate": "2022-07-21T10:24:36.203848291Z", "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", @@ -26,11 +25,11 @@ "@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://schema.org" ], "credentialSubject": { "allow": true, - "id": "example/ProofRequestResponse/1.0" + "id": "https://gaiax.vereign.com/tsa/policy/example/ProofRequestResponse/1.0" }, "issuanceDate": "2022-07-21T10:24:36.203861194Z", "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", @@ -84,16 +83,53 @@ } ] }, + "incorrect_ID_for_proof": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/security/suites/jws-2020/v1" + ], + "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": "incorrect_ID" + }, + "issuanceDate": "2022-07-21T10:24:36.203848291Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "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/ProofRequestResponse/1.0" + }, + "issuanceDate": "2022-07-21T10:24:36.203861194Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "VerifiableCredential" + } + ] + }, "modified_credentialSubject_1_allow": { "@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://w3id.org/security/suites/jws-2020/v1" ], "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", "proof": { - "created": "2022-07-21T14:28:09.071187173Z", - "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIFkavr6XpAYbdurBmQXNei-hI8WHAcnEYkZ6J3i4d3FKAiA4BtVCAixsAypaJ5dcBxn96Ju1OGfi7Kw1QRZMlMumhg", + "created": "2022-07-29T15:01:11.776816778Z", + "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEUCIQCUaAcVPM0IuKmZMkLgQ0YwKwqcUarymUX-aE6AgZwAggIgW1-u3T2RKHHcnEI6HKTRXM3xAQ-C2ctU7qSrmzfyYl4", "proofPurpose": "assertionMethod", "type": "JsonWebSignature2020", "verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1" @@ -104,11 +140,11 @@ "@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://schema.org" ], "credentialSubject": { "allow": false, - "id": "example/examplePolicy/1.0" + "id": "https://gaiax.vereign.com/tsa/policy/example/ProofRequestResponse/1.0" }, "issuanceDate": "2022-07-21T10:24:36.203848291Z", "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", @@ -118,11 +154,56 @@ "@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://schema.org" ], "credentialSubject": { "allow": true, - "id": "example/ProofRequestResponse/1.0" + "id": "https://gaiax.vereign.com/tsa/policy/example/ProofRequestResponse/1.0" + }, + "issuanceDate": "2022-07-21T10:24:36.203861194Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "VerifiableCredential" + } + ] + }, + "incorrect_ID": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/security/suites/jws-2020/v1" + ], + "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "proof": { + "created": "2022-07-29T15:43:25.076882592Z", + "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEUCIQD84hJZfHP84SJSL98XvtUlCNVD48GHb0R-lqqeCPw79wIgXUdmzYoDsUj0sPIVICgN66UX2BHGjDTY7Rlw74m6Rwo", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1" + }, + "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": "incorrect_ID" + }, + "issuanceDate": "2022-07-21T10:24:36.203848291Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "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/ProofRequestResponse/1.0" }, "issuanceDate": "2022-07-21T10:24:36.203861194Z", "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", @@ -133,13 +214,12 @@ "modified_credentialSubject_2_allow": { "@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://w3id.org/security/suites/jws-2020/v1" ], "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", "proof": { - "created": "2022-07-21T14:28:09.071187173Z", - "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIFkavr6XpAYbdurBmQXNei-hI8WHAcnEYkZ6J3i4d3FKAiA4BtVCAixsAypaJ5dcBxn96Ju1OGfi7Kw1QRZMlMumhg", + "created": "2022-07-29T15:01:11.776816778Z", + "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEUCIQCUaAcVPM0IuKmZMkLgQ0YwKwqcUarymUX-aE6AgZwAggIgW1-u3T2RKHHcnEI6HKTRXM3xAQ-C2ctU7qSrmzfyYl4", "proofPurpose": "assertionMethod", "type": "JsonWebSignature2020", "verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1" @@ -150,11 +230,11 @@ "@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://schema.org" ], "credentialSubject": { "allow": true, - "id": "example/examplePolicy/1.0" + "id": "https://gaiax.vereign.com/tsa/policy/example/ProofRequestResponse/1.0" }, "issuanceDate": "2022-07-21T10:24:36.203848291Z", "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", @@ -164,11 +244,11 @@ "@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://schema.org" ], "credentialSubject": { "allow": false, - "id": "example/ProofRequestResponse/1.0" + "id": "https://gaiax.vereign.com/tsa/policy/example/ProofRequestResponse/1.0" }, "issuanceDate": "2022-07-21T10:24:36.203861194Z", "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", @@ -179,13 +259,12 @@ "modified_credentialSubject_1_ID": { "@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://w3id.org/security/suites/jws-2020/v1" ], "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", "proof": { - "created": "2022-07-21T14:28:09.071187173Z", - "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIFkavr6XpAYbdurBmQXNei-hI8WHAcnEYkZ6J3i4d3FKAiA4BtVCAixsAypaJ5dcBxn96Ju1OGfi7Kw1QRZMlMumhg", + "created": "2022-07-29T15:01:11.776816778Z", + "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEUCIQCUaAcVPM0IuKmZMkLgQ0YwKwqcUarymUX-aE6AgZwAggIgW1-u3T2RKHHcnEI6HKTRXM3xAQ-C2ctU7qSrmzfyYl4", "proofPurpose": "assertionMethod", "type": "JsonWebSignature2020", "verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1" @@ -196,11 +275,11 @@ "@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://schema.org" ], "credentialSubject": { "allow": true, - "id": "example/examplePolicy/2.0" + "id": "invalid_ID" }, "issuanceDate": "2022-07-21T10:24:36.203848291Z", "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", @@ -210,11 +289,11 @@ "@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://schema.org" ], "credentialSubject": { "allow": true, - "id": "example/ProofRequestResponse/1.0" + "id": "https://gaiax.vereign.com/tsa/policy/example/ProofRequestResponse/1.0" }, "issuanceDate": "2022-07-21T10:24:36.203861194Z", "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", @@ -225,13 +304,12 @@ "modified_credentialSubject_2_ID": { "@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://w3id.org/security/suites/jws-2020/v1" ], "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", "proof": { - "created": "2022-07-21T14:28:09.071187173Z", - "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIFkavr6XpAYbdurBmQXNei-hI8WHAcnEYkZ6J3i4d3FKAiA4BtVCAixsAypaJ5dcBxn96Ju1OGfi7Kw1QRZMlMumhg", + "created": "2022-07-29T15:01:11.776816778Z", + "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEUCIQCUaAcVPM0IuKmZMkLgQ0YwKwqcUarymUX-aE6AgZwAggIgW1-u3T2RKHHcnEI6HKTRXM3xAQ-C2ctU7qSrmzfyYl4", "proofPurpose": "assertionMethod", "type": "JsonWebSignature2020", "verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1" @@ -242,11 +320,11 @@ "@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://schema.org" ], "credentialSubject": { "allow": true, - "id": "example/examplePolicy/1.0" + "id": "https://gaiax.vereign.com/tsa/policy/example/ProofRequestResponse/1.0" }, "issuanceDate": "2022-07-21T10:24:36.203848291Z", "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", @@ -256,11 +334,11 @@ "@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://schema.org" ], "credentialSubject": { "allow": true, - "id": "example/ProofRequestResponse/2.0" + "id": "invalid_ID" }, "issuanceDate": "2022-07-21T10:24:36.203861194Z", "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", @@ -359,5 +437,43 @@ "type": "VerifiableCredential" } ] + }, + "missing_proof": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/security/suites/jws-2020/v1" + ], + "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/ProofRequestResponse/1.0" + }, + "issuanceDate": "2022-07-21T10:24:36.203848291Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "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/ProofRequestResponse/1.0" + }, + "issuanceDate": "2022-07-21T10:24:36.203861194Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "VerifiableCredential" + } + ] } } \ No newline at end of file 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 674b870ce55337101725e195e9d5c5d612e49ba5..eab546dfca87a58ba5bcd3433e6c1c695b7d0bd9 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 @@ -36,6 +36,32 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST And the status code should be {200} And the field {valid} has the value {true} + @wip @bug-signer#19 @negative + Scenario: TSA - verify presentation proof with missing proof - Negative + 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 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} + Then I get the last response body and load it to the current request body + When I load the REST request {Presentation.json} with profile {missing_proof} + 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} + + @wip @bug-signer#18 @negative + Scenario: TSA - verify presentation proof with incorrect ID field - Negative + When I load the REST request {Presentation.json} with profile {incorrect_ID_for_proof} + When I create presentation proof via TSA Signer API + And 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} + Then I get the last response body and load it to the current request body + When I load the REST request {Presentation.json} with profile {incorrect_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} + @negative Scenario: TSA - verify presentation proof with modified ID field - Negative When I load the REST request {Presentation.json} with profile {for_proof} @@ -62,8 +88,8 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST And the status code should be {400} And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature} - @wip @bug-issue-signer#16 @negative - Scenario: TSA - verify presentation proof with modified credentialSubject.allow field - Negative + @negative + Scenario: TSA - verify presentation proof with modified first credentialSubject.allow field - Negative 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} @@ -72,11 +98,11 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST Then I get the last response body and load it to the current request body 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 status code should be {400} + And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature} - @wip @bug-issue-signer#16 @negative - Scenario: TSA - verify presentation proof with modified credentialSubject.allow field - Negative + @negative + Scenario: TSA - verify presentation proof with modified second credentialSubject.allow field - Negative 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} @@ -85,11 +111,11 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST Then I get the last response body and load it to the current request body 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 status code should be {400} + And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature} - @wip @bug-issue-signer#16 @negative - Scenario: TSA - verify presentation proof with modified credentialSubject.ID field - Negative + @negative + Scenario: TSA - verify presentation proof with modified first credentialSubject.ID field - Negative 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} @@ -98,11 +124,11 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST Then I get the last response body and load it to the current request body 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 status code should be {400} + And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature} - @wip @bug-issue-signer#16 @negative - Scenario: TSA - verify presentation proof with modified credentialSubject.ID field - Negative + @negative + Scenario: TSA - verify presentation proof with modified second credentialSubject.ID field - Negative 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} @@ -111,5 +137,5 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST Then I get the last response body and load it to the current request body 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 status code should be {400} + And the field {message} has the value {check embedded proof: check linked data proof: ecdsa: invalid signature}