koushiro commented on code in PR #7169:
URL: https://github.com/apache/opendal/pull/7169#discussion_r2745937012
##########
core/services/obs/src/backend.rs:
##########
@@ -169,28 +175,27 @@ impl Builder for ObsBuilder {
};
debug!("backend use endpoint {}", &endpoint);
- let mut cfg = HuaweicloudObsConfig::default();
- // Load cfg from env first.
- cfg = cfg.from_env();
+ let ctx = Context::new()
+ .with_file_read(TokioFileRead)
+
.with_http_send(ReqwestHttpSend::new(GLOBAL_REQWEST_CLIENT.clone()))
+ .with_env(OsEnv);
- if let Some(v) = self.config.access_key_id {
- cfg.access_key_id = Some(v);
- }
+ let mut provider =
ProvideCredentialChain::new().push(EnvCredentialProvider::new());
- if let Some(v) = self.config.secret_access_key {
- cfg.secret_access_key = Some(v);
+ if let (Some(ak), Some(sk)) = (&self.config.access_key_id,
&self.config.secret_access_key) {
+ let static_provider = StaticCredentialProvider::new(ak, sk);
Review Comment:
BTW, do we need to add `security_token` to ObsConfig?
--
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]