From f1382e4322b38c3058119647584cdaf275e9c795 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 4 Nov 2026 16:32:38 +0000 Subject: [PATCH] api/v2: accept an auth key create without tags SaaS takes it; huma marked the field required (422). --- CHANGELOG.md | 1 + hscontrol/api/v2/keys.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e55e95d75..315313afa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -238,6 +238,7 @@ the ACME DNS-01 challenge through a built-in DNS provider: `acmedns`, - Peers get a node's last seen time when it goes offline, not at the next full map. [#3636](https://github.com/juanfont/headscale/pull/3636) - With MagicDNS on, stop sending reverse DNS routes for `prefixes` inside 100.64.0.0/10 and fd7a:115c:a1e0::/48, as on Tailscale SaaS; clients add them. A `prefixes.v4` subset such as 100.64.0.0/24 sent 256, which overflowed systemd-resolved's domain limit and dropped reverse DNS. An octet-aligned prefix outside the ranges gets one route instead of 256 [#3482](https://github.com/juanfont/headscale/pull/3482) - The v1 API stores an API key or pre-auth key created without `expiration` as one that never expires, and reports its expiration as `null`. It was stored as already expired and rejected on first use. The CLI always sends an expiration and was not affected. Keys created this way before stay expired; create new ones [#3254](https://github.com/juanfont/headscale/pull/3254) +- The v2 API accepts an auth key create that leaves out `tags`, as Tailscale does [#3254](https://github.com/juanfont/headscale/pull/3254) ## 0.29.7 (2026-10-30) diff --git a/hscontrol/api/v2/keys.go b/hscontrol/api/v2/keys.go index 83daa7e55..74b8f7382 100644 --- a/hscontrol/api/v2/keys.go +++ b/hscontrol/api/v2/keys.go @@ -49,10 +49,10 @@ type KeyDeviceCreateCapabilities struct { Reusable bool `json:"reusable"` Ephemeral bool `json:"ephemeral"` Preauthorized bool `json:"preauthorized"` - // Tags is not nullable:"false": the Tailscale clients send "tags":null for - // an untagged key, which must be accepted. The response always emits [] via - // emptyIfNil. - Tags []string `json:"tags"` + // Tags is not nullable:"false" nor required: the Tailscale clients send + // "tags":null for an untagged key and SaaS takes it left out. The response + // always emits [] via emptyIfNil. + Tags []string `json:"tags" required:"false"` } // CreateKeyRequest is the POST body. It is multiplexed by keyType: "auth"