Commit Graph
10 Commits
Author SHA1 Message Date
Kristoffer Dalby ee9f2bb318 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-10-28 07:15:55 +00:00
Kristoffer Dalby 4905e51c44 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-10-28 07:15:55 +00:00
Kristoffer Dalby 4e18e7ebb4 api/v2: refuse an unknown keyType 2026-10-28 07:15:55 +00:00
Kristoffer Dalby 36eb1bfc03 api/v2: ignore unknown properties in request bodies
Tailscale's API ignores them.
2026-10-28 07:15:55 +00:00
Kristoffer Dalby 8b3b6cf4b9 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-10-28 07:15:55 +00:00
Kristoffer Dalby 9424501e31 api/v2: bound every request body
huma gives RawBody no limit, and validates a whole body before
the handler runs. The token form is parsed before the secret check.
2026-10-28 07:15:55 +00:00
Kristoffer Dalby 698d013ad0 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-10-28 07:15:55 +00:00
Kristoffer Dalby 84715e976c api/v2: add OAuth client-credentials auth and scope enforcement 2026-06-26 09:18:06 +02:00
Kristoffer Dalby 6b413fe237 api/v2: soft-revoke auth keys with a configurable collector
Tailscale's keys API has no separate expire verb: DELETE is the revoke.
Map it to a soft revoke so the key stays retrievable as invalid afterwards
instead of vanishing, matching the SDK and Terraform's expectations.

Add a revoked timestamp to pre-auth keys (migration plus schema), mark a
key invalid once revoked, and have the keys DELETE handler stamp it rather
than destroy the row. A background collector reaps revoked keys after a
configurable retention window (preauth_keys.revoked_retention, default
168h), so the table does not grow without bound.
2026-06-21 04:17:03 +02:00
Kristoffer Dalby fe08d43978 api/v2: add Tailscale-compatible keys API
Add the v2 foundation — Basic/Bearer auth, scope scaffolding, the
tailnet check, and the Tailscale error shape — plus the auth-key
endpoints mapped onto Headscale pre-auth keys.
2026-06-21 04:17:03 +02:00