Check storage_url with the storage parser at config load (closes #468)
check / check (push) Waiting to run
check / check (push) Waiting to run
config set accepted rclone:// values that every command then refused: no remote name, parameters in the remote name, a query parameter. The config only checked the URL's prefix, because config could not import the parser from storage, which imports config. The parser moves from internal/storage to a new package, internal/storageurl, that both import. ParseStorageURL becomes storageurl.Parse. Loading the config now runs it on every storage_url, so config set refuses such a value and leaves the file unchanged. Model: opus-5-5
This commit was merged in pull request #472.
This commit is contained in:
1 parent
be362080d3
commit
57b5cb327b
8 files changed
+133
-129
No files matched your search
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"sneak.berlin/go/vaultik/internal/chunker"
|
||||
"sneak.berlin/go/vaultik/internal/log"
|
||||
"sneak.berlin/go/vaultik/internal/storageurl"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -502,8 +503,8 @@ func TestLoadRejectsRelativeFileURL(t *testing.T) {
|
||||
}
|
||||
|
||||
_, err = Load(path)
|
||||
if !errors.Is(err, errFileURLNotAbsolute) {
|
||||
t.Fatalf("Load() error = %v, want errFileURLNotAbsolute", err)
|
||||
if !errors.Is(err, storageurl.ErrRelativeFilePath) {
|
||||
t.Fatalf("Load() error = %v, want storageurl.ErrRelativeFilePath", err)
|
||||
}
|
||||
|
||||
if !strings.Contains(err.Error(), "absolute path") {
|
||||
|
||||
Reference in new issue
Block a user