1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-11-10 01:20:58 +01:00
juanfont.headscale/hscontrol
Kristoffer Dalby 733fc40c3d
debug: add /debug/http-routes endpoint
Add new debug endpoint to list all registered HTTP routes with their
methods and optional names. This helps with debugging and understanding
the API surface area.

The endpoint supports both text and JSON formats:

Text format (default):
```
=== Registered HTTP Routes ===

/api/v1/                                          [ALL]
/apple                                            [GET]
/health                                           [GET]
/register/{registration_id}                       [GET]
/ts2021                                           [POST, GET]

Total routes: 14
```

JSON format:
```json
{
  "routes": [
    {
      "path": "/health",
      "methods": ["GET"]
    },
    {
      "path": "/ts2021",
      "methods": ["POST", "GET"]
    }
  ],
  "total_count": 14
}
```

Usage:
- Text: curl http://localhost:9090/debug/http-routes
- JSON: curl -H "Accept: application/json" http://localhost:9090/debug/http-routes

Changes:
- Modified debugHTTPServer() to accept router parameter
- Added collectRoutes() to walk router and collect route information
- Added debugHTTPRoutes() for text output
- Added debugHTTPRoutesJSON() for structured output
- Added HTTPRouteInfo and DebugHTTPRoutesInfo types
- Added unit tests for route listing functionality
2025-10-27 11:34:13 +01:00
..
assets update flake, fix prettier lint 2023-09-05 08:47:43 +02:00
capver policy: fix autogroup:self propagation and optimize cache invalidation (#2807) 2025-10-23 17:57:41 +02:00
db stricter hostname validation and replace (#2383) 2025-10-22 13:50:39 +02:00
derp policy: fix autogroup:self propagation and optimize cache invalidation (#2807) 2025-10-23 17:57:41 +02:00
dns integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
mapper policy: fix autogroup:self propagation and optimize cache invalidation (#2807) 2025-10-23 17:57:41 +02:00
policy policy: fix autogroup:self propagation and optimize cache invalidation (#2807) 2025-10-23 17:57:41 +02:00
routes debug: add json and improve 2025-09-09 09:40:00 +02:00
state policy: fix autogroup:self propagation and optimize cache invalidation (#2807) 2025-10-23 17:57:41 +02:00
templates integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
types policy: fix autogroup:self propagation and optimize cache invalidation (#2807) 2025-10-23 17:57:41 +02:00
util stricter hostname validation and replace (#2383) 2025-10-22 13:50:39 +02:00
app.go debug: add /debug/http-routes endpoint 2025-10-27 11:34:13 +01:00
auth_test.go stability and race conditions in auth and node store (#2781) 2025-10-16 12:17:43 +02:00
auth.go stricter hostname validation and replace (#2383) 2025-10-22 13:50:39 +02:00
debug_test.go debug: add /debug/http-routes endpoint 2025-10-27 11:34:13 +01:00
debug.go debug: add /debug/http-routes endpoint 2025-10-27 11:34:13 +01:00
grpcv1_test.go
grpcv1.go add health command (#2659) 2025-10-16 12:00:11 +00:00
handlers.go lint and leftover 2025-09-09 09:40:00 +02:00
metrics.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
noise.go lint and leftover 2025-09-09 09:40:00 +02:00
oidc.go fix: return valid AuthUrl in followup request on expired reg id 2025-10-11 05:57:39 +02:00
platform_config.go Return better web errors to the user (#2398) 2025-02-01 15:25:18 +01:00
poll.go stability and race conditions in auth and node store (#2781) 2025-10-16 12:17:43 +02:00
suite_test.go Redo OIDC configuration (#2020) 2024-10-02 14:50:17 +02:00
tailsql.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00