Watch
0
0
Fork
You've already forked hyperhive
0

attic-init: replace the stored public key with the one the cache reports

a re-created cache signs with a new key; the fact was only created once, so
every hive then rejected the swarm's closures. the cache's grant gains update
on that one leaf, and a store that refuses it leaves the key as it was.

Closes #6181
This commit is contained in:
atlas 2026-11-07 07:32:28 +01:00 • committed by mara
commit b0f6ccaa64

View file

@ -1307,11 +1307,11 @@ let
}
];
# The in-swarm cache's six secrets, create and read and nothing more: its
# host units create each one only while it is absent, so none needs `update`,
# and a rewrite of a signing key or a token an operator holds is refused. The
# cache container's journal forwarder reads its client secret under the same
# leaf.
# The in-swarm cache's six secrets: create and read, so a rewrite of a signing
# key or a token an operator holds is refused. The public key also gets
# `update`: the cache's host unit replaces it when a re-created cache signs
# with another. The cache container's journal forwarder reads its client
# secret under the same leaf.
atticWriters = [
{
name = "swarm-attic";
@ -1328,8 +1328,13 @@ let
atticJwtLeaf
atticPushTokenLeaf
]
++ atticFactLeaves
++ lib.remove atticPublicKeyLeaf atticFactLeaves
)
+ ''
path "${credentialMountPath}/data/${atticPublicKeyLeaf}" {
capabilities = ["create", "read", "update"]
}
''
+ readStanza "${credentialMountPath}/data/swarm/services/${hyperhiveCfg.swarm.attic.otel.clientId}/oidc/client";
}
];
@ -2592,7 +2597,8 @@ in
Subject the store's `swarm-attic` cert-auth role accepts: the identity
the in-swarm cache's host units present. Its grant is create and read on
six paths under `swarm/services/attic/`, `jwt-secret`, `push-token`,
`pull-token`, `url`, `cache` and `public-key`, and nothing else.
`pull-token`, `url`, `cache` and `public-key`, plus `update` on
`public-key`, and nothing else.
⚠️ Reserved as a hive name by ./swarm.nix, like its siblings.
'';