This PR aims to help create a new policy file using a default template. See #47 for more details. While it only creates a new policy file based on a default template, we can extend this feature to create more custom policies in future.
Details:
A new CLI command new -p (--policy) is added that creates a base python file (inside "policies' directory) with policy template and commented test codes. The templating is done using jinja2 (added as a new dependency).
This workflow will create policy file (python file) based on user input. The input is used to create a python file name, class name, policy name and test name. Since the current code assumes a class name to be "Teleport", I have also added a simple function to retrieve class name using ast. Existing export, deploy and test commands are updated to support this change.
This PR aims to help create a new policy file using a default template. See #47 for more details. While it only creates a new policy file based on a default template, we can extend this feature to create more custom policies in future.
Details:
A new CLI command
new -p (--policy)
is added that creates a base python file (inside "policies' directory) with policy template and commented test codes. The templating is done using jinja2 (added as a new dependency).This workflow will create policy file (python file) based on user input. The input is used to create a python file name, class name, policy name and test name. Since the current code assumes a class name to be "Teleport", I have also added a simple function to retrieve class name using ast. Existing
export
,deploy
andtest
commands are updated to support this change.