It contains the API for policy operations. The REST protocol is adopted.
type | route | description |
---|---|---|
GET | /policies/ |
Retrieves all policies |
POST | /policies/ |
Creates a new policy |
GET | /policies/<string:id> |
Retrives one policy |
PUT | /policies/<string:id> |
Updates one policy |
DELETE | /policies/<string:id> |
Deletes one policy |
POST | /execute/<string:id> |
Executes one policy |
PolicyDB is a SQLite local file responsible for storing Policies
.
Each Database Entity is located in the Models
folder.
SQLAlchemy is the chosen SQLClient. All db operations are tied to each respective endpoint in the Routes
folder.
ExecutionEngine code is found under the modules
folder.
Each edge
holds information pointing either to an end
, start
, or conditional
node.
In essence, the execution engine navigates from node to node
, based on each edge target
and source
fields.
Each iteration uses recursion to either execute the operation inside the conditional
node and go to the next node or return one decision
node.
There are three types of nodes:
- Start: It represents the start of the decision three.
- Conditional: Executes one comparison operations between variables.
- End: Holds the decision value. Only two are possible:
True
orFalse
.
Pytest is the choosen test runner. For running the test suite execute:
yarn test
yarn lint