fix: changeable allowed_client_redirect_uris on OAuthProxy#3772
fix: changeable allowed_client_redirect_uris on OAuthProxy#3772jlowin merged 1 commit intoPrefectHQ:mainfrom
Conversation
Test Failure AnalysisSummary: A pre-existing flaky test in Root Cause: The test is also inherently timing-dependent: with Suggested Solution: This is a pre-existing flaky test that should be fixed separately from this PR. The fix would mirror the pattern already used in async def test_rate_limiting_with_different_operations(self, rate_limit_server):
"""Test that rate limiting applies to all types of operations."""
rate_limit_server.add_middleware(
RateLimitingMiddleware(max_requests_per_second=0.001, burst_capacity=20)
)
async with Client(rate_limit_server) as client:
operations = cycle([
("quick_action", {"message": "test"}),
("heavy_computation", {}),
("batch_process", {"items": ["a", "b", "c"]}),
])
hit_limit = False
for _, (tool_name, args) in zip(range(30), operations):
try:
await client.call_tool(tool_name, args)
except ToolError as exc:
assert "Rate limit exceeded" in str(exc)
hit_limit = True
break
assert hit_limit, "Rate limit was never triggered across different operations"Detailed AnalysisFailing test: Log excerpt: Server-side request trace (from captured debug logs):
With Why only Python 3.13? On the 3 prior CI runs for this PR, 2 succeeded and 1 failed. The failures are intermittent, consistent with timing sensitivity. Python 3.13's asyncio may schedule coroutines with slightly different timing, affecting how many tokens refill between requests. PR diff: The PR only changes Related Files
|
Description
On
OAuthProxy.get_client(), prioritizedself._allowed_client_redirect_urisrather than storedallowed_redirect_uri_patternsfrom stored client. Without this fix, any updates toallowed_client_redirect_urisare prohibited, e.g., fixing typos, or client's url updates.Closes #3771
Contribution type
Checklist
uv run prek run --all-filesand all checks pass