Skip to content

Commit

Permalink
fix: don't allow spaces in vault names
Browse files Browse the repository at this point in the history
  • Loading branch information
gak committed May 21, 2024
1 parent a48a08e commit a7e5f23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions common/configuration/1password_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func (o OnePasswordProvider) Store(ctx context.Context, ref Ref, value []byte) (
if err := checkOpBinary(); err != nil {
return nil, err
}
if strings.Contains(o.Vault, " ") {
return nil, fmt.Errorf("1Password vault name %q contains spaces, which is not supported", o.Vault)
}

var secret string
err := json.Unmarshal(value, &secret)
Expand Down
4 changes: 2 additions & 2 deletions common/configuration/1password_provider_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build 1password

// 1password needs to be running and have a vault named "ftl test".
// 1password needs to be running and have a vault named "ftl-test".
//
// These tests will clean up before and after itself.

Expand All @@ -16,7 +16,7 @@ import (
"github.com/TBD54566975/ftl/internal/log"
)

const vault = "ftl test"
const vault = "ftl-test"
const module = "test.module"

func clean(ctx context.Context) bool {
Expand Down

0 comments on commit a7e5f23

Please sign in to comment.