plusplusjiajia commented on code in PR #2838:
URL: https://github.com/apache/iceberg-rust/pull/2838#discussion_r3650396684
##########
crates/catalog/rest/src/client.rs:
##########
@@ -17,34 +17,27 @@
use std::collections::HashMap;
use std::fmt::{Debug, Formatter};
+use std::sync::Arc;
-use http::StatusCode;
use iceberg::{Error, ErrorKind, Result};
use reqwest::header::HeaderMap;
use reqwest::{Client, IntoUrl, Method, Request, RequestBuilder, Response};
use serde::de::DeserializeOwned;
-use tokio::sync::Mutex;
use crate::RestCatalogConfig;
-use crate::types::{ErrorResponse, TokenResponse};
+use crate::auth::{AuthManager, AuthRequest, AuthSession};
pub(crate) struct HttpClient {
client: Client,
- /// The token to be used for authentication.
- ///
- /// It's possible to fetch the token from the server while needed.
- token: Mutex<Option<String>>,
- /// The token endpoint to be used for authentication.
- token_endpoint: String,
- /// The credential to be used for authentication.
- credential: Option<(Option<String>, String)>,
/// Extra headers to be added to each request.
extra_headers: HeaderMap,
- /// Extra oauth parameters to be added to each authentication request.
- extra_oauth_params: HashMap<String, String>,
/// Whether to disable header redaction in error logs (defaults to false
for security).
disable_header_redaction: bool,
+ /// The auth manager living for the lifetime of the catalog.
+ auth_manager: Arc<dyn AuthManager>,
+ /// The session authenticating requests in the current phase.
+ session: Arc<dyn AuthSession>,
Review Comment:
@DerGut Agreed it gets awkward once `table_session`/`contextual_session`
land. They're on `HttpClient` because that's where requests execute and
init→catalog mirrors `new()`→`update_with()`. Since those methods are deferred
here, I'd move both to `RestCatalog` when they arrive — non-breaking. @CTTY's
call if you'd rather do it now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]