get-authkey: require tags to be specified

Tailnet-owned auth keys (which all OAuth-created keys are) must include tags, since there is no user to own the registered devices.

Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
Will Norris 2023-02-08 16:06:48 -08:00 committed by Will Norris
parent 89bd414be6
commit 6ef834a6b7

View File

@ -35,6 +35,10 @@ func main() {
log.Fatal("TS_API_CLIENT_ID and TS_API_CLIENT_SECRET must be set") log.Fatal("TS_API_CLIENT_ID and TS_API_CLIENT_SECRET must be set")
} }
if *tags == "" {
log.Fatal("at least one tag must be specified")
}
baseUrl := os.Getenv("TS_BASE_URL") baseUrl := os.Getenv("TS_BASE_URL")
if baseUrl == "" { if baseUrl == "" {
baseUrl = "https://api.tailscale.com" baseUrl = "https://api.tailscale.com"