Skip to content

Add SSO proxy request timeout - #231

Open
dknauss wants to merge 2 commits into
10up:developfrom
dknauss:pr/sso-proxy-request-timeout
Open

Add SSO proxy request timeout#231
dknauss wants to merge 2 commits into
10up:developfrom
dknauss:pr/sso-proxy-request-timeout

Conversation

@dknauss

@dknauss dknauss commented Jul 5, 2026

Copy link
Copy Markdown

Description of the Change

Adds an explicit timeout to the SSO proxy verification request.

The SSO login flow performs an outbound request to the configured proxy. This change sets a default five-second timeout and makes it filterable with tenup_experience_sso_proxy_request_timeout.

Benefits

  • Avoids relying on the WordPress HTTP API default timeout during login.
  • Gives projects a small extension point to tune SSO proxy timeout behavior.
  • Leaves the existing success/failure behavior unchanged.

Possible Drawbacks

If an SSO proxy regularly takes more than five seconds to respond, projects may need to increase the timeout with the provided filter.

Verification Process

  • php -l includes/classes/SSO/SSO.php
  • composer run lint
  • git diff --check

Changelog Entry

Fixed - Add a timeout to SSO proxy verification requests.

Checklist:

  • My code follows the code style of this project.
  • All new and existing tests pass. (No automated test suite exists in this repo; CI runs lint only.)

AI assistance was used in drafting and reviewing this change; final authorship and verification are mine.

@dknauss
dknauss force-pushed the pr/sso-proxy-request-timeout branch from 011154f to 7a58ec9 Compare July 5, 2026 02:44
@dknauss
dknauss force-pushed the pr/sso-proxy-request-timeout branch from 7a58ec9 to 2de9252 Compare July 5, 2026 02:59
@dknauss
dknauss marked this pull request as ready for review July 5, 2026 03:15
@dknauss dknauss closed this Aug 4, 2026
@dknauss dknauss reopened this Aug 4, 2026
@jeffpaul
jeffpaul requested a lite review from Copilot August 12, 2026 15:23
@jeffpaul jeffpaul added this to the 1.20.0 milestone Aug 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an explicit, filterable HTTP timeout to the SSO proxy verification request during the SSO login flow, so the login request doesn’t implicitly rely on the WordPress HTTP API default.

Changes:

  • Passes a timeout argument to wp_remote_get() for the proxy verification call.
  • Introduces a new filter hook tenup_experience_sso_proxy_request_timeout (defaulting to 5 seconds).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread includes/classes/SSO/SSO.php Outdated
wp_remote_get accepts a float timeout, but casting the filtered value to
int truncated a fractional timeout, and an invalid or empty filter return
became 0 — which wp_remote_get treats as "no timeout" and can hang the
request. Cast to float, preserve fractional values, and fall back to the
5s default when the filtered value is not positive. Addresses the Copilot
review note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants