Watch
0
0
Fork
You've already forked hyperhive
0

bao-grants: allow the hive forge token delete in the hives metadata check

This commit is contained in:
atlas 2026-11-17 00:03:42 +01:00 • committed by mara
commit e9e71a09ac

View file

@ -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