diff --git a/src/main/resources/REST/json/Credential.json b/src/main/resources/REST/json/Credential.json index 6ffc0eeff3cbee17af1ddaa72e4348b49e863914..af33e7a2b8c58bf86c41b3a85b271be7b8c63e73 100644 --- a/src/main/resources/REST/json/Credential.json +++ b/src/main/resources/REST/json/Credential.json @@ -390,5 +390,177 @@ "VerifiableCredential", "UniversityDegreeCredential" ] + }, + "for_proof_with_02_proof": { + "key": "key1", + "namespace": "transit", + "credential": { + "@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:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation", + "num": 123 + }, + "id": "http://example.edu/credentials/3732", + "issuanceDate": "2010-01-01T00:00:00Z", + "issuer": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation", + "proof": [ + { + "created": "2023-12-22T13:55:18.273836907Z", + "jws": "eyJhbGciOiIiLCJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdfQ..MEUCIFMAPo3lCJ4C8MJKcO_LI2P2a9XPCLmowlRASiXaF6axAiEA5VfJMMjo5QrL5EmRrBq2_BnE8HtTsy9-aTmBI99v3kE", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1" + }, + { + "created": "2023-12-22T14:04:15.675936709Z", + "jws": "eyJhbGciOiIiLCJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdfQ..MEYCIQCK6qATImHzvXiLuVHbQruC-IM9y-3uBtbGupHm2v8k6gIhAPTtZuBwYW8G6m7xdfgjNgVV4uJTTPeKOWDJJebHPPYV", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1" + } + ], + "type": [ + "VerifiableCredential", + "UniversityDegreeCredential" + ] + } + }, + "for_proof_with_modified_second_proof_date": { + "key": "key1", + "namespace": "transit", + "credential": { + "@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:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation", + "num": 123 + }, + "id": "http://example.edu/credentials/3732", + "issuanceDate": "2010-01-01T00:00:00Z", + "issuer": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation", + "proof": [ + { + "created": "2023-12-22T13:55:18.273836907Z", + "jws": "eyJhbGciOiIiLCJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdfQ..MEUCIFMAPo3lCJ4C8MJKcO_LI2P2a9XPCLmowlRASiXaF6axAiEA5VfJMMjo5QrL5EmRrBq2_BnE8HtTsy9-aTmBI99v3kE", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1" + }, + { + "created": "2033-12-22T14:04:15.675936709Z", + "jws": "eyJhbGciOiIiLCJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdfQ..MEYCIQCK6qATImHzvXiLuVHbQruC-IM9y-3uBtbGupHm2v8k6gIhAPTtZuBwYW8G6m7xdfgjNgVV4uJTTPeKOWDJJebHPPYV", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1" + } + ], + "type": [ + "VerifiableCredential", + "UniversityDegreeCredential" + ] + } + }, + "for_proof_with_modified_second_proof_cred_subject": { + "key": "key1", + "namespace": "transit", + "credential": { + "@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": "11", + "txt2": "2" + }, + "id": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation", + "num": 123 + }, + "id": "http://example.edu/credentials/3732", + "issuanceDate": "2010-01-01T00:00:00Z", + "issuer": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation", + "proof": [ + { + "created": "2023-12-22T13:55:18.273836907Z", + "jws": "eyJhbGciOiIiLCJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdfQ..MEUCIFMAPo3lCJ4C8MJKcO_LI2P2a9XPCLmowlRASiXaF6axAiEA5VfJMMjo5QrL5EmRrBq2_BnE8HtTsy9-aTmBI99v3kE", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1" + }, + { + "created": "2023-12-22T14:04:15.675936709Z", + "jws": "eyJhbGciOiIiLCJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdfQ..MEYCIQCK6qATImHzvXiLuVHbQruC-IM9y-3uBtbGupHm2v8k6gIhAPTtZuBwYW8G6m7xdfgjNgVV4uJTTPeKOWDJJebHPPYV", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1" + } + ], + "type": [ + "VerifiableCredential", + "UniversityDegreeCredential" + ] + } + }, + "for_proof_with_modified_second_proof_cred_subject_allow": { + "key": "key1", + "namespace": "transit", + "credential": { + "@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:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation", + "num": 123 + }, + "id": "http://example.edu/credentials/3732", + "issuanceDate": "2010-01-01T00:00:00Z", + "issuer": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation", + "proof": [ + { + "created": "2023-12-22T13:55:18.273836907Z", + "jws": "eyJhbGciOiIiLCJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdfQ..MEUCIFMAPo3lCJ4C8MJKcO_LI2P2a9XPCLmowlRASiXaF6axAiEA5VfJMMjo5QrL5EmRrBq2_BnE8HtTsy9-aTmBI99v3kE", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1" + }, + { + "created": "2023-12-22T14:04:15.675936709Z", + "jws": "eyJhbGciOiIiLCJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdfQ..MEYCIQCK6qATImHzvXiLuVHbQruC-IM9y-3uBtbGupHm2v8k6gIhAPTtZuBwYW8G6m7xdfgjNgVV4uJTTPeKOWDJJebHPPYV", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1" + } + ], + "type": [ + "VerifiableCredential", + "UniversityDegreeCredential" + ] + } } } \ No newline at end of file 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 d863474a4bec9a2ca22e45d3a4674266de74ad84..8b48c20b8a67ce73838fc41dfeac2725da900dfe 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 @@ -22,48 +22,34 @@ Feature: API - TSA - Signer credential proof - v1/credential/proof POST | alumni of | for_proof_alumni | Signer_CredentialProof_alumni_schema.json | | without ID | for_proof_without_ID | Signer_CredentialProof_without_ID_schema.json | - @phase2 @IDM.TSA.E1.00005 @IDM.TSA.E1.00006 @wip + @phase2 @IDM.TSA.E1.00005 @IDM.TSA.E1.00006 Scenario: TSA - create two consecutive proofs - Positive - When I load the REST request {Credential.json} with profile {for_proof} + When I load the REST request {Credential.json} with profile {for_proof_with_02_proof} And I create credential proof via TSA Signer API Then the status code should be {200} - When I load the response from the previous call - 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_two_credentialProofs_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} + And the field {proof[0].verificationMethod} contains the value {did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1} + And the field {proof[1].verificationMethod} contains the value {did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1} + And the field {proof[2].verificationMethod} contains the value {did:web:vault.vereign.com:tsa:policy:policy:policies:example:returnDID:1.0:evaluation#key1} - @negative @phase2 @IDM.TSA.E1.00005 @IDM.TSA.E1.00006 @wip + @negative @phase2 @IDM.TSA.E1.00005 @IDM.TSA.E1.00006 Scenario: TSA - create two consecutive proofs with modified issuance date - Negative - 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} - When I load the response from the previous call - And I change the issuance date + When I load the REST request {Credential.json} with profile {for_proof_with_modified_second_proof_date} And I create credential proof via TSA Signer API - Then the status code should be {400} + Then the status code should be {403} And the field {message} contains the value {invalid signature} - @negative @phase2 @IDM.TSA.E1.00005 @IDM.TSA.E1.00006 @wip + @negative @phase2 @IDM.TSA.E1.00005 @IDM.TSA.E1.00006 Scenario: TSA - create two consecutive proofs with modified credential subject ID - Negative - When I load the REST request {Credential.json} with profile {for_proof} + When I load the REST request {Credential.json} with profile {for_proof_with_modified_second_proof_cred_subject} And I create credential proof via TSA Signer API - Then the status code should be {200} - When I load the response from the previous call - And I change the credential subject ID - And I create credential proof via TSA Signer API - Then the status code should be {400} + Then the status code should be {403} And the field {message} contains the value {invalid signature} - @negative @phase2 @IDM.TSA.E1.00005 @IDM.TSA.E1.00006 @wip + @negative @phase2 @IDM.TSA.E1.00005 @IDM.TSA.E1.00006 Scenario: TSA - create two consecutive proofs with modified credential subject allow - Negative - When I load the REST request {Credential.json} with profile {for_proof} + When I load the REST request {Credential.json} with profile {for_proof_with_modified_second_proof_cred_subject_allow} And I create credential proof via TSA Signer API - Then the status code should be {200} - When I load the response from the previous call - And I change the credential subject allow - And I create credential proof via TSA Signer API - Then the status code should be {400} + Then the status code should be {403} And the field {message} contains the value {invalid signature} @negative