swarm-secret-client: write hive policies to the modern ACL path

`write_policy` called `vaultrs::sys::policy::set`, which targets
`sys/policy/<name>` — the deprecated alias the store gates as a path of
its own. Every grant in this tree names `sys/policies/acl/hive-*`, so a
correctly-scoped controller was refused with a 403 and no hive read
policy has ever been written, on any deployment. The doc comment three
lines above the call already named the modern path; the code is what
moves to meet it.

vaultrs has no endpoint for that path (`grep policies/acl` over 0.8.0:
zero hits, against 8 for `sys/policy`), so this defines one over its own
endpoint machinery — which keeps the client's token header and `/v1`
prefix middleware rather than re-deriving them.

The alternative was to widen the grant to cover the legacy path. This
way needs no policy change at all: the deployed grant already permits
the write, so no store is re-bootstrapped and nothing is entrenched on
an alias upstream has deprecated.

Two tests pin the path and the body shape. The reason this survived
deployment is that nothing in the tree ever asserted either one.

Closes #4177.
This commit is contained in:
atlas 2026-09-11 01:01:40 +02:00 committed by mara
commit 560f727797
4 changed files with 69 additions and 1 deletions

2
Cargo.lock generated
View file

@ -4770,6 +4770,8 @@ name = "swarm-secret-client"
version = "0.1.0"
dependencies = [
"reqwest",
"rustify",
"rustify_derive",
"serde",
"serde_json",
"thiserror 2.0.18",