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

update credential schema


After implementing the strict validation all fields has to have schemas.

Signed-off-by: default avatargeorgi.michev <georgi.michev@vereign.com>
parent 5c9da73f
No related branches found
No related tags found
1 merge request!30update credential schema
{ {
"@context": [ "for_proof":{
"https://www.w3.org/2018/credentials/v1", "@context": [
"https://w3id.org/security/suites/jws-2020/v1", "https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1" "https://w3id.org/security/suites/jws-2020/v1"
], ],
"credentialSubject": { "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation",
"allow": true, "type": "VerifiablePresentation",
"hello": "world", "verifiableCredential": [
"id": "example/examplePolicy/1.0" {
"@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"
}
]
}, },
"issuanceDate": "2022-07-01T13:29:47.578628068Z", "incorrect_id":{
"issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", "@context": [
"type": "VerifiableCredential" "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": "ZZZZZZZZZZZZZZZ"
},
"issuanceDate": "2022-07-01T11:07:57.975459274Z",
"issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation",
"type": "VerifiableCredential"
}
]
}
} }
\ No newline at end of file
...@@ -8,34 +8,15 @@ ...@@ -8,34 +8,15 @@
{ {
"type": "string" "type": "string"
}, },
{
"type": "string"
},
{ {
"type": "string" "type": "string"
} }
] ]
}, },
"credentialSubject": { "credentialSubject": {
"type": "object", "type": "null"
"properties": {
"allow": {
"type": "boolean"
},
"hello": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"allow",
"hello",
"id"
]
}, },
"issuanceDate": { "id": {
"type": "string" "type": "string"
}, },
"issuer": { "issuer": {
...@@ -70,14 +51,70 @@ ...@@ -70,14 +51,70 @@
}, },
"type": { "type": {
"type": "string" "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"
]
}
]
} }
}, },
"required": [ "required": [
"@context", "@context",
"credentialSubject", "credentialSubject",
"issuanceDate", "id",
"issuer", "issuer",
"proof", "proof",
"type" "type",
"verifiableCredential"
] ]
} }
\ No newline at end of file
...@@ -26,7 +26,7 @@ Feature: API - TSA - Signer credential proof - v1/credential/proof POST ...@@ -26,7 +26,7 @@ Feature: API - TSA - Signer credential proof - v1/credential/proof POST
Given we are testing the TSA Signer Api Given we are testing the TSA Signer Api
Scenario: TSA - create credential proof - Positive Scenario: TSA - create credential proof - Positive
When I load the request from json {/REST/json/Credential.json} When I load the REST request {Credential.json} with profile {for_proof}
When I create credential proof via TSA Signer API When I create credential proof via TSA Signer API
And the status code should be {200} And the status code should be {200}
And the response is valid according to the {Signer_CredentialProof_schema.json} REST schema And the response is valid according to the {Signer_CredentialProof_schema.json} REST schema
...@@ -36,4 +36,5 @@ Feature: API - TSA - Signer credential proof - v1/credential/proof POST ...@@ -36,4 +36,5 @@ Feature: API - TSA - Signer credential proof - v1/credential/proof POST
Scenario: TSA - validate credential proof with empty body - Negative Scenario: TSA - validate credential proof with empty body - Negative
When I set the following request body {{}} When I set the following request body {{}}
When I create credential proof via TSA Signer API When I create credential proof via TSA Signer API
And the status code should be {400} And the status code should be {400}
\ No newline at end of file And the field {message} has the value {build new credential: fill credential types from raw: credential type of unknown structure}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment