[PR #2773] [MERGED] fix: return valid AuthUrl in followup request on expired reg id #2852

Closed
opened 2025-12-29 04:19:22 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2773
Author: @bobelev
Created: 9/11/2025
Status: Merged
Merged: 10/11/2025
Merged by: @nblock

Base: mainHead: bblv/auth-followup


📝 Commits (2)

  • 2dfba3d chore: make reg cache expiry tunable
  • f121376 fix: return valid AuthUrl in followup request on expired reg id

📊 Changes

8 files changed (+212 additions, -20 deletions)

View changed files

📝 .github/workflows/test-integration.yaml (+1 -0)
📝 hscontrol/auth.go (+43 -7)
📝 hscontrol/grpcv1.go (+3 -4)
📝 hscontrol/oidc.go (+6 -0)
📝 hscontrol/state/state.go (+21 -9)
📝 hscontrol/types/common.go (+23 -0)
📝 hscontrol/types/config.go (+4 -0)
📝 integration/auth_oidc_test.go (+111 -0)

📄 Description

  • chore: make reg cache expiry tunable
  • fix: return valid AuthUrl in followup request on expired reg id
  • have read the CONTRIBUTING.md file
  • 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

Info:

  • tailscale client gets a new AuthUrl and sets entry in the regcache
  • regcache entry expires
  • client doesn't know about that
  • client always polls followup request а gets error

When user clicks "Login" in the app (after cache expiry), they visit
invalid URL and get "node not found in registration cache". Some clients
on Windows for e.g. can't get a new AuthUrl without restart the app.

To fix that we can issue a new reg id and return user a new valid
AuthUrl.


🔄 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/2773 **Author:** [@bobelev](https://github.com/bobelev) **Created:** 9/11/2025 **Status:** ✅ Merged **Merged:** 10/11/2025 **Merged by:** [@nblock](https://github.com/nblock) **Base:** `main` ← **Head:** `bblv/auth-followup` --- ### 📝 Commits (2) - [`2dfba3d`](https://github.com/juanfont/headscale/commit/2dfba3d2ccfea1e65ed7ceecfd289b6cf29d2ed7) chore: make reg cache expiry tunable - [`f121376`](https://github.com/juanfont/headscale/commit/f1213760f88a1247984af42758e741c89b737368) fix: return valid AuthUrl in followup request on expired reg id ### 📊 Changes **8 files changed** (+212 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test-integration.yaml` (+1 -0) 📝 `hscontrol/auth.go` (+43 -7) 📝 `hscontrol/grpcv1.go` (+3 -4) 📝 `hscontrol/oidc.go` (+6 -0) 📝 `hscontrol/state/state.go` (+21 -9) 📝 `hscontrol/types/common.go` (+23 -0) 📝 `hscontrol/types/config.go` (+4 -0) 📝 `integration/auth_oidc_test.go` (+111 -0) </details> ### 📄 Description - **chore: make reg cache expiry tunable** - **fix: return valid AuthUrl in followup request on expired reg id** <!-- … --> - [x] have read the [CONTRIBUTING.md](./CONTRIBUTING.md) file - [ ] raised a GitHub issue or discussed it on the projects chat beforehand - [ ] added unit tests - [x] added integration tests - [ ] updated documentation if needed - [ ] updated CHANGELOG.md Info: - tailscale client gets a new AuthUrl and sets entry in the regcache - regcache entry expires - client doesn't know about that - client always polls followup request а gets error When user clicks "Login" in the app (after cache expiry), they visit invalid URL and get "node not found in registration cache". Some clients on Windows for e.g. can't get a new AuthUrl without restart the app. To fix that we can issue a new reg id and return user a new valid AuthUrl. --- <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 04:19:22 +01:00
adam closed this issue 2025-12-29 04:19:22 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2852