[PR #2170] [MERGED] Harden OIDC migration and make optional #2535

Closed
opened 2025-12-29 03:21:42 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2170
Author: @kradalby
Created: 10/4/2024
Status: Merged
Merged: 11/23/2024
Merged by: @juanfont

Base: mainHead: kradalby/oidc-takeover


📝 Commits (10+)

  • 1f73616 Harden OIDC migration and make optional
  • d7363e1 update changelog
  • 9f56a72 remove log print
  • 8302291 add @ to end of username if not present
  • 939c233 add iss to identifier, only set email if verified
  • 8059d47 restore strip_email_domain for migration
  • 69b9aba fix oidc test, add tests for migration
  • d6fedd1 make preauthkey tags test stable
  • 33c8bbc use userID instead of username everywhere
  • 7c92acb nits

📊 Changes

28 files changed (+1085 additions, -239 deletions)

View changed files

📝 .github/workflows/test-integration.yaml (+1 -0)
📝 CHANGELOG.md (+72 -6)
📝 cmd/headscale/cli/mockoidc.go (+34 -3)
📝 config-example.yaml (+12 -6)
📝 flake.nix (+2 -1)
📝 go.mod (+2 -0)
📝 go.sum (+3 -0)
📝 hscontrol/db/db.go (+36 -0)
📝 hscontrol/db/db_test.go (+121 -2)
📝 hscontrol/db/node.go (+4 -4)
📝 hscontrol/db/node_test.go (+23 -23)
📝 hscontrol/db/preauth_keys.go (+9 -11)
📝 hscontrol/db/preauth_keys_test.go (+18 -17)
📝 hscontrol/db/routes.go (+1 -1)
📝 hscontrol/db/routes_test.go (+8 -8)
📝 hscontrol/db/suite_test.go (+60 -3)
📝 hscontrol/db/users.go (+53 -65)
📝 hscontrol/db/users_test.go (+25 -18)
📝 hscontrol/grpcv1.go (+44 -8)
📝 hscontrol/oidc.go (+47 -9)

...and 8 more files

📄 Description

This commit hardens the migration part of the OIDC from the old username based approach to the new sub based approach and makes it possible for the operator to opt out entirely.

Fixes #1990


🔄 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/2170 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 10/4/2024 **Status:** ✅ Merged **Merged:** 11/23/2024 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `kradalby/oidc-takeover` --- ### 📝 Commits (10+) - [`1f73616`](https://github.com/juanfont/headscale/commit/1f73616f90992fd73e21846faed55391c8981cd6) Harden OIDC migration and make optional - [`d7363e1`](https://github.com/juanfont/headscale/commit/d7363e1c144551315a0575e9910bce8ab5e12d53) update changelog - [`9f56a72`](https://github.com/juanfont/headscale/commit/9f56a723ef51a8f3cb80cf6d59b947b66a44b46d) remove log print - [`8302291`](https://github.com/juanfont/headscale/commit/8302291e38c40cc3e8944f8ec7975d56772285c2) add @ to end of username if not present - [`939c233`](https://github.com/juanfont/headscale/commit/939c233b8d31b2611211d182ed82417543cb1282) add iss to identifier, only set email if verified - [`8059d47`](https://github.com/juanfont/headscale/commit/8059d475a4b9e06905458bfa2dc5cc61a482ba6a) restore strip_email_domain for migration - [`69b9aba`](https://github.com/juanfont/headscale/commit/69b9abaa6c1cb193db1fbe5c44f1c18c0801db3f) fix oidc test, add tests for migration - [`d6fedd1`](https://github.com/juanfont/headscale/commit/d6fedd117eb835434f032df682cce0f68ca11d41) make preauthkey tags test stable - [`33c8bbc`](https://github.com/juanfont/headscale/commit/33c8bbcef84c76f008a86aa54b55c87f1a13da21) use userID instead of username everywhere - [`7c92acb`](https://github.com/juanfont/headscale/commit/7c92acb50ca18c6d554dc9f734490f2436f81fd1) nits ### 📊 Changes **28 files changed** (+1085 additions, -239 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test-integration.yaml` (+1 -0) 📝 `CHANGELOG.md` (+72 -6) 📝 `cmd/headscale/cli/mockoidc.go` (+34 -3) 📝 `config-example.yaml` (+12 -6) 📝 `flake.nix` (+2 -1) 📝 `go.mod` (+2 -0) 📝 `go.sum` (+3 -0) 📝 `hscontrol/db/db.go` (+36 -0) 📝 `hscontrol/db/db_test.go` (+121 -2) 📝 `hscontrol/db/node.go` (+4 -4) 📝 `hscontrol/db/node_test.go` (+23 -23) 📝 `hscontrol/db/preauth_keys.go` (+9 -11) 📝 `hscontrol/db/preauth_keys_test.go` (+18 -17) 📝 `hscontrol/db/routes.go` (+1 -1) 📝 `hscontrol/db/routes_test.go` (+8 -8) 📝 `hscontrol/db/suite_test.go` (+60 -3) 📝 `hscontrol/db/users.go` (+53 -65) 📝 `hscontrol/db/users_test.go` (+25 -18) 📝 `hscontrol/grpcv1.go` (+44 -8) 📝 `hscontrol/oidc.go` (+47 -9) _...and 8 more files_ </details> ### 📄 Description This commit hardens the migration part of the OIDC from the old username based approach to the new sub based approach and makes it possible for the operator to opt out entirely. Fixes #1990 --- <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 03:21:42 +01:00
adam closed this issue 2025-12-29 03:21:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2535