diff --git a/nix/module-eval/bao-grants.nix b/nix/module-eval/bao-grants.nix index 0cbfd56a9..bd382a635 100644 --- a/nix/module-eval/bao-grants.nix +++ b/nix/module-eval/bao-grants.nix @@ -1911,12 +1911,14 @@ let lib.hasInfix "path \"secret/data/swarm/hives/+/forge/token\" {\n capabilities = [\"create\", \"read\", \"update\"]\n}" s && lib.hasInfix "path \"secret/data/swarm/hives/+/squid-selfcheck\" {\n capabilities = [\"create\", \"read\"]\n}" s && !(lib.hasInfix "secret/data/swarm/hives/*" s) - # The only metadata it reaches under hives is the archive grants: list and delete. + # The only metadata it reaches under hives is the archive grants (list + # and delete) and the forge token's delete. && lib.hasInfix "path \"secret/metadata/swarm/hives/+/archive/\" {\n capabilities = [\"list\"]\n}" s && lib.hasInfix "path \"secret/metadata/swarm/hives/+/archive/+\" {\n capabilities = [\"delete\"]\n}" s - && lib.all (g: lib.hasInfix "/archive/" g.path) ( - lib.filter (g: lib.hasPrefix "secret/metadata/swarm/hives" g.path) (grantsIn s) - ); + && lib.hasInfix "path \"secret/metadata/swarm/hives/+/forge/token\" {\n capabilities = [\"delete\"]\n}" s + && lib.all ( + g: lib.hasInfix "/archive/" g.path || g.path == "secret/metadata/swarm/hives/+/forge/token" + ) (lib.filter (g: lib.hasPrefix "secret/metadata/swarm/hives" g.path) (grantsIn s)); } { # `attic_copy` reads the cache's four facts and writes each into every