From 07a17db7de6d35fb00ef01c7b14f45df5891ac10 Mon Sep 17 00:00:00 2001 From: Sean Meininger Date: Sun, 9 Oct 2022 21:07:25 -0700 Subject: [PATCH] move meta from comments into README --- README.md | 14 ++++++++++++++ src/main.ts | 6 ------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 624c696..a41e5a3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ 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. + +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) \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 53ad798..55b676a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,11 +5,6 @@ import { exit } from "process"; import {generateHereDoc, functionUrls} from "./configHeredoc"; 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 const ensureFileExists = async (filename: string) => { try { @@ -36,7 +31,6 @@ const checkForCommonFunctions = async (functionsArray: Array) => { } const main = async () => { - console.log('Starting checks'); //make sure you're in the right directory to avoid nonsense ensureFileExists('sentinel.hcl'); checkForCommonFunctions(Object.keys(functionUrls));