Skip to content

Add custom resolver support to Client - #86

Open
eljeffeg wants to merge 1 commit into
oxigraph:mainfrom
eljeffeg:codex/custom-client-resolver
Open

Add custom resolver support to Client#86
eljeffeg wants to merge 1 commit into
oxigraph:mainfrom
eljeffeg:codex/custom-client-resolver

Conversation

@eljeffeg

Copy link
Copy Markdown

Closes #85.

Summary

  • add a public Resolver trait and closure implementation;
  • add Client::with_resolver while preserving the existing default DNS behavior;
  • use resolver-returned addresses directly for the connection while retaining the URI hostname for Host and TLS verification;
  • invoke the resolver for every followed redirect;
  • retain bad-port validation and reject empty resolver results;
  • add unit coverage for custom resolution, empty results, bad-port enforcement, and redirects.

This supplies the transport extension point needed by applications with custom DNS or outbound destination policies without putting an application-specific SSRF policy into oxhttp itself.

Validation

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings -D clippy::all
  • cargo test --all-features (60 unit tests and 6 documentation tests)

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.

Allow Client callers to customize DNS resolution / validated socket addresses

1 participant