Skip to content

fix: add bounded timeout to Jina auth credential validation#37537

Open
ifer47 wants to merge 1 commit into
langgenius:mainfrom
ifer47:fix/jina-auth-validation-timeout
Open

fix: add bounded timeout to Jina auth credential validation#37537
ifer47 wants to merge 1 commit into
langgenius:mainfrom
ifer47:fix/jina-auth-validation-timeout

Conversation

@ifer47

@ifer47 ifer47 commented Jun 16, 2026

Copy link
Copy Markdown

Summary

  • JinaAuth._post_request used the default unbounded timeout from the pooled httpx.Client, meaning credential validation could hang indefinitely on network issues
  • Add httpx.Timeout(10.0, connect=3.0) constant (matching the pattern used across Dify) and pass it to the POST request
  • Update existing test assertions and add a new test verifying the bounded timeout is passed

Closes #37524

Test plan

  • Updated test_should_validate_valid_credentials_successfully to assert the timeout parameter
  • Added test_should_pass_bounded_timeout_to_credential_validation test
  • All existing tests continue to pass

🤖 Generated with Claude Code Best

Jina credential validation delegates to the pooled HTTP client without
an explicit timeout. A slow or hanging Jina endpoint can stall
credential validation indefinitely. Add a bounded httpx.Timeout
(10s read, 3s connect) consistent with other auth provider patterns,
and update test assertions to verify the timeout is passed.

Fixes langgenius#37524

Co-Authored-By: zhipu/glm-5 <zai-org@claude-code-best.win>
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jina credential validation POST lacks bounded timeout

1 participant