move meta from comments into README
This commit is contained in:
parent
9bdce4d0a3
commit
07a17db7de
14
README.md
14
README.md
|
@ -1,3 +1,17 @@
|
||||||
This tool aims to simplify setting up local reproduction environments for writing and testing Sentinel policies.
|
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.
|
At present, navigate to your sentinel policy directory (containing the .hcl) and run `main.js` there.
|
||||||
|
|
||||||
|
Current functionality:
|
||||||
|
Checks the CURRENT DIRECTORY recursively(via vsCode's ripgrep package)
|
||||||
|
for references to the Hashicorp governance repo common-functions and
|
||||||
|
adds them as http imports to sentinel.hcl if found.
|
||||||
|
|
||||||
|
Planned functionality:
|
||||||
|
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
|
||||||
|
npm tarball (or just include it directly in this package)
|
|
@ -5,11 +5,6 @@ import { exit } from "process";
|
||||||
import {generateHereDoc, functionUrls} from "./configHeredoc";
|
import {generateHereDoc, functionUrls} from "./configHeredoc";
|
||||||
import {ripGrep} from "./ripGrep";
|
import {ripGrep} from "./ripGrep";
|
||||||
|
|
||||||
|
|
||||||
//TODO: Consider whether a local symlink mode might make sense for when writing policies and
|
|
||||||
// https module sources are unavailable for whatever reason
|
|
||||||
// Maybe this repo should track the governance repo or pull in those files
|
|
||||||
|
|
||||||
// Check for the presence of sentinel.hcl, or else one gets created
|
// Check for the presence of sentinel.hcl, or else one gets created
|
||||||
const ensureFileExists = async (filename: string) => {
|
const ensureFileExists = async (filename: string) => {
|
||||||
try {
|
try {
|
||||||
|
@ -36,7 +31,6 @@ const checkForCommonFunctions = async (functionsArray: Array<string>) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
console.log('Starting checks');
|
|
||||||
//make sure you're in the right directory to avoid nonsense
|
//make sure you're in the right directory to avoid nonsense
|
||||||
ensureFileExists('sentinel.hcl');
|
ensureFileExists('sentinel.hcl');
|
||||||
checkForCommonFunctions(Object.keys(functionUrls));
|
checkForCommonFunctions(Object.keys(functionUrls));
|
||||||
|
|
Loading…
Reference in a new issue