mirror of
https://github.com/juanfont/headscale.git
synced 2026-04-10 03:03:54 +02:00
state: apply default node key expiry on registration
Use the node.expiry config to apply a default expiry to non-tagged nodes when the client does not request a specific expiry. This covers all registration paths: new node creation, re-authentication, and pre-auth key re-registration. Tagged nodes remain exempt and never expire. Fixes #1711
This commit is contained in:
@@ -1394,11 +1394,12 @@ func TestNodeExpireCommand(t *testing.T) {
|
||||
|
||||
assert.Len(t, listAll, 5)
|
||||
|
||||
assert.True(t, listAll[0].GetExpiry().AsTime().IsZero())
|
||||
assert.True(t, listAll[1].GetExpiry().AsTime().IsZero())
|
||||
assert.True(t, listAll[2].GetExpiry().AsTime().IsZero())
|
||||
assert.True(t, listAll[3].GetExpiry().AsTime().IsZero())
|
||||
assert.True(t, listAll[4].GetExpiry().AsTime().IsZero())
|
||||
// With node.expiry defaulting to 0, non-tagged nodes have zero expiry
|
||||
// (never expire unless explicitly expired).
|
||||
for i := range 5 {
|
||||
assert.True(t, listAll[i].GetExpiry().AsTime().IsZero(),
|
||||
"node %d should have zero expiry (no default node.expiry)", i)
|
||||
}
|
||||
|
||||
for idx := range 3 {
|
||||
_, err := headscale.Execute(
|
||||
|
||||
Reference in New Issue
Block a user