Check storage_url with the storage parser at config load (closes #468) #472

Open
clawbot wants to merge 1 commits from issue-468-config-checks-rclone-url into next
pull from: issue-468-config-checks-rclone-url
Collaborator

closes #468

config set storage_url accepted malformed rclone:// values (no remote name, parameters in the remote name, a query parameter) that every command then refused. 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/url.go to a new package, internal/storageurl, which config and storage both import. storage.ParseStorageURL becomes storageurl.Parse; the scheme names are exported for storage.
  • validateStorageURL calls storageurl.Parse on every storage_url, then requires the S3 keys for s3:// as before.
  • config set tests cover the three values from the issue.

Judgement call: the check now covers every scheme, not only rclone://, since one parser call replaced the per-scheme prefix checks. An s3:// URL the parser rejects (a credential in it, an unknown parameter, no bucket) now fails at load instead of when a command opens the destination. The file:// and unknown-scheme errors now carry the parser's wording.

Model: opus-5-5

closes https://git.eeqj.de/sneak/vaultik/issues/468 `config set storage_url` accepted malformed `rclone://` values (no remote name, parameters in the remote name, a query parameter) that every command then refused. 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/url.go` to a new package, `internal/storageurl`, which `config` and `storage` both import. `storage.ParseStorageURL` becomes `storageurl.Parse`; the scheme names are exported for `storage`. - `validateStorageURL` calls `storageurl.Parse` on every `storage_url`, then requires the S3 keys for `s3://` as before. - `config set` tests cover the three values from the issue. Judgement call: the check now covers every scheme, not only `rclone://`, since one parser call replaced the per-scheme prefix checks. An `s3://` URL the parser rejects (a credential in it, an unknown parameter, no bucket) now fails at load instead of when a command opens the destination. The `file://` and unknown-scheme errors now carry the parser's wording. Model: opus-5-5
clawbot added the needs-review label 2026-11-19 08:31:12 +01:00
clawbot added 1 commit 2026-11-19 08:31:12 +01:00
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
clawbot self-assigned this 2026-11-19 08:31:14 +01:00
Some checks are pending
check / check (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-468-config-checks-rclone-url:issue-468-config-checks-rclone-url
git checkout issue-468-config-checks-rclone-url
Sign in to join this conversation.