diff options
| author | aur-build <aur-build@localhost> | 2026-11-19 15:15:53 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-19 15:15:53 +0000 |
| commit | 8912f71afb9697c8645209ec0e67f67098bb16a1 (patch) | |
| tree | 91476b46d1de87f3fb3d9565a41925e52620edff /src/sandbox/kata.rs | |
| parent | 8096fde8d98cdde4e110865ebb15ad034b92ff27 (diff) | |
| download | aur-build-8912f71afb9697c8645209ec0e67f67098bb16a1.tar.gz aur-build-8912f71afb9697c8645209ec0e67f67098bb16a1.zip | |
config: the sandbox backend is an enum, not a string with a fallthrough
`sandbox_backend` was a free-form string and `backend_for` matched it with
`_ => loopback`. So `sandbox_backend = "kata"` — a real, intended backend,
documented in the design — meant "run the untrusted PKGBUILD as the hub's own
user", and nothing anywhere said so. There was also no validation of any kind in
the crate: an empty `agent_token` with a remote backend, or a missing listen
address, parsed fine and failed later as something else.
The four flat fields become one tagged `sandbox` object with three kinds:
`loopback` (needs nothing, still the default, so every config on disk keeps
working), `remote` (listen + token), and `agent-sandbox` (api, namespace,
bearer, image, listen, token). Required fields are required by the type, an
unknown kind is a parse error naming the valid set, and `deny_unknown_fields`
means a misspelled field is named rather than read as absent. `agent-sandbox`
parses and is refused at backend construction until it is wired up — a valid
kind that is not implemented is an error, never a substitution.
Retired keys are refused when they carry intent: a config saying
`sandbox_backend: "remote"` errors and names the replacement shape, because
quietly reinterpreting it as loopback is the bug being removed. A config saying
`"loopback"` with the empty strings `init` wrote is noise, not intent, and loads
unchanged. The token and the cluster bearer are redacted in `Debug`, so a config
that reaches a log line cannot leak them.
Diffstat (limited to 'src/sandbox/kata.rs')
| -rw-r--r-- | src/sandbox/kata.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sandbox/kata.rs b/src/sandbox/kata.rs index 9592dca..5c92557 100644 --- a/src/sandbox/kata.rs +++ b/src/sandbox/kata.rs @@ -311,7 +311,7 @@ impl SandboxBackend for KataBackend { hub_addr: self.addr.clone(), token: self.token.clone(), ttl: spec.ttl, - image: self.cfg.sandbox_image.clone(), + image: self.cfg.sandbox_image(), }; if let Err(e) = self.provisioner.provision(&req) { self.pending.lock().unwrap().remove(&id); |
