diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3d725761b024d751249c39109b359366c6931bc6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +.idea \ No newline at end of file diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000000000000000000000000000000000000..900ff202a34465e3d5c11174f0fd14c7faa56c91 --- /dev/null +++ b/TODO.md @@ -0,0 +1,29 @@ +[d] Evaluating policy synchronously + - Creating git infrastructure for the policies with the flow documentation. Will follow with feature branch with dev and production branch. Let's use [policies repo of the code.gitlab](https://code.vereign.com/gaiax/tsa/policies) to push policies. Git is a dependency should be preinstalled. + + - @kalin Create an environment to demonstrate + - Kubernetes + - Mongo Replicaset 1 primary and 2 secondary(v3.6) + - Redis + - Create a pipeline to sync the committed policy with MongoDB + - @yuli Create a script to syncrhonise the data from Git to Mongo + - @dancho Sync policies from Mongo (replicaset deployment) with the policy services + + @penkovski Create a service with endpoint to evaluate the policy + - Create an example policy for the tests and demonstration + - @rosen Implement the test logic +[] Implement the CI pipeline to test the service. + - imlement the simplest test. + - setup the Gitlab pipeline. Pick the simplest trigger event + +[d] Distributed cache feature + - create Rego extensions + + create HTTP service + - create 2 example policies (1 for setting value, 1 for getting value) + - Implement the test logic +[] Persistance feature +[] Resolving DID +[] Evaluating policy asynchronously +Evaluatating policy groups asynchronously +Crypto libs to work with ursa (sign, key management) +Policy to generate an endpoint in Kong +Communication with OCM diff --git a/features/distributedCache.feature b/features/distributedCache.feature new file mode 100644 index 0000000000000000000000000000000000000000..87aa9dbc07f45eac46aabdaaae045bfd9ae2c146 --- /dev/null +++ b/features/distributedCache.feature @@ -0,0 +1,20 @@ +As policy administrator +I want to have distributed cache feature provided +So I am able to use cache functionality in my custom policies + +Scenario: Working with cache +Given one policy to set the value in the cache is uploaded to the system +And the second policy to get the value from the cache is uploaded to the system as well +When I evaluate policy to set the value in the cache +And get a successful response +When I evaluate policy to get the value from the cache +Then I get a successful response +And response body is not empty + + +Acceptance criteria: +- The plugin for rego language to get/set values is ready to use +- The working example how to use the plugin +- Green test based on example commited to the system + + diff --git a/features/evaluatePolicyAsync.feature b/features/evaluatePolicyAsync.feature new file mode 100644 index 0000000000000000000000000000000000000000..31f6d7d47811d2f1549f17049acde7d1a9efcaff --- /dev/null +++ b/features/evaluatePolicyAsync.feature @@ -0,0 +1,24 @@ +As user +I want to evaluate the policy asyncronously +So I am able to execute the developed Rego code in the future non-blocking + +Scenario: Evaluate the policy asyncronously +Given long running policy is uploaded to the system +And the task template is uploaded to the system +When I evaluate the policy asyncronously +And the task template is specifyed as an input +When I get successful response +And the response contains taskId + +Scenario: Getting the result for the executed policy +Given long running policy is executed +When I request the result of execution +And request contains the taskId +And the task has finished +Then I get successful response +And esponse contains the result of execution of the policy + +Acceptance criteria: +- HTTP endpoints to evalute the policy asyncronously and get the result +- example of long-running policy commited to Git repo +- Green test based on example commited to the system diff --git a/features/evaluatePolicySync.feature b/features/evaluatePolicySync.feature new file mode 100644 index 0000000000000000000000000000000000000000..cfdf0cf5982bcdad1d1df9c48c7ca2f875ec2bd3 --- /dev/null +++ b/features/evaluatePolicySync.feature @@ -0,0 +1,16 @@ +As user +I want to evaluate the policy +So I am able to execute it in the future + +Scenario: Execute the policy +When I upload the policy to repository +And set the policy to productive +And the policy successfully uploaded to the system +When I execute the policy +Then I get successful response +And response contains the result of execution of the policy + +Acceptance criteria: +- HTTP endpoint to evaluate the policy +- example policy created and commited to Git repo +- Green test based on example commited to the system \ No newline at end of file diff --git a/features/persistance.feature b/features/persistance.feature new file mode 100644 index 0000000000000000000000000000000000000000..d77d0055a79b6d5d5bfcaca29ecff8ae72c8ff5d --- /dev/null +++ b/features/persistance.feature @@ -0,0 +1,17 @@ +As policy administrator +I want to have persistence functionality +So I am able to store the json document inside of the database + +Scenario: Store data inside of database +Given one policy to set the value in the database is uploaded to the system +And the second policy to query the value from the database is uploaded to the system as well +When I store the json document inside of the database +And get a successful response +When I evaluate policy to get the value from the database +Then I get a successful response +And response body is not empty + +Acceptance criteria: +- plugin for rego language to set/query values is ready to use +- example of usage of the plugin commited to the system +- green tests based on example commited to the system \ No newline at end of file diff --git a/features/resolveDID.feature b/features/resolveDID.feature new file mode 100644 index 0000000000000000000000000000000000000000..26d8995e5fa2d4dcb7007a7bf59d2422937e08ac --- /dev/null +++ b/features/resolveDID.feature @@ -0,0 +1,17 @@ +As policy administrator +I want to evaluate resolving DID feature +So I am able to use my DID features in the custom policies + +Scenario: DID resolution +Given DID document is published +And the policy to resolve did is uploaded to the system +When I send a request containing DID +And DID method is in the list of supported ones +Then I get successful response +And response contains DID document + +Acceptance criteria: +- published did document +- plugin for rego language to get/set values is ready to use +- example of usage of the plugin commited to the system +- green tests based on example commited to the system \ No newline at end of file