mirror of
https://github.com/block/buzz.git
synced 2026-11-12 20:31:12 +00:00
- Call validate_jwks_uri at entry of fetch_jwks_inner: direct callers of
HttpJwksFetcher are protected regardless of ProductionJwksSource
pre-validation. HTTP/credentials/fragment URIs rejected before any
DNS resolution or connection attempt.
- Introduce with_deadline(fut, duration): private generic helper that
wraps any future in tokio::time::timeout. HttpJwksFetcher::fetch_jwks
passes fetch_jwks_inner(uri) through it with the fixed 10-second
constant. Remove the RequestBuilder::timeout — the outer deadline
covers the whole operation including a stalled OS resolver.
- Add with_deadline_fires_before_outer_guard: tokio::test(start_paused)
passes std::future::pending() to with_deadline with Duration::ZERO.
The inner timeout fires immediately; removing it leaves the future
permanently pending and the outer test guard fires — seam verified.
- Fix IPv6-literal handling in resolve_and_check_ssrf: use (host, port)
tuple form of ToSocketAddrs, not format!("{host}:{port}"), which is
ambiguous for IPv6 addresses returned without brackets by host_str().
Add IP-literal fast path that skips the OS resolver for bare IP hosts.
- Add production-boundary tests: four HttpJwksFetcher direct-call
regressions (http/credentials/fragment/private-IP) and two IPv6 SSRF
fast-path tests (loopback rejected, public accepted).
- Add tokio test-util dev-dependency to buzz-auth for start_paused.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>