[PR #767] [MERGED] Add support for PreAuthKey tags/automatic tagging #1631

Closed
opened 2025-12-29 02:31:00 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/767
Author: @tsujamin
Created: 8/25/2022
Status: Merged
Merged: 9/23/2022
Merged by: @kradalby

Base: mainHead: preauthkey-tags


📝 Commits (10+)

  • e27a4db add acl_tags to PreAuthKey proto
  • 791272e Adds grpc/cli support for preauthkey tags
  • 6faa1d2 Fix tests broken by preauthkey tags
  • ac18723 Set tags as part of handleAuthKeyCommon
  • f6153a9 Merge branch 'main' into preauthkey-tags
  • 72a4300 fix broken preauth-key tag test
  • 470c493 Merge branch 'main' into preauthkey-tags
  • 8a8ec74 fix linting issues in preauthkey tags
  • 91e3039 Remove --rm flag from Docker example
  • e056b86 Merge branch 'main' into preauthkey-tags

📊 Changes

25 files changed (+575 additions, -304 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 acls_test.go (+6 -6)
📝 cmd/headscale/cli/preauthkeys.go (+24 -1)
📝 db.go (+5 -0)
📝 dns_test.go (+8 -0)
📝 gen/go/headscale/v1/apikey.pb.go (+1 -1)
📝 gen/go/headscale/v1/device.pb.go (+1 -1)
📝 gen/go/headscale/v1/headscale.pb.go (+1 -1)
📝 gen/go/headscale/v1/headscale.pb.gw.go (+308 -220)
📝 gen/go/headscale/v1/headscale_grpc.pb.go (+4 -0)
📝 gen/go/headscale/v1/machine.pb.go (+1 -1)
📝 gen/go/headscale/v1/namespace.pb.go (+1 -1)
📝 gen/go/headscale/v1/preauthkey.pb.go (+56 -37)
📝 gen/go/headscale/v1/routes.pb.go (+1 -1)
📝 gen/openapiv2/headscale/v1/headscale.swagger.json (+12 -0)
📝 grpcv1.go (+10 -0)
📝 integration_cli_test.go (+7 -0)
📝 machine_test.go (+8 -8)
📝 namespaces_test.go (+7 -3)
📝 preauth_keys.go (+60 -8)

...and 5 more files

📄 Description

  • read the CONTRIBUTING guidelines
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

These changes add the ability to automatically tag nodes when activated with a preauthkey as is available in SaaS

CreatePreAuthKey and like APIs were expanded to optionally accept a list of tags and the CLI arguments were updated. The database schema was also updated with a new table to store tags associated with preauth keys.

Keys associated to a preauthkey are applied to a new or existing Machine's ForcedKeys when registered/refreshed


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/767 **Author:** [@tsujamin](https://github.com/tsujamin) **Created:** 8/25/2022 **Status:** ✅ Merged **Merged:** 9/23/2022 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `preauthkey-tags` --- ### 📝 Commits (10+) - [`e27a4db`](https://github.com/juanfont/headscale/commit/e27a4db28196b7a36718e1518ad87241390c1b5e) add acl_tags to PreAuthKey proto - [`791272e`](https://github.com/juanfont/headscale/commit/791272e408d50000d5668ed4adb0505bef1e5139) Adds grpc/cli support for preauthkey tags - [`6faa1d2`](https://github.com/juanfont/headscale/commit/6faa1d2e4acd7645475732300f03b16edda1c865) Fix tests broken by preauthkey tags - [`ac18723`](https://github.com/juanfont/headscale/commit/ac18723dd417946501a2ab4cc26d79b522c12f64) Set tags as part of handleAuthKeyCommon - [`f6153a9`](https://github.com/juanfont/headscale/commit/f6153a9b5d755db0b9ba2dae43a01b5fb09bf6c1) Merge branch 'main' into preauthkey-tags - [`72a4300`](https://github.com/juanfont/headscale/commit/72a43007d8e573e3a97ba881170184623c1855c6) fix broken preauth-key tag test - [`470c493`](https://github.com/juanfont/headscale/commit/470c49394c537c2505ecae0455e55d187eeab05c) Merge branch 'main' into preauthkey-tags - [`8a8ec74`](https://github.com/juanfont/headscale/commit/8a8ec7476d2ca2c03e0b9f9fe026fbedd7327eb1) fix linting issues in preauthkey tags - [`91e3039`](https://github.com/juanfont/headscale/commit/91e30397bdfc1ad825033a46809cfb1a1760c88a) Remove --rm flag from Docker example - [`e056b86`](https://github.com/juanfont/headscale/commit/e056b86c37b8a26c1f67df54f836037fdc07f11c) Merge branch 'main' into preauthkey-tags ### 📊 Changes **25 files changed** (+575 additions, -304 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `acls_test.go` (+6 -6) 📝 `cmd/headscale/cli/preauthkeys.go` (+24 -1) 📝 `db.go` (+5 -0) 📝 `dns_test.go` (+8 -0) 📝 `gen/go/headscale/v1/apikey.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/device.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/headscale.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/headscale.pb.gw.go` (+308 -220) 📝 `gen/go/headscale/v1/headscale_grpc.pb.go` (+4 -0) 📝 `gen/go/headscale/v1/machine.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/namespace.pb.go` (+1 -1) 📝 `gen/go/headscale/v1/preauthkey.pb.go` (+56 -37) 📝 `gen/go/headscale/v1/routes.pb.go` (+1 -1) 📝 `gen/openapiv2/headscale/v1/headscale.swagger.json` (+12 -0) 📝 `grpcv1.go` (+10 -0) 📝 `integration_cli_test.go` (+7 -0) 📝 `machine_test.go` (+8 -8) 📝 `namespaces_test.go` (+7 -3) 📝 `preauth_keys.go` (+60 -8) _...and 5 more files_ </details> ### 📄 Description <!-- Please tick if the following things apply. You… --> - [X] read the [CONTRIBUTING guidelines](README.md#contributing) - [x] raised a GitHub issue or discussed it on the projects chat beforehand - [X] added unit tests - [X] added integration tests - [ ] updated documentation if needed - [x] updated CHANGELOG.md These changes add the ability to automatically tag nodes when activated with a preauthkey as is available in SaaS CreatePreAuthKey and like APIs were expanded to optionally accept a list of tags and the CLI arguments were updated. The database schema was also updated with a new table to store tags associated with preauth keys. Keys associated to a preauthkey are applied to a new or existing Machine's ForcedKeys when registered/refreshed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:31:00 +01:00
adam closed this issue 2025-12-29 02:31:00 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1631