[PR #2398] [MERGED] Return better web errors to the user #2648

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2398
Author: @kradalby
Created: 2/1/2025
Status: Merged
Merged: 2/1/2025
Merged by: @kradalby

Base: mainHead: kradalby/user-err


📝 Commits (4)

  • 5d4861e add dedicated http error to propagate to user
  • 6335870 classify user errors in http handlers
  • a7fbe27 move validation of pre auth key out of db
  • 6102813 update changelog

📊 Changes

10 files changed (+267 additions, -228 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 hscontrol/auth.go (+33 -4)
hscontrol/auth_test.go (+130 -0)
📝 hscontrol/db/preauth_keys.go (+18 -55)
📝 hscontrol/db/preauth_keys_test.go (+2 -119)
📝 hscontrol/grpcv1.go (+5 -1)
📝 hscontrol/handlers.go (+32 -9)
📝 hscontrol/noise.go (+10 -4)
📝 hscontrol/oidc.go (+27 -28)
📝 hscontrol/platform_config.go (+8 -8)

📄 Description

This PR continues the work of #2384 by classifying all the web errors and sending appropriate error codes, instead of just 500 for everything.

Depends on #2374

Fixes #2390


🔄 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/2398 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 2/1/2025 **Status:** ✅ Merged **Merged:** 2/1/2025 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `kradalby/user-err` --- ### 📝 Commits (4) - [`5d4861e`](https://github.com/juanfont/headscale/commit/5d4861e8ed776c8f382da2ecccc4d34477e1e9af) add dedicated http error to propagate to user - [`6335870`](https://github.com/juanfont/headscale/commit/6335870dad812deca3462ef9669539501001c84c) classify user errors in http handlers - [`a7fbe27`](https://github.com/juanfont/headscale/commit/a7fbe274893bbdeaaec091978c9d8ca6755b0bfc) move validation of pre auth key out of db - [`6102813`](https://github.com/juanfont/headscale/commit/6102813f8b0c4a4476a93795291ba6de6ac55ff8) update changelog ### 📊 Changes **10 files changed** (+267 additions, -228 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `hscontrol/auth.go` (+33 -4) ➕ `hscontrol/auth_test.go` (+130 -0) 📝 `hscontrol/db/preauth_keys.go` (+18 -55) 📝 `hscontrol/db/preauth_keys_test.go` (+2 -119) 📝 `hscontrol/grpcv1.go` (+5 -1) 📝 `hscontrol/handlers.go` (+32 -9) 📝 `hscontrol/noise.go` (+10 -4) 📝 `hscontrol/oidc.go` (+27 -28) 📝 `hscontrol/platform_config.go` (+8 -8) </details> ### 📄 Description This PR continues the work of #2384 by classifying all the web errors and sending appropriate error codes, instead of just 500 for everything. Depends on #2374 Fixes #2390 --- <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:22:11 +01:00
adam closed this issue 2025-12-29 03:22:11 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2648