stotem/README.md

30 lines
1.2 KiB
Markdown
Raw Normal View History

2022-10-08 03:15:56 +00:00
This tool aims to simplify setting up local reproduction environments for writing and testing Sentinel policies.
At present, navigate to your sentinel policy directory (containing the .hcl) and run `main.js` there.
2022-10-10 04:07:25 +00:00
2022-10-10 22:44:36 +00:00
## Build instructions:
### TODO: Remediate required double install. Probably because I'm using `nvm`
### TODO: Fix uninstall
Clone the directory locally, then navigate to that directory and run `npm install`.
Next, run `npm run build`
Finally, run `npm install -g` if you want `stotem` in your path
2022-10-10 16:18:01 +00:00
## Current functionality:
2022-10-10 16:18:47 +00:00
Checks the CURRENT DIRECTORY recursively(via vsCode's [ripgrep package](https://github.com/microsoft/vscode-ripgrep))
2022-10-10 16:20:12 +00:00
for references to the Hashicorp Sentinel [governance repo](https://github.com/hashicorp/terraform-sentinel-policies) helper functions and
2022-10-10 04:07:25 +00:00
adds them as http imports to sentinel.hcl if found.
2022-10-10 16:18:01 +00:00
## Planned functionality:
2022-10-10 04:33:41 +00:00
WORKING TESTS
2022-10-10 16:16:53 +00:00
2022-10-10 04:07:25 +00:00
Check for v1 imports and print a warning if they're in use
Provide a command line flag to show what values will be `after_unknown`
TBD:
Considering whether an offline/local mode is worth implementing. This would work by replacing the https heredocs with local copies of repo functions included with an
2022-10-10 16:16:53 +00:00
npm tarball (or just include it directly in this package)