auth: release JWKS refresh goroutine on shutdown #524

Closed
opened 2026-08-04 11:35:26 +00:00 by the.auditor · 0 comments
Owner

cmd/thwap-pagesd/main.go builds the auth middleware but never calls auth.Middleware.Close(). keyfunc's background JWKS refresher goroutine is cancelled only via the context released by Close(), so it leaks for the lifetime of the process.

Context: PR #521 (cmd/thwap-pagesd/main.go, internal/auth/auth.go:58).

Suggested fix: call Close() during shutdown, e.g. alongside graceful shutdown work in #120.

`cmd/thwap-pagesd/main.go` builds the auth middleware but never calls `auth.Middleware.Close()`. keyfunc's background JWKS refresher goroutine is cancelled only via the context released by `Close()`, so it leaks for the lifetime of the process. Context: PR #521 (`cmd/thwap-pagesd/main.go`, `internal/auth/auth.go:58`). Suggested fix: call `Close()` during shutdown, e.g. alongside graceful shutdown work in #120.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd#524
No description provided.