1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-10-23 11:19:19 +02:00
juanfont.headscale/hscontrol/util
Kristoffer Dalby fddc7117e4
stability and race conditions in auth and node store (#2781)
This PR addresses some consistency issues that was introduced or discovered with the nodestore.

nodestore:
Now returns the node that is being put or updated when it is finished. This closes a race condition where when we read it back, we do not necessarily get the node with the given change and it ensures we get all the other updates from that batch write.

auth:
Authentication paths have been unified and simplified. It removes a lot of bad branches and ensures we only do the minimal work.
A comprehensive auth test set has been created so we do not have to run integration tests to validate auth and it has allowed us to generate test cases for all the branches we currently know of.

integration:
added a lot more tooling and checks to validate that nodes reach the expected state when they come up and down. Standardised between the different auth models. A lot of this is to support or detect issues in the changes to nodestore (races) and auth (inconsistencies after login and reaching correct state)

This PR was assisted, particularly tests, by claude code.
2025-10-16 12:17:43 +02:00
..
addr_test.go use cmp.Diff instead of reflect.DeepEqual 2023-07-01 21:55:47 +02:00
addr.go Experimental implementation of Policy v2 (#2214) 2025-03-10 16:20:29 +01:00
const.go Split code into modules 2023-05-26 12:24:50 +02:00
dns_test.go mapper: produce map before poll (#2628) 2025-07-28 11:15:53 +02:00
dns.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
file.go improve errors for missing directories (#1765) 2024-02-17 13:36:19 +01:00
key.go use tsaddr library and cleanups (#2150) 2024-10-02 09:06:09 +02:00
log.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
net.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
prompt_test.go cmd: add option to get and set policy directly from database (#2765) 2025-09-12 16:55:15 +02:00
prompt.go cmd: add option to get and set policy directly from database (#2765) 2025-09-12 16:55:15 +02:00
string_test.go allow users to be defined with @ in v1 (#2495) 2025-03-30 11:19:05 +00:00
string.go Multi network integration tests (#2464) 2025-03-21 11:49:32 +01:00
test.go fix route table migration wiping routes 0.22 -> 0.23 (#2076) 2024-08-27 18:54:28 +02:00
util_test.go stability and race conditions in auth and node store (#2781) 2025-10-16 12:17:43 +02:00
util.go stability and race conditions in auth and node store (#2781) 2025-10-16 12:17:43 +02:00