mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-09 00:00:10 +09:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user