Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
054f074
allow non-utf8 addresses in Address struct
arjan-bal Jun 4, 2026
dea8d57
precent decode path in target URL
arjan-bal Jun 5, 2026
4cb1693
polish
arjan-bal Jun 5, 2026
991204a
fix non-unix build
arjan-bal Jun 5, 2026
060c345
fix darwin test
arjan-bal Jun 5, 2026
39c081d
Merge remote-tracking branch 'source/master' into non-utf-strings
arjan-bal Jun 5, 2026
6ce704c
add proxy resolver
arjan-bal Jun 8, 2026
0ffbba6
add minor version to dep
arjan-bal Jun 8, 2026
3194351
Merge remote-tracking branch 'source/master' into non-utf-strings
arjan-bal Jun 8, 2026
b6a4bcd
Add minor version in dep
arjan-bal Jun 8, 2026
e502faf
skip proxy for unix schemes
arjan-bal Jun 8, 2026
2164fc4
Move authority parsing constructor
arjan-bal Jun 8, 2026
5f7c97d
fix handling of unbrackated IPv6 in target address
arjan-bal Jun 8, 2026
5cc591e
disallow non-UTF-8 symbols in path
arjan-bal Jun 9, 2026
52dfb74
Merge branch 'non-utf-strings' into http-proxy-resolver
arjan-bal Jun 9, 2026
9d2964b
fix merge
arjan-bal Jun 15, 2026
9306284
disable unecessary feature
arjan-bal Jun 15, 2026
18deeb8
Merge remote-tracking branch 'source/master' into http-proxy-resolver
arjan-bal Jun 18, 2026
0428123
fix udeps
arjan-bal Jun 18, 2026
dd4f6bc
fixes
arjan-bal Jun 18, 2026
c1af9e6
use builder to resolver authority
arjan-bal Jun 22, 2026
b0c8289
restrict proxy to dns
arjan-bal Jun 22, 2026
24ee71a
Merge remote-tracking branch 'source/master' into http-proxy-resolver
arjan-bal Jun 22, 2026
09dfb94
no super import, infallible constructor
arjan-bal Jul 1, 2026
b2f47f5
move proxy opts to transport mod
arjan-bal Jul 1, 2026
c3c4234
Merge remote-tracking branch 'source/master' into http-proxy-resolver
arjan-bal Jul 1, 2026
8a1e72a
rustdoc and variable rename
arjan-bal Jul 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ hickory-resolver = { version = "0.26.1", optional = true }
http = "1.1.0"
http-body = "1.0.1"
hyper = { version = "1.6.0", features = ["client", "http2"] }
hyper-util = { version = "0.1", features = ["client-proxy"] }
itoa = "1.0"
parking_lot = "0.12.4"
percent-encoding = "2.3"
Expand Down
162 changes: 1 addition & 161 deletions grpc/src/client/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl PersistentChannel {
.unwrap_or_else(|| resolver_builder.default_authority(&target).to_owned());
let security_opts = SecurityOpts {
credentials,
authority: parse_authority(&authority),
authority: Authority::from_host_port_str(&authority),
handshake_info: ClientHandshakeInfo::default(),
};

Expand Down Expand Up @@ -616,163 +616,3 @@ fn parse_authority(host_and_port: &str) -> Authority {
}
Authority::new(host_and_port.to_string(), None)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_parse_authority() {
struct TestCase {
input: &'static str,
expected: Authority,
}

let cases = [
TestCase {
input: "localhost:http",
expected: Authority::new("localhost:http", None),
},
TestCase {
input: "localhost:80",
expected: Authority::new("localhost", Some(80)),
},
// host name with zone identifier.
TestCase {
input: "localhost%lo0:80",
expected: Authority::new("localhost%lo0", Some(80)),
},
TestCase {
input: "localhost%lo0:http",
expected: Authority::new("localhost%lo0:http", None),
},
TestCase {
input: "[localhost%lo0]:http",
expected: Authority::new("[localhost%lo0]:http", None),
},
TestCase {
input: "[localhost%lo0]:80",
expected: Authority::new("localhost%lo0", Some(80)),
},
// IP literal
TestCase {
input: "127.0.0.1:http",
expected: Authority::new("127.0.0.1:http", None),
},
TestCase {
input: "127.0.0.1:80",
expected: Authority::new("127.0.0.1", Some(80)),
},
TestCase {
input: "[::1]:http",
expected: Authority::new("[::1]:http", None),
},
TestCase {
input: "[::1]:80",
expected: Authority::new("::1", Some(80)),
},
// IP literal with zone identifier.
TestCase {
input: "[::1%lo0]:http",
expected: Authority::new("[::1%lo0]:http", None),
},
TestCase {
input: "[::1%lo0]:80",
expected: Authority::new("::1%lo0", Some(80)),
},
TestCase {
input: ":http",
expected: Authority::new(":http", None),
},
TestCase {
input: ":80",
expected: Authority::new("", Some(80)),
},
TestCase {
input: "grpc.io:",
expected: Authority::new("grpc.io:", None),
},
TestCase {
input: "127.0.0.1:",
expected: Authority::new("127.0.0.1:", None),
},
TestCase {
input: "[::1]:",
expected: Authority::new("[::1]:", None),
},
TestCase {
input: "grpc.io:https%foo",
expected: Authority::new("grpc.io:https%foo", None),
},
TestCase {
input: "grpc.io",
expected: Authority::new("grpc.io", None),
},
TestCase {
input: "127.0.0.1",
expected: Authority::new("127.0.0.1", None),
},
TestCase {
input: "[::1]",
expected: Authority::new("[::1]", None),
},
TestCase {
input: "[fe80::1%lo0]",
expected: Authority::new("[fe80::1%lo0]", None),
},
TestCase {
input: "[localhost%lo0]",
expected: Authority::new("[localhost%lo0]", None),
},
TestCase {
input: "localhost%lo0",
expected: Authority::new("localhost%lo0", None),
},
TestCase {
input: "::1",
expected: Authority::new("::1", None),
},
TestCase {
input: "fe80::1%lo0",
expected: Authority::new("fe80::1%lo0", None),
},
TestCase {
input: "fe80::1%lo0:80",
expected: Authority::new("fe80::1%lo0:80", None),
},
TestCase {
input: "[foo:bar]",
expected: Authority::new("[foo:bar]", None),
},
TestCase {
input: "[foo:bar]baz",
expected: Authority::new("[foo:bar]baz", None),
},
TestCase {
input: "[foo]bar:baz",
expected: Authority::new("[foo]bar:baz", None),
},
TestCase {
input: "[foo]:[bar]:baz",
expected: Authority::new("[foo]:[bar]:baz", None),
},
TestCase {
input: "[foo]:[bar]baz",
expected: Authority::new("[foo]:[bar]baz", None),
},
TestCase {
input: "foo[bar]:baz",
expected: Authority::new("foo[bar]:baz", None),
},
TestCase {
input: "foo]bar:baz",
expected: Authority::new("foo]bar:baz", None),
},
];

for TestCase { input, expected } in cases {
let auth = parse_authority(input);
assert_eq!(auth, expected, "authority mismatch for {}", input);
}
}
}
2 changes: 1 addition & 1 deletion grpc/src/client/name_resolution/dns/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub(crate) fn reg() {
global_registry().add_builder(Box::new(Builder {}));
}

struct Builder {}
pub(crate) struct Builder {}

struct DnsOptions {
min_resolution_interval: Duration,
Expand Down
1 change: 1 addition & 0 deletions grpc/src/client/name_resolution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub(crate) mod unix;
#[cfg(target_os = "linux")]
pub(crate) mod unix_abstract;
pub(crate) use registry::global_registry;
pub(crate) mod proxy_resolver;

/// Target represents a target for gRPC, as specified in:
/// https://github.com/grpc/grpc/blob/master/doc/naming.md.
Expand Down
Loading
Loading