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

apply changes: Improve policy evaluation response, remove required body

parent 4c89bca4
No related branches found
No related tags found
1 merge request!21remove mongo interactions
......@@ -2,59 +2,47 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"evaluationID": {
"type": "string"
},
"result": {
"data": {
"type": "object",
"properties": {
"data": {
"@context": {
"type": "string"
},
"didDocument": {
"type": "null"
},
"didDocumentMetadata": {
"type": "object"
},
"didResolutionMetadata": {
"type": "object",
"properties": {
"@context": {
"contentType": {
"type": "string"
},
"didDocument": {
"type": "null"
},
"didDocumentMetadata": {
"type": "object"
"error": {
"type": "string"
},
"didResolutionMetadata": {
"type": "object",
"properties": {
"contentType": {
"type": "string"
},
"error": {
"type": "string"
},
"errorMessage": {
"type": "string"
}
},
"required": [
"contentType",
"error",
"errorMessage"
]
"errorMessage": {
"type": "string"
}
},
"required": [
"@context",
"didDocument",
"didDocumentMetadata",
"didResolutionMetadata"
"contentType",
"error",
"errorMessage"
]
}
},
"required": [
"data"
"@context",
"didDocument",
"didDocumentMetadata",
"didResolutionMetadata"
]
}
},
"required": [
"evaluationID",
"result"
"data"
]
}
\ No newline at end of file
......@@ -2,105 +2,112 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"evaluationID": {
"type": "string"
},
"result": {
"data": {
"type": "object",
"properties": {
"data": {
"@context": {
"type": "string"
},
"didDocument": {
"type": "object",
"properties": {
"@context": {
"type": "string"
},
"didDocument": {
"type": "object",
"properties": {
"authentication": {
"type": "array",
"items": [
{
"type": "string"
}
]
"type": "array",
"items": [
{
"type": "string"
},
"id": {
{
"type": "string"
},
"verificationMethod": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"controller": {
"type": "string"
},
"id": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"controller",
"id",
"type"
]
}
]
{
"type": "string"
}
},
"required": [
"authentication",
"id",
"verificationMethod"
]
},
"didResolutionMetadata": {
"type": "object",
"properties": {
"did": {
"authentication": {
"type": "array",
"items": [
{
"type": "string"
}
]
},
"id": {
"type": "string"
},
"verificationMethod": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"didString": {
"controller": {
"type": "string"
},
"method": {
"id": {
"type": "string"
},
"methodSpecificId": {
"type": {
"type": "string"
}
},
"required": [
"didString",
"method",
"methodSpecificId"
"controller",
"id",
"type"
]
}
]
}
},
"required": [
"@context",
"authentication",
"id",
"verificationMethod"
]
},
"didResolutionMetadata": {
"type": "object",
"properties": {
"contentType": {
"type": "string"
},
"did": {
"type": "object",
"properties": {
"didString": {
"type": "string"
},
"method": {
"type": "string"
},
"methodSpecificId": {
"type": "string"
}
},
"required": [
"did"
"didString",
"method",
"methodSpecificId"
]
}
},
"required": [
"@context",
"didDocument",
"didResolutionMetadata"
"contentType",
"did"
]
}
},
"required": [
"data"
"@context",
"didDocument",
"didResolutionMetadata"
]
}
},
"required": [
"evaluationID",
"result"
"data"
]
}
\ No newline at end of file
......@@ -2,23 +2,11 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"evaluationID": {
"type": "string"
},
"result": {
"type": "object",
"properties": {
"allow": {
"type": "boolean"
}
},
"required": [
"allow"
]
"allow": {
"type": "boolean"
}
},
"required": [
"evaluationID",
"result"
"allow"
]
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST
Background:
Given we are testing the TSA Policy Api
@wip
Scenario: TSA - Evaluate policy synchronously - Positive
Given I load the REST request {Policy.json} with profile {successful_evaluate}
And I execute the policy {/policy/example/test/1.0/evaluation}
......@@ -43,7 +43,7 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST
And I execute the policy {/policy/example/resolve/1.0/evaluation}
Then the status code should be {200}
And the response is valid according to the {Policy_EvaluateDID_schema.json} REST schema
And the field {result.data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
And the field {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
@negative
Scenario: TSA - Evaluate policy with incorrect value - Negative
......@@ -51,14 +51,14 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST
And I execute the policy {/policy/example/test/1.0/evaluation}
Then the status code should be {200}
And the response is valid according to the {Policy_Evaluate_schema.json} REST schema
And the field {result.allow} has the value {false}
And the field {allow} has the value {false}
@negative
Scenario: TSA - Evaluate policy with missing body- Negative
Given I execute the policy {/policy/example/test/1.0/evaluation}
Then the status code should be {400}
And the response is valid according to the {Policy_Evaluate_negative_schema.json} REST schema
And the field {message} has the value {missing required payload}
Then the status code should be {200}
And the response is valid according to the {Policy_Evaluate_schema.json} REST schema
And the field {allow} has the value {false}
@negative
Scenario: TSA - Evaluate missing policy - Negative
......@@ -68,10 +68,10 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST
And the response is valid according to the {Policy_Evaluate_negative_schema.json} REST schema
And the field {message} has the value {error evaluating policy}
@negative @issue-35
@negative @issue-35 @test
Scenario: TSA - DID resolution with incorrect did - Negative
Then I load the REST request {Policy.json} with profile {didResolve_missing_method}
And I execute the policy {/policy/example/resolve/1.0/evaluation}
Then the status code should be {200}
And the response is valid according to the {Policy_EvaluateDID_negative_schema.json} REST schema
And the field {result.data.didResolutionMetadata.error} has the value {notFound}
And the field {data.didResolutionMetadata.error} has the value {notFound}
......@@ -43,10 +43,10 @@ Feature: API -TSA - Task - v1/task GET
And I send the current request to endpoint {v1/taskResult} with container value{taskID}
Then the status code should be {200}
And the response is valid according to the {Task_ExecuteDID_schema.json} REST schema
And the field {result.data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
And the field {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
# Test the Cache Service
Then I load object with key {taskID} from DataContainer into currentRequest HEADER {x-cache-key}
And I send the current request as GET to endpoint {https://gaiax.vereign.com/tsa/cache/v1/cache}
And the status code should be {200}
And the response is valid according to the {Task_ExecuteDID_schema.json} REST schema
And the field {result.data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
\ No newline at end of file
And the field {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
\ No newline at end of file
......@@ -42,7 +42,7 @@ Feature: API -TSA - Task - v1/task POST
And I send the current request to endpoint {v1/taskResult} with container value{taskID}
Then the status code should be {200}
And the response is valid according to the {Task_ExecuteDID_schema.json} REST schema
And the field {result.data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
And the field {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
@negative
Scenario: TSA - Executing Task with non existing task template - Negative
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment