state: refresh policy nodes inside the peer map build

One peer build per tag/user/IP/route write; callers detect policy moves
via NodesGeneration. Per-node caches only store results for the node
pm holds, so a mapper reading mid-build cannot pin a stale filter.
This commit is contained in:
Kristoffer Dalby
2026-09-25 17:36:26 +00:00
parent 311d9323e0
commit 21f6e46fb8
17 changed files with 1085 additions and 148 deletions
+4 -2
View File
@@ -91,16 +91,18 @@ func registerAuth(api huma.API, b Backend) {
util.RegisterMethodCLI,
)
if err != nil {
b.Change(nodeChange)
return nil, mapError("registering node", err)
}
routeChange, err := b.State.AutoApproveRoutes(node)
b.Change(nodeChange, routeChange)
if err != nil {
return nil, huma.Error500InternalServerError("auto approving routes", err)
}
b.Change(nodeChange, routeChange)
out := &authRegisterOutput{}
out.Body.Node = nodeFromView(node)