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

Merge branch '3-test-call-of-external-urls' into 'main'

Add validate policy output by JSON schema tests

Closes #3 and #7

See merge request !56
parents c5b849ba 808eb511
No related branches found
No related tags found
1 merge request!56Add validate policy output by JSON schema tests
Pipeline #68919 passed with stage
in 6 minutes and 18 seconds
......@@ -35,6 +35,20 @@ Feature: API -TSA - Policy - {repository}/{group}/{name}/{version}/evaluation PO
Then the status code should be {200}
And the field {key} has the value {someValue}
@phase2 @IDM.TSA.E1.00013
Scenario: TSA - Calling external URL - Positive
When I execute the Policy group {example} name {externalURL} version {1.0} via TSA Policy API
Then the status code should be {200}
And the field {body.service} has the value {policy}
And the field {body.status} has the value {up}
And the field {status} has the value {200 OK}
@phase2 @IDM.TSA.E1.00013
Scenario: TSA - DID resolution using external URL - Positive
When I execute the Policy group {example} name {externalURL} version {1.1} via TSA Policy API
Then the status code should be {200}
And the field {body.data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
Scenario: TSA - using multiple header values for policy execution - Positive
When I load the REST request {Policy.json} with profile {empty}
And I load value {someValue} into current request HEADER {X-Cache-Key}
......
#Copyright (c) 2023 Vereign AG [https://www.vereign.com]
@rest @all @tsa @policy @phase2 @IDM.TSA.E1.00005 @IDM.TSA.E1.00006
@rest @all @tsa @policy @phase2 @IDM.TSA.E1.00005 @IDM.TSA.E1.00006 @IDM.TSA.E1.00011
Feature: API - TSA - policy - {repository}/{group}/{name}/{version}/export GET
As user
I want to be able to export policy
......
......@@ -506,5 +506,31 @@
"dataConfig": "{\n \"url\": \"http://example.com/data.json?page=3\",\n \"method\": \"GET\",\n \"period\": \"10h\",\n \"body\": {\n \"key\": \"value\"\n }\n}\n",
"exportConfig": "{\n\t\"namespace\":\"transit\",\n\t\"key\":\"key1\"\n}",
"outputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"foo\": {\n \"type\": \"string\",\n \"minLength\": 5\n }\n }\n}"
},
{
"_id": {"$oid": "657c5a7718f39c409b152a70"},
"filename": "example/externalURL/1.0/policy.rego",
"group": "example",
"locked": false,
"name": "externalURL",
"rego": "package example.externalURL\n\n_ := http.send({\"method\": \"get\", \"url\": \"https://vault.vereign.com/tsa/policy/liveness\"})",
"repository": "policies",
"version": "1.0"
},
{
"_id": {"$oid": "657c5c7c18f39c409b152a71"},
"filename": "example/externalURL/1.1/policy.rego",
"group": "example",
"lastUpdate": null,
"locked": false,
"name": "externalURL",
"rego": "package example.externalURL\n\n_ := http.send({\n \"method\": \"post\",\n \"url\": \"https://vault.vereign.com/tsa/policy/policy/policies/example/resolve/1.0/evaluation\",\n \"body\": {\"did\": \"did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6\"}\n})",
"repository": "policies",
"version": "1.1",
"data": null,
"dataConfig": null,
"nextDataRefreshTime": null,
"exportConfig": null,
"outputSchema": null
}
]
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