Skip to content

Commit 058ddd9

Browse files
committed
specify the supported backends clearly
* We'll support only "rekor" and "local". * Dropping the alias "file" backend for "local" backend. resolves: EC-1309
1 parent fdf1109 commit 058ddd9

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

internal/validate/vsa/storage.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type SignerAwareUploader interface {
4141

4242
// StorageConfig represents parsed storage configuration
4343
type StorageConfig struct {
44-
Backend string // rekor, local, etc.
44+
Backend string // rekor, local (maybe others in future)
4545
BaseURL string // Primary URL
4646
Parameters map[string]string // Additional parameters
4747
}
@@ -83,7 +83,7 @@ func ParseStorageFlag(storageFlag string) (*StorageConfig, error) {
8383
}
8484

8585
// Validate that backend is supported
86-
supportedBackends := []string{"rekor", "local", "file"}
86+
supportedBackends := []string{"rekor", "local"}
8787
isSupported := false
8888
for _, supported := range supportedBackends {
8989
if strings.ToLower(config.Backend) == supported {
@@ -133,7 +133,7 @@ func CreateStorageBackend(config *StorageConfig) (StorageBackend, error) {
133133
switch strings.ToLower(config.Backend) {
134134
case "rekor":
135135
return NewRekorBackend(config)
136-
case "local", "file":
136+
case "local":
137137
return NewLocalBackend(config)
138138
default:
139139
return nil, fmt.Errorf("unsupported storage backend: %s. Supported backends: rekor, local", config.Backend)

internal/validate/vsa/storage_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,6 @@ func TestCreateStorageBackend(t *testing.T) {
129129
expectError: false,
130130
expectType: "*vsa.LocalBackend",
131131
},
132-
{
133-
name: "file backend (alias for local)",
134-
config: &StorageConfig{
135-
Backend: "file",
136-
BaseURL: "/tmp/vsa",
137-
},
138-
expectError: false,
139-
expectType: "*vsa.LocalBackend",
140-
},
141132
{
142133
name: "unsupported backend",
143134
config: &StorageConfig{

0 commit comments

Comments
 (0)