Kristoffer Dalby
10ed774b5e
hscontrol: name policy, registration and map delivery decisions
2026-11-02 17:46:55 +00:00
Kristoffer Dalby
1584087961
hscontrol: preserve stale GC timer coverage after ephemeral ownership changes
2026-11-02 17:46:55 +00:00
Kristoffer Dalby
9dded59a22
mapper: read tracked peers under workMu in batcher tests
...
A full map replaces the set with Clear then Store; an unlocked read
between them failed TestOlderInitialMapLeavesNewerStreamsPeers.
2026-11-02 17:46:55 +00:00
Kristoffer Dalby
d42f0a5ab3
api/v2: enforce and document OAuth tag permissions
...
Retagging requires all current and requested tags; disallowed tags return
400. Token responses list tags only when the token may assign them.
2026-11-02 17:46:55 +00:00
Kristoffer Dalby
608c134253
api/v2: send empty route lists under fields=all
2026-11-02 17:46:55 +00:00
Kristoffer Dalby
85c587ae20
gen/client/v2: regenerate for the device's join key
2026-11-02 17:46:55 +00:00
Kristoffer Dalby
6fe9be0700
api/v2: report tagged device creators and join keys
...
Use the join-key creator as the device's user without changing ownership.
Omit oauthClientId when an OAuth token's source client is not recorded.
2026-11-02 17:46:55 +00:00
Kristoffer Dalby
2c1f1c730b
gen/client/v2: regenerate for the key list without all=true
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
ebef794b54
api/v2: list token-made auth keys to a token without all=true
...
Keys an OAuth token makes are marked so. No listing holds an invalid
key.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
7d8d875c80
db, types: add a credentials column for keys a token made
...
No released version made keys from tokens, so existing rows stay false.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
f838b0ab2d
api/v2: show userId on admin-made tagged keys
...
An admin key's user is recorded as the creator of the tagged keys it
makes. A tagged key re-registers a machine by its tags, whoever made it.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
b26555ac4f
api/v2: return a device name as its FQDN
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
822bcda76a
api/v2: ignore unknown fields and reject unknown key types
...
Match SaaS request decoding while refusing unsupported keyType values.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
da693c4b43
db: keep at most 1000 access tokens per OAuth client
...
Minting needs only the client secret, whatever its scopes, and
added one row per mint. Each mint now ends tokens past the newest 1000.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
b997748d82
api/v2: check the createKey scope before reading the body
...
createKey has no static scope, so any token got its body parsed
and validated before the handler's scope check.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
8caa04ba93
api/v2: limit request bodies and redact schema-validation details
...
Bound schema, raw, and token-form bodies before parsing. Omit submitted
values from schema errors while preserving policy reasons and test labels.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
ce67867512
api/v2: keep a tagged all-scope client's tokens inside its tags
...
Only an untagged all-scope client may mint tokens for any tag, so a
tagged token may not create one.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
9016685a8b
debug: refuse requests addressed to unknown host names
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
9c3deadc9a
types: accept only lowercase hex in auth IDs
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
313572393b
oidc: confirm SSH checks and display registration details
...
Approve SSH checks only after a click and recheck source ownership.
Show registration state and requested tags on the confirmation page.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
010a806526
policy/v2: resolve user references consistently across updates
...
Prefer email owners over usernames and validate grants and nodeAttrs on
write. Reject ambiguous writes; log and match nobody on reload. Bare @
matches nobody.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
edba46b651
cli: validate offline policy set like policy check
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
e32defe1a6
types: reject non-boolean values for boolean settings
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
cea0ef340d
state, oidc: persist user changes and refresh nodes and clients
...
Write cleared user columns, discard OIDC email the provider no longer
vouches for, refresh NodeStore users, and notify clients from the callback.
Fixes #3471
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
faa2b7c89d
oidc: refuse logins whose subject the provider identifier would alter
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
220e9eec6a
state, change: notify clients only of effective node changes
...
Send endpoint and DERP reports only to peers. Suppress redundant online,
policy, and key updates on reconnect or unchanged-key login.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
f5fb3ca196
policy/v2, mapper: align NextDNS warnings and device metadata
...
Warn about malformed attributes once at policy load, not on each map.
Include the node's stable ID as device_id in resolver queries.
2026-11-02 17:46:54 +00:00
Kristoffer Dalby
0fa4b93b09
mapper: test that a hidden peer's policy change still sends filters
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
077dd5b11d
state, change: send a deleted node's removal only to its peers
...
The removal went to every node, also those the policy hid the node from.
The delete now returns the node's peers from the snapshot it replaces.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
5ecc365050
mapper: stop an older initial map removing peers newer streams hold
...
AddNode diffed its map against tracking after sending it, when a newer
stream may have recorded its own; it now sends the node a full instead.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
78b807ac44
mapper: bound how long one node can block a batcher worker
...
A node that drained slower than it was sent to held the worker for its
whole bundle; once its sends have waited 50ms, the rest waits a tick.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
ca5fc62312
mapper: bound concurrent streams and wait for their initial maps
...
The fifth stream replaces the oldest. Retry changes while any stream
awaits its initial map so ready streams cannot consume another's update.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
3ede93947a
change: coalesce policy recomputes that carry an origin node
...
The recompute render ignores the origin and always carries the node's
own entry, so a burst of tag writes cost every node one per write.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
3bd17903e0
state: say a taken name is already taken
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
c23a6efa73
db: succeed on a repeated revoke of an auth key
...
A repeated v2 DELETE of an auth key now answers 200, as Tailscale does.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
61107c0c4f
auth: answer a logout that deletes an ephemeral node as authorised
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
6b07f3c17a
cli: show a node's own ephemeral flag instead of its key's
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
84b0d0966c
gen/client/v1: regenerate for the node ephemeral flag
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
bccfb46ab1
db, state: keep the ephemeral flag a node was created with
...
The flag moves from the key to the node, so a login with another key no
longer changes it. A user claiming a tagged node still clears it. v1
nodes carry the flag.
Fixes #3640
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
5827e4b73c
db, types: add a nodes column for the ephemeral flag
...
The migration fills it from the key each node references.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
95efb8cef1
state: assign and persist unique node names in the NodeStore
...
Reserve extra DNS names, fit collision suffixes within 63 bytes, and repair
duplicate startup names in memory. Persist registration names without
losing a created node on rename failure; remove unused DB renaming.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
77874782ca
db, api/v1: revoke rather than delete an ephemeral pre-auth key in use
...
The v1 list now hides revoked keys, so keys revoked through v2 also drop
out of `headscale preauthkeys list`.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
c7b9b15c90
hscontrol: track ephemeral cleanup from registration to ownership changes
...
Arm cleanup at pre-auth registration, even if later work fails or the node
never connects. Skip deletion when the node is no longer ephemeral.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
8d3f800725
db: wrap the sequential IP allocator so freed addresses are reused
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
598b4c53c3
state: test that a persist racing a delete cannot resurrect the node
...
DeleteNode's early persistMu unlock is safe only while node persists
stay UPDATE-only; say so where the lock is declared.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
ab11fcbf32
hscontrol: bound client-chosen text in request logs
...
Clip at the sinks: handler errors, the request line, SSH local_user.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
9531124eea
mapper: show an expired peer online, without endpoints or DERP
...
A connected expired node shows online to its peers. Neither its map
entry nor endpoint, DERP or disco patches carry the paths to reach it.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
b65d4ac185
mapper: trim the Hostinfo sent to peers and to the node itself
...
As on Tailscale SaaS, the node's own entry keeps Hostname, RequestTags,
RoutableIPs and Services; peers get Hostname, OS, Services without
peerapi-dns-proxy, SSH host keys and AppConnector, and resend on those.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
360b8acfd2
mapper: keep an expired node authorised in its own entry
...
Tailscale SaaS sends an expired node MachineAuthorized and no Expired
flag; its past KeyExpiry already moves the client to NeedsLogin.
2026-11-02 17:46:53 +00:00
Kristoffer Dalby
433e96af96
.github: regenerate integration test workflow
2026-11-02 17:46:53 +00:00