tpagectl: login OIDC discovery has no timeout #587

Closed
opened 2026-08-07 14:35:07 +00:00 by the.auditor · 1 comment
Owner

discoverEndpoints in internal/tpagectl/auth/login.go performs the OIDC discovery GET with http.DefaultClient, which has no timeout. Against a blackholed or unresponsive issuer, tpagectl login would hang indefinitely — the --timeout flag only bounds the DeviceAccessToken polling, not discovery or DeviceAuth.

Suggested fix: bound the discovery request (e.g. a client with a timeout, or reuse the --timeout deadline on the context).

Ref: PR #585

`discoverEndpoints` in `internal/tpagectl/auth/login.go` performs the OIDC discovery GET with `http.DefaultClient`, which has no timeout. Against a blackholed or unresponsive issuer, `tpagectl login` would hang indefinitely — the `--timeout` flag only bounds the `DeviceAccessToken` polling, not discovery or `DeviceAuth`. Suggested fix: bound the discovery request (e.g. a client with a timeout, or reuse the `--timeout` deadline on the context). Ref: PR #585
Owner

Fixed in #634: OIDC discovery uses a dedicated http.Client with a 30s timeout instead of the unbounded http.DefaultClient.

Fixed in #634: OIDC discovery uses a dedicated `http.Client` with a 30s timeout instead of the unbounded `http.DefaultClient`.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#587
No description provided.