Skip to content
Snippets Groups Projects
Unverified Commit 97e9a96d authored by Georgi Michev's avatar Georgi Michev
Browse files

update VC schemas and optiize tests


Some of the steps for VC were not needed.

Signed-off-by: default avatargeorgi.michev <georgi.michev@vereign.com>
parent db796baa
No related branches found
No related tags found
1 merge request!30update credential schema
Pipeline #53166 passed with stage
in 3 minutes and 48 seconds
......@@ -10,7 +10,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"allow": true,
......@@ -25,7 +26,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"allow": true,
......@@ -37,6 +39,36 @@
}
]
},
"for_proof_alumni": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"type": "VerifiablePresentation",
"verifiableCredential": [{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/1872",
"type": ["VerifiableCredential", "AlumniCredential"],
"issuer": "https://example.edu/issuers/565049",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"alumniOf": {
"id": "did:example:c276e12ec21ebfeb1f712ebc6f1",
"name": [{
"value": "Example University",
"lang": "en"
}, {
"value": "Exemple d'Université",
"lang": "fr"
}]
}
}
}]
},
"for_proof_missing_ID": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
......@@ -92,8 +124,8 @@
],
"id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation",
"proof": {
"created": "2022-08-03T06:05:59.224982676Z",
"jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEUCIG-PwWIzvaxnD_HDabNPWq5K9hOf99WsCAIWhWExSjXtAiEA3TkKOnU3vpK_GqShJeyKei6yfJfgUyUG8UmfLTuBHsU",
"created": "2022-08-03T14:26:51.378442416Z",
"jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIDanJ43A79S8p7tGfrHvdLsH6iZWRNv2gQlWtCHboOBaAiBJbZEtYLn2151Q3lv5QnpJcdrPzsyADNbKMmqf-W8CAQ",
"proofPurpose": "assertionMethod",
"type": "JsonWebSignature2020",
"verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1"
......@@ -103,7 +135,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"age_over": 18,
......@@ -118,7 +151,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"allow": true,
......@@ -137,8 +171,8 @@
],
"id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation",
"proof": {
"created": "2022-08-03T06:11:38.170830056Z",
"jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEYCIQDJ7gTTZju3fJ-xaCBcWYziuI4J80S19AdxwNl3x4nzIQIhALApZj26dRANZZx5mp6PlChh1TExNc203LFPkHzfCWGk",
"created": "2022-08-03T14:26:51.378442416Z",
"jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIDanJ43A79S8p7tGfrHvdLsH6iZWRNv2gQlWtCHboOBaAiBJbZEtYLn2151Q3lv5QnpJcdrPzsyADNbKMmqf-W8CAQ",
"proofPurpose": "assertionMethod",
"type": "JsonWebSignature2020",
"verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1"
......@@ -148,7 +182,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"age_over": 18,
......@@ -163,7 +198,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"allow": true,
......@@ -227,8 +263,8 @@
],
"id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation",
"proof": {
"created": "2022-08-03T06:11:38.170830056Z",
"jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEYCIQDJ7gTTZju3fJ-xaCBcWYziuI4J80S19AdxwNl3x4nzIQIhALApZj26dRANZZx5mp6PlChh1TExNc203LFPkHzfCWGk",
"created": "2022-08-03T14:26:51.378442416Z",
"jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEQCIDanJ43A79S8p7tGfrHvdLsH6iZWRNv2gQlWtCHboOBaAiBJbZEtYLn2151Q3lv5QnpJcdrPzsyADNbKMmqf-W8CAQ",
"proofPurpose": "assertionMethod",
"type": "JsonWebSignature2020",
"verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1"
......@@ -238,7 +274,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"age_over": 18,
......@@ -253,7 +290,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"allow": false,
......@@ -272,8 +310,8 @@
],
"id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation",
"proof": {
"created": "2022-08-03T06:44:14.016800951Z",
"jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEYCIQCdpKnxGXPUCZ7fB9QNdZiiKTJ4vIcLudyYtysVOUG7dQIhAMr5DqWP7-lB0cDpDqrdakub38iUZxtxDLVoYO50tLmN",
"created": "2022-08-03T13:50:51.575345046Z",
"jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEUCIF7F4sW9tY6bR_Z1bCl4rus_FEDvLbJRKDwmHCkLs5pDAiEAxPkI-TiQh3er_VxR4EdjoG-eYmpp1XpZdKVnvm2xjz8",
"proofPurpose": "assertionMethod",
"type": "JsonWebSignature2020",
"verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1"
......@@ -283,7 +321,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"age_over": 18,
......@@ -298,7 +337,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"allow": true,
......@@ -317,8 +357,8 @@
],
"id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation",
"proof": {
"created": "2022-08-03T06:44:14.016800951Z",
"jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEYCIQCdpKnxGXPUCZ7fB9QNdZiiKTJ4vIcLudyYtysVOUG7dQIhAMr5DqWP7-lB0cDpDqrdakub38iUZxtxDLVoYO50tLmN",
"created": "2022-08-03T13:50:51.575345046Z",
"jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEUCIF7F4sW9tY6bR_Z1bCl4rus_FEDvLbJRKDwmHCkLs5pDAiEAxPkI-TiQh3er_VxR4EdjoG-eYmpp1XpZdKVnvm2xjz8",
"proofPurpose": "assertionMethod",
"type": "JsonWebSignature2020",
"verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1"
......@@ -328,13 +368,14 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"age_over": 18,
"allow": true,
"citizenship": "France",
"id": "invalid_ID"
"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",
......@@ -343,11 +384,12 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/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"
"id": "https://gaiax.XXX.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",
......@@ -531,7 +573,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"allow": true,
......@@ -546,7 +589,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"allow": true,
......@@ -569,7 +613,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"allow": true,
......@@ -584,7 +629,8 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1"
"https://w3id.org/security/suites/jws-2020/v1",
"https://schema.org"
],
"credentialSubject": {
"allow": true,
......
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"@context": {
"type": "array",
"items": [
{
"type": "string"
},
{
"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": "string"
},
"verifiableCredential": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"@context": {
"type": "array",
"items": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"credentialSubject": {
"type": "object",
"properties": {
"alumniOf": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"lang": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"lang",
"value"
]
},
{
"type": "object",
"properties": {
"lang": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"lang",
"value"
]
}
]
}
},
"required": [
"id",
"name"
]
},
"id": {
"type": "string"
}
},
"required": [
"alumniOf",
"id"
]
},
"id": {
"type": "string"
},
"issuanceDate": {
"type": "string"
},
"issuer": {
"type": "string"
},
"type": {
"type": "array",
"items": [
{
"type": "string"
},
{
"type": "string"
}
]
}
},
"required": [
"@context",
"credentialSubject",
"id",
"issuanceDate",
"issuer",
"type"
]
}
]
}
},
"required": [
"@context",
"proof",
"type",
"verifiableCredential"
]
}
\ No newline at end of file
......@@ -32,6 +32,12 @@ Feature: API - TSA - Signer presentation proof - v1/presentation/proof POST
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
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 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
......
......@@ -38,12 +38,6 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST
@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}
......@@ -51,12 +45,6 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST
@negative
Scenario: TSA - verify presentation proof with modified 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}
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 {modified_ID}
And I verify presentation proof via TSA Signer API
And the status code should be {400}
......@@ -64,51 +52,27 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST
@negative
Scenario: TSA - verify presentation proof with modified issuanceDate 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}
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 {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}
@wip @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}
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 {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-signer#20 @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}
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 {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}
@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}
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 {modified_credentialSubject_1_ID}
And I verify presentation proof via TSA Signer API
And the status code should be {400}
......@@ -116,12 +80,6 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST
@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}
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 {modified_credentialSubject_2_ID}
And I verify presentation proof via TSA Signer API
And the status code should be {400}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment