1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-10-19 11:15:48 +02:00
juanfont.headscale/hscontrol/types
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
..
change mapper: send change instead of full update (#2775) 2025-09-17 14:23:21 +02:00
testdata Restore support for "Override local DNS" (#2438) 2025-04-17 17:16:59 +02:00
api_key.go Split code into modules 2023-05-26 12:24:50 +02:00
common_test.go mapper: produce map before poll (#2628) 2025-07-28 11:15:53 +02:00
common.go fix: return valid AuthUrl in followup request on expired reg id 2025-10-11 05:57:39 +02:00
config_test.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
config.go chore: make reg cache expiry tunable 2025-10-11 05:57:39 +02:00
const.go improve testing of route failover logic 2024-04-15 12:31:53 +02:00
node_test.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
node.go stability and race conditions in auth and node store (#2781) 2025-10-16 12:17:43 +02:00
policy.go feat: implements apis for managing headscale policy (#1792) 2024-07-18 07:38:25 +02:00
preauth_key_test.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
preauth_key.go lint and leftover 2025-09-09 09:40:00 +02:00
routes.go Redo route code (#2422) 2025-02-26 16:22:55 +01:00
types_clone.go all: use immutable node view in read path 2025-07-07 21:28:59 +01:00
types_view.go all: use immutable node view in read path 2025-07-07 21:28:59 +01:00
users_test.go users: harden, test, and add cleaner of identifier (#2593) 2025-05-14 16:45:14 +02:00
users.go stability and race conditions in auth and node store (#2781) 2025-10-16 12:17:43 +02:00
version.go cli: use gobuild version handling (#2770) 2025-09-12 11:47:31 +02:00