From 4c89bca461a817d640793d9fcc05d1cc2f66f6ba Mon Sep 17 00:00:00 2001 From: "georgi.michev" <georgi.michev@vereign.com> Date: Tue, 28 Jun 2022 18:02:50 +0300 Subject: [PATCH] change the DID from indy to key Signed-off-by: georgi.michev <georgi.michev@vereign.com> --- src/main/resources/REST/json/Policy.json | 5 ++++- .../REST/schemas/Policy_EvaluateDID_schema.json | 4 ---- .../{group}/{name}/{version}/evaluation/POST.feature | 6 +++--- .../features/tsa/task/v1/task/{taskName}/GET.feature | 10 +++++----- .../features/tsa/task/v1/task/{taskName}/POST.feature | 6 +++--- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/main/resources/REST/json/Policy.json b/src/main/resources/REST/json/Policy.json index 9ecb0593..d7a8debb 100644 --- a/src/main/resources/REST/json/Policy.json +++ b/src/main/resources/REST/json/Policy.json @@ -5,9 +5,12 @@ "unsuccessful_evaluate": { "message": "wrong value!" }, - "didResolve_evaluate": { + "didResolve_indy_evaluate": { "did":"did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE" }, + "didResolve_evaluate": { + "did":"did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6" + }, "didResolve_missing_method": { "did":"did:idunion:BDrEcHc8Tb4Lb2VyQZWEDE" } diff --git a/src/main/resources/REST/schemas/Policy_EvaluateDID_schema.json b/src/main/resources/REST/schemas/Policy_EvaluateDID_schema.json index 5366333a..5af228b1 100644 --- a/src/main/resources/REST/schemas/Policy_EvaluateDID_schema.json +++ b/src/main/resources/REST/schemas/Policy_EvaluateDID_schema.json @@ -40,9 +40,6 @@ "id": { "type": "string" }, - "publicKeyBase58": { - "type": "string" - }, "type": { "type": "string" } @@ -50,7 +47,6 @@ "required": [ "controller", "id", - "publicKeyBase58", "type" ] } 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 6facb008..5b6be0e9 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 @@ -37,13 +37,13 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST And the response is valid according to the {Policy_Evaluate_schema.json} REST schema And the field {result.allow} has the value {true} - @bug @issue-35 + @issue-35 Scenario: TSA - DID resolution - Positive Given I load the REST request {Policy.json} with profile {didResolve_evaluate} 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:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE} + And the field {result.data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6} @negative Scenario: TSA - Evaluate policy with incorrect value - Negative @@ -68,7 +68,7 @@ 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 @bug @issue-35 + @negative @issue-35 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} 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 446f7dcb..66176933 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 @@ -30,7 +30,7 @@ Feature: API -TSA - Task - v1/task GET Background: Given we are testing the TSA Task Api - @bug @issue-35 + @issue-35 Scenario: TSA - Executing Task with DID resolver and Evaluate the Cache - Positive Given I load the REST request {Policy.json} with profile {didResolve_evaluate} And I send the current request as POST to endpoint {/v1/task/didResolve} @@ -40,13 +40,13 @@ Feature: API -TSA - Task - v1/task GET Then I get the value of {taskID} from the last response and store it in the DataContainer with key {taskID} Then I clear the request body And I wait for {2000} mseconds - And I send the current request to endpoint {taskResult} with container value{taskID} + 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:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE} + And the field {result.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 {http://localhost:8083/v1/cache} + 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:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE} \ No newline at end of file + And the field {result.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 2d135477..458018e7 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 @@ -30,7 +30,7 @@ Feature: API -TSA - Task - v1/task POST Background: Given we are testing the TSA Task Api - @bug @issue-35 + @issue-35 Scenario: TSA - Executing Task with DID resolver - Positive Then I load the REST request {Policy.json} with profile {didResolve_evaluate} And I send the current request as POST to endpoint {/v1/task/didResolve} @@ -39,10 +39,10 @@ Feature: API -TSA - Task - v1/task POST Then I get the value of {taskID} from the last response and store it in the DataContainer with key {taskID} Then I clear the request body And I wait for {2000} mseconds - And I send the current request to endpoint {taskResult} with container value{taskID} + 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:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE} + And the field {result.data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6} @negative Scenario: TSA - Executing Task with non existing task template - Negative -- GitLab