headscale/hscontrol/types
Kristoffer Dalby 622e08f5e6
Some checks are pending
Build / build-nix (push) Waiting to run
Build / build-cross (GOARCH=amd64 GOOS=darwin) (push) Waiting to run
Build / build-cross (GOARCH=amd64 GOOS=linux) (push) Waiting to run
Build / build-cross (GOARCH=arm64 GOOS=darwin) (push) Waiting to run
Build / build-cross (GOARCH=arm64 GOOS=linux) (push) Waiting to run
Check Generated Files / check-generated (push) Waiting to run
Build (main) / container (push) Waiting to run
Build (main) / binaries (amd64, darwin) (push) Waiting to run
Build (main) / binaries (amd64, linux) (push) Waiting to run
Build (main) / binaries (arm64, darwin) (push) Waiting to run
Build (main) / binaries (arm64, linux) (push) Waiting to run
Nix Flake Checks / build (push) Waiting to run
Nix Flake Checks / gotest (push) Waiting to run
Nix Flake Checks / golangci-lint (push) Waiting to run
Nix Flake Checks / formatting (push) Waiting to run
NixOS Module Tests / nix-module-check (push) Waiting to run
Server Tests / servertest (push) Waiting to run
oidc: harden callback CSRF cookies, state reuse, and issuer config
Defence-in-depth fixes to the OIDC login flow.

Set the state/nonce cookie Secure flag from the configured server_url
scheme rather than req.TLS, so the cookies stay Secure behind a
TLS-terminating reverse proxy where the proxy-to-Headscale hop is plain
HTTP. Deriving it from config avoids trusting a spoofable
X-Forwarded-Proto header.

Make the OIDC state single-use: consume it from the cache on the
callback and clear the state/nonce cookies once validated, so a replayed
callback cannot resolve the same session and the cookies do not linger
until expiry.

Bound OIDC discovery to the caller's context so a slow or unreachable
issuer fails startup within the timeout instead of hanging, and validate
the issuer URL and required client_id/client_secret at config load so an
unworkable setup fails fast.
2026-06-26 09:18:06 +02:00
..
change all: adopt slices helpers 2026-06-17 16:12:19 +02:00
testcapture all: apply godoc [Name] link conventions across comments 2026-05-19 09:55:22 +02:00
testdata Restore support for "Override local DNS" (#2438) 2025-04-17 17:16:59 +02:00
api_key.go db: add API-key owner and pre-auth-key description for v2 2026-06-21 04:17:03 +02:00
common.go all: fix full-tree golangci-lint findings 2026-06-20 21:08:01 +02:00
common_test.go all: apply godoc [Name] link conventions across comments 2026-05-19 09:55:22 +02:00
config.go oidc: harden callback CSRF cookies, state reuse, and issuer config 2026-06-26 09:18:06 +02:00
config_test.go oidc: harden callback CSRF cookies, state reuse, and issuer config 2026-06-26 09:18:06 +02:00
const.go types: remove dead types, constants, and methods 2026-06-17 16:12:19 +02:00
debug_routes.go types: move DebugRoutes from routes to types 2026-04-29 18:08:39 +01:00
derp_config_test.go types: skip malformed derp.urls entries instead of panicking 2026-06-08 10:04:49 +02:00
main_test.go all: fix test flakiness and improve test infrastructure 2026-03-14 02:52:28 -07:00
node.go types: add Node StringID and UserView accessors 2026-06-21 04:17:03 +02:00
node_benchmark_test.go types: avoid NodeView clone in CanAccess 2026-02-26 19:15:07 -08:00
node_peerchange_test.go types: clone Hostinfo before applying DERP change 2026-06-08 10:04:49 +02:00
node_tags_test.go all: apply godoc [Name] link conventions across comments 2026-05-19 09:55:22 +02:00
node_test.go hscontrol: remove the proto, gRPC and grpc-gateway stack 2026-06-19 15:21:00 +02:00
oauth.go hscontrol: add the OAuth client and access-token model 2026-06-26 09:18:06 +02:00
policy.go feat: implements apis for managing headscale policy (#1792) 2024-07-18 07:38:25 +02:00
preauth_key.go api/v2: soft-revoke auth keys with a configurable collector 2026-06-21 04:17:03 +02:00
preauth_key_test.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00
registration.go all: apply godoc [Name] link conventions across comments 2026-05-19 09:55:22 +02:00
routes.go types: remove dead types, constants, and methods 2026-06-17 16:12:19 +02:00
slices.go all: apply godoc [Name] link conventions across comments 2026-05-19 09:55:22 +02:00
testlog.go all: apply godoc [Name] link conventions across comments 2026-05-19 09:55:22 +02:00
types_clone.go api/v2: soft-revoke auth keys with a configurable collector 2026-06-21 04:17:03 +02:00
types_view.go api/v2: soft-revoke auth keys with a configurable collector 2026-06-21 04:17:03 +02:00
users.go types: add Node StringID and UserView accessors 2026-06-21 04:17:03 +02:00
users_test.go oidc: handle groups claim as string or array (FlexibleStringSlice) 2026-05-04 15:26:53 +02:00
version.go types: remove dead types, constants, and methods 2026-06-17 16:12:19 +02:00