diff --git a/main.go b/main.go index 37f261e..ee53f9d 100644 --- a/main.go +++ b/main.go @@ -30,7 +30,7 @@ var ( type Options struct { Provider string Project string - Prefix string + Filter string Parser string Template string Output string @@ -39,13 +39,13 @@ type Options struct { func main() { options := &Options{} - flag.StringVar(&options.Provider, "provider", "gcp", "") - flag.StringVar(&options.Project, "project", "", "") - flag.StringVar(&options.Prefix, "secret-prefix", "", "") - flag.StringVar(&options.Parser, "secret-data-parser", "plaintext", "") - flag.StringVar(&options.Template, "template", "", "") - flag.StringVar(&options.Output, "output", "", "") - v := flag.Bool("version", false, "") + flag.StringVar(&options.Provider, "provider", "gcp", "name of the provider that manages the secrets") + flag.StringVar(&options.Project, "project", "", "gcp project that contains the secrets") + flag.StringVar(&options.Filter, "filter", "", "regex to filter secrets by name") + flag.StringVar(&options.Parser, "data-parser", "plaintext", "parse secret based on data type") + flag.StringVar(&options.Template, "template", "", "template to render secret data") + flag.StringVar(&options.Output, "output", "", "path to write output file to") + v := flag.Bool("version", false, "show the current secrets-init version") flag.Parse() diff --git a/provider_test.go b/provider_test.go index c4c51cd..79b5fc0 100644 --- a/provider_test.go +++ b/provider_test.go @@ -28,6 +28,11 @@ func TestFilter(t *testing.T) { `^myapp*|^xxx*`, false, }, + { + "app_password", + ``, + true, + }, } gcp := &GCPSecretManager{} diff --git a/runner.go b/runner.go index e9de45d..b994063 100644 --- a/runner.go +++ b/runner.go @@ -36,7 +36,7 @@ func Run(options *Options) error { return err } - data, err := provider.ListSecrets(options.Project, options.Prefix) + data, err := provider.ListSecrets(options.Project, options.Filter) if err != nil { return err }