diff --git a/src/main/resources/REST/schemas/Policy_EvaluateDID_negative_schema.json b/src/main/resources/REST/schemas/Policy_EvaluateDID_negative_schema.json index 25fe0ec626a05ef9d7af9205348bd12541f4d408..f8694063f96579419c3537036404d7c1f2c375f3 100644 --- a/src/main/resources/REST/schemas/Policy_EvaluateDID_negative_schema.json +++ b/src/main/resources/REST/schemas/Policy_EvaluateDID_negative_schema.json @@ -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 diff --git a/src/main/resources/REST/schemas/Policy_EvaluateDID_schema.json b/src/main/resources/REST/schemas/Policy_EvaluateDID_schema.json index 5af228b1623a683b3dfeb0fff0afa3ec75d3c93e..2a60a0baf3dd7a327e537b9351a859f9d2108b93 100644 --- a/src/main/resources/REST/schemas/Policy_EvaluateDID_schema.json +++ b/src/main/resources/REST/schemas/Policy_EvaluateDID_schema.json @@ -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 diff --git a/src/main/resources/REST/schemas/Policy_Evaluate_schema.json b/src/main/resources/REST/schemas/Policy_Evaluate_schema.json index 3acde7b9d7b5926fdcd44cdc043980c67725ca8b..f2288d609e4aa5f1140246e487728b8b9cb2c10e 100644 --- a/src/main/resources/REST/schemas/Policy_Evaluate_schema.json +++ b/src/main/resources/REST/schemas/Policy_Evaluate_schema.json @@ -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 diff --git a/src/test/resources/features/tsa/policy/policy/{group}/{name}/{version}/evaluation/POST.feature b/src/test/resources/features/tsa/policy/policy/{group}/{name}/{version}/evaluation/POST.feature index 5b6be0e99b9a141456fed7fb058c5bd8473906d6..724166a0b2691d16923026e64b2b0c257f3c8500 100644 --- a/src/test/resources/features/tsa/policy/policy/{group}/{name}/{version}/evaluation/POST.feature +++ b/src/test/resources/features/tsa/policy/policy/{group}/{name}/{version}/evaluation/POST.feature @@ -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} diff --git a/src/test/resources/features/tsa/task/v1/task/{taskName}/GET.feature b/src/test/resources/features/tsa/task/v1/task/{taskName}/GET.feature index 661769333b50faf8ae2e0c39372c7ef9692e1b2b..6d87b1cae1d4668e793e0e864787a0c53de2ab97 100644 --- a/src/test/resources/features/tsa/task/v1/task/{taskName}/GET.feature +++ b/src/test/resources/features/tsa/task/v1/task/{taskName}/GET.feature @@ -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 diff --git a/src/test/resources/features/tsa/task/v1/task/{taskName}/POST.feature b/src/test/resources/features/tsa/task/v1/task/{taskName}/POST.feature index 458018e7b8df243daf81311fa388bf121daa1f1c..ffa38824665b6ac9ebb3e31baadb20a7361b3d88 100644 --- a/src/test/resources/features/tsa/task/v1/task/{taskName}/POST.feature +++ b/src/test/resources/features/tsa/task/v1/task/{taskName}/POST.feature @@ -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