mirror of
https://github.com/juanfont/headscale.git
synced 2026-07-09 01:20:21 +09:00
c9bbb5bdec
Reimplement the v1 API as a code-first Huma service in hscontrol/api/v1, a thin adapter over the state layer. Huma emits the OpenAPI 3.1 document (openapi/v1/headscale.yaml) from the Go operation and type definitions; cmd/gen-openapi writes it and the 3.0.3 downgrade the client is generated from. Responses reproduce the protojson wire contract (string-encoded 64-bit IDs, all fields emitted, RFC3339/null timestamps); errors map to the correct HTTP status (404/400/409, 500 for server faults) via mapError. Serve it on the chi router at /api/v1 behind the existing API-key middleware, and point /swagger at the emitted spec.
61 lines
800 B
Plaintext
61 lines
800 B
Plaintext
ignored/
|
|
tailscale/
|
|
.vscode/
|
|
.claude/
|
|
logs/
|
|
|
|
*.prof
|
|
|
|
# Binaries for programs and plugins
|
|
*.exe
|
|
*.exe~
|
|
*.dll
|
|
*.so
|
|
*.dylib
|
|
|
|
# Test binary, built with `go test -c`
|
|
*.test
|
|
|
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
|
*.out
|
|
|
|
# Dependency directories (remove the comment below to include it)
|
|
vendor/
|
|
|
|
dist/
|
|
/headscale
|
|
config.yaml
|
|
config*.yaml
|
|
!config-example.yaml
|
|
derp.yaml
|
|
*.hujson
|
|
!hscontrol/policy/v2/testdata/*/*.hujson
|
|
*.key
|
|
/db.sqlite
|
|
*.sqlite3
|
|
|
|
# Exclude Jetbrains Editors
|
|
.idea
|
|
|
|
test_output/
|
|
control_logs/
|
|
|
|
# Nix build output
|
|
result
|
|
.direnv/
|
|
|
|
integration_test/etc/config.dump.yaml
|
|
|
|
# OpenAPI spec is served live from the code and emitted on demand, not committed
|
|
/openapi/v1/headscale.yaml
|
|
|
|
# MkDocs
|
|
.cache
|
|
/site
|
|
|
|
__debug_bin
|
|
|
|
node_modules/
|
|
package-lock.json
|
|
package.json
|