[PR #725] [MERGED] Improve registration protocol implementation and switch to NodeKey as main identifier #1601

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/725
Author: @juanfont
Created: 8/10/2022
Status: Merged
Merged: 8/12/2022
Merged by: @juanfont

Base: mainHead: switch-to-db-d


📝 Commits (10+)

  • e950b3b Add method to fetch by nodekey
  • e91c378 Replace machine key with node key in preparation for Noise in auth related stuff
  • 030d726 Fixed comment for linting
  • fb3b2e6 Improve protocol implementation for client registration (fixes #706)
  • 804d703 Switch to nodekey in urls
  • d586b9d Added comment clarifying registration API
  • 8e56d8b Merge branch 'main' into switch-to-db-d
  • e1e3feb Add a sleep to reduce the impact of #727
  • 393aae0 Merge branch 'main' into switch-to-db-d
  • 739e11e Update api.go

📊 Changes

7 files changed (+105 additions, -53 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 api.go (+52 -10)
📝 app.go (+6 -10)
📝 cmd/headscale/cli/nodes.go (+1 -1)
📝 grpcv1.go (+1 -1)
📝 machine.go (+16 -3)
📝 oidc.go (+28 -28)

📄 Description

This PR lays the groundwork for the implementation of the TS2021 protocol (Tailscale control v2).

Under the Noise protocol the NaCl boxes encrypted with the MachineKey are dropped in favour of Noise sessions. MachineKey loses importance across the code base, and when using Noise they are not sent at all.

In headscale we were using the stripped version of the public MachineKey as a sort-of ID, for the iterative login process (including the registrationCache used in the web+CLI and the OIDC flows).

This PR addresses that, switching to NodeKey as identifier.

In addition to it, it also improves a bit the handling of the registration process (and reduces the impact caused by #727 (although does not fully resolve it).


🔄 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/725 **Author:** [@juanfont](https://github.com/juanfont) **Created:** 8/10/2022 **Status:** ✅ Merged **Merged:** 8/12/2022 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `switch-to-db-d` --- ### 📝 Commits (10+) - [`e950b3b`](https://github.com/juanfont/headscale/commit/e950b3be29286f76296ff48f2a2ed9c488d65fe2) Add method to fetch by nodekey - [`e91c378`](https://github.com/juanfont/headscale/commit/e91c378bd42a4339a36df045ac2ef9aca61a217a) Replace machine key with node key in preparation for Noise in auth related stuff - [`030d726`](https://github.com/juanfont/headscale/commit/030d7264e61b54fd01fb91e0cd290e8524baa78f) Fixed comment for linting - [`fb3b2e6`](https://github.com/juanfont/headscale/commit/fb3b2e6bc8221914f81823c23b6b32ba125651d9) Improve protocol implementation for client registration (fixes #706) - [`804d703`](https://github.com/juanfont/headscale/commit/804d70386d126e4c0b5b77a9410feaba7bcc75e3) Switch to nodekey in urls - [`d586b9d`](https://github.com/juanfont/headscale/commit/d586b9d2856c9974c27c14d9fc64a6e3aa003494) Added comment clarifying registration API - [`8e56d8b`](https://github.com/juanfont/headscale/commit/8e56d8b425a2c2424696f27abc87f63973d25e09) Merge branch 'main' into switch-to-db-d - [`e1e3feb`](https://github.com/juanfont/headscale/commit/e1e3feb6a810664c43ba5096c476a32a1dcab87c) Add a sleep to reduce the impact of #727 - [`393aae0`](https://github.com/juanfont/headscale/commit/393aae01dfb1c24e1c548c9599a3f187c4cae814) Merge branch 'main' into switch-to-db-d - [`739e11e`](https://github.com/juanfont/headscale/commit/739e11e1ee48ab07414b2bea091470f4563e0598) Update api.go ### 📊 Changes **7 files changed** (+105 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `api.go` (+52 -10) 📝 `app.go` (+6 -10) 📝 `cmd/headscale/cli/nodes.go` (+1 -1) 📝 `grpcv1.go` (+1 -1) 📝 `machine.go` (+16 -3) 📝 `oidc.go` (+28 -28) </details> ### 📄 Description This PR lays the groundwork for the implementation of the TS2021 protocol (Tailscale control v2). Under the Noise protocol the NaCl boxes encrypted with the `MachineKey` are dropped in favour of Noise sessions. `MachineKey` loses importance across the code base, and when using Noise they are not sent at all. In headscale we were using the stripped version of the public MachineKey as a sort-of ID, for the iterative login process (including the registrationCache used in the web+CLI and the OIDC flows). This PR addresses that, switching to NodeKey as identifier. In addition to it, it also improves a bit the handling of the registration process (and reduces the impact caused by #727 (although does not fully resolve it). --- <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:30:53 +01:00
adam closed this issue 2025-12-29 02:30:53 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1601