diff options
Diffstat (limited to 'tvix/castore/src/directoryservice/from_addr.rs')
-rw-r--r-- | tvix/castore/src/directoryservice/from_addr.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tvix/castore/src/directoryservice/from_addr.rs b/tvix/castore/src/directoryservice/from_addr.rs index ee675ca68a..999170dcd1 100644 --- a/tvix/castore/src/directoryservice/from_addr.rs +++ b/tvix/castore/src/directoryservice/from_addr.rs @@ -63,18 +63,25 @@ pub async fn from_addr(uri: &str) -> Result<Box<dyn DirectoryService>, crate::Er // - In the case of unix sockets, there must be a path, but may not be a host. // - In the case of non-unix sockets, there must be a host, but no path. // Constructing the channel is handled by tvix_castore::channel::from_url. - let client = DirectoryServiceClient::new(crate::tonic::channel_from_url(&url).await?); - Box::new(GRPCDirectoryService::from_client(client)) + Box::new(GRPCDirectoryService::from_client( + DirectoryServiceClient::with_interceptor( + crate::tonic::channel_from_url(&url).await?, + tvix_tracing::propagate::tonic::send_trace, + ), + )) } scheme if scheme.starts_with("objectstore+") => { // We need to convert the URL to string, strip the prefix there, and then // parse it back as url, as Url::set_scheme() rejects some of the transitions we want to do. let trimmed_url = { let s = url.to_string(); - Url::parse(s.strip_prefix("objectstore+").unwrap()).unwrap() + let mut url = Url::parse(s.strip_prefix("objectstore+").unwrap()).unwrap(); + // trim the query pairs, they might contain credentials or local settings we don't want to send as-is. + url.set_query(None); + url }; Box::new( - ObjectStoreDirectoryService::parse_url(&trimmed_url) + ObjectStoreDirectoryService::parse_url_opts(&trimmed_url, url.query_pairs()) .map_err(|e| Error::StorageError(e.to_string()))?, ) } |