feat: Spring Boot config files in repos (#79)
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
This commit was merged in pull request #79.
This commit is contained in:
1 parent
39cbac9aab
commit
96395cb6a2
15 files changed
+733
-18
No files matched your search
@@ -15,6 +15,7 @@ import (
|
||||
"go.yaml.in/yaml/v3"
|
||||
|
||||
"git.kebcloud.no/keb/lazysecrets/internal/commands"
|
||||
"git.kebcloud.no/keb/lazysecrets/internal/provider/repo"
|
||||
"git.kebcloud.no/keb/lazysecrets/internal/share"
|
||||
"git.kebcloud.no/keb/lazysecrets/internal/update"
|
||||
)
|
||||
@@ -153,6 +154,8 @@ type Repos struct {
|
||||
// a repo's .sops.yaml creation_rules say where to look.
|
||||
Include []string `yaml:"include"`
|
||||
Exclude []string `yaml:"exclude"`
|
||||
// Spring says which keys of Spring Boot config files are secrets.
|
||||
Spring repo.SpringPatterns `yaml:"spring"`
|
||||
}
|
||||
|
||||
type Azure struct {
|
||||
@@ -292,6 +295,9 @@ func (c Config) validate(path string) error {
|
||||
return fmt.Errorf("%s: %s: %s is negative", path, name, d)
|
||||
}
|
||||
}
|
||||
if err := c.Providers.Repos.Spring.Check(); err != nil {
|
||||
return fmt.Errorf("%s: providers.repos.%w", path, err)
|
||||
}
|
||||
for i, v := range c.Providers.Azure.Vaults {
|
||||
if !strings.HasPrefix(v, "https://") {
|
||||
return fmt.Errorf("%s: providers.azure.vaults[%d]: %q is not an https:// vault URL", path, i, v)
|
||||
|
||||
@@ -84,6 +84,7 @@ func TestLoadRejectsMistakes(t *testing.T) {
|
||||
"workspace": "sharing:\n key: \"{{secrets/team/env-share}}\"\n",
|
||||
"short keys": "sharing:\n keyRules:\n minLength: 8\n",
|
||||
"classes": "sharing:\n keyRules:\n minClasses: 5\n",
|
||||
"regexp": "providers:\n repos:\n spring:\n keys: [\"(pass\"]\n",
|
||||
} {
|
||||
if _, err := LoadAll([]string{write(t, content)}); err == nil {
|
||||
t.Errorf("%s: no error", name)
|
||||
|
||||
Reference in new issue
Block a user