Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ssstar): add force_path_style config #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions ssstar/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ pub struct Config {
/// This defaults to something provided by the AWS SDK for Rust.
#[cfg_attr(feature = "clap", clap(long, global = true))]
pub user_agent: Option<String>,

/// Force the client to use path-style addressing for buckets.
#[cfg_attr(feature = "clap", clap(long, global = true))]
pub force_path_style: bool,
}

impl Default for Config {
Expand All @@ -153,6 +157,7 @@ impl Default for Config {
max_concurrent_requests: 10,
max_queue_size: 1000,
user_agent: None,
force_path_style: false,
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions ssstar/src/objstore/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,10 @@ async fn make_s3_client(
.map_err(|err| crate::S3TarError::HeaderValueConvertion { source: err })?,
});

if config.force_path_style {
s3_config_builder = s3_config_builder.force_path_style(true);
}

if let Some(s3_endpoint) = &config.s3_endpoint {
s3_config_builder = s3_config_builder.endpoint_url(s3_endpoint.to_string());
}
Expand Down