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.
This commit is contained in:
Kristoffer Dalby committed 2026-11-02 19:15:40 +01:00
1 parent 408b9b7797
commit 9979be140e
6 files changed
+86 -6

No files matched your search

+3 -1
View File
@@ -67,7 +67,9 @@ secret for an access token, mints a single-use tagged auth key and registers wit
it. This works anywhere the client takes an auth key: `tailscale up`, the
container image, `tsnet` and the
[`tailscale/github-action`](https://github.com/tailscale/github-action). One
long-lived secret joins any number of nodes.
long-lived secret joins any number of nodes. A client keeps its newest 1000
access tokens and minting more ends the oldest, so give a long-lived integration
its own client.
Create an OAuth client with the `auth_keys` scope and the tags its nodes get. The
secret is shown once: