mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-07 22:02:56 +00:00
Compare commits
2 Commits
fix-topk
...
chore/test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ce5e41296 | ||
|
|
b8c362ec65 |
@@ -89,6 +89,10 @@ wrap_with_clap_prefix! {
|
|||||||
region: Option<String>,
|
region: Option<String>,
|
||||||
#[doc = "Enable virtual host style for the object store."]
|
#[doc = "Enable virtual host style for the object store."]
|
||||||
enable_virtual_host_style: bool = Default::default(),
|
enable_virtual_host_style: bool = Default::default(),
|
||||||
|
#[doc = "Allow anonymous access (disable credential signing) for testing."]
|
||||||
|
allow_anonymous: bool = Default::default(),
|
||||||
|
#[doc = "Disable config load from environment and files for testing."]
|
||||||
|
disable_config_load: bool = Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,10 @@ pub struct S3Connection {
|
|||||||
/// By default, opendal will send API to https://s3.us-east-1.amazonaws.com/bucket_name
|
/// By default, opendal will send API to https://s3.us-east-1.amazonaws.com/bucket_name
|
||||||
/// Enabled, opendal will send API to https://bucket_name.s3.us-east-1.amazonaws.com
|
/// Enabled, opendal will send API to https://bucket_name.s3.us-east-1.amazonaws.com
|
||||||
pub enable_virtual_host_style: bool,
|
pub enable_virtual_host_style: bool,
|
||||||
|
/// Allow anonymous access (disable credential signing) - useful for local testing
|
||||||
|
pub allow_anonymous: bool,
|
||||||
|
/// Disable config load from environment and files - useful for local testing
|
||||||
|
pub disable_config_load: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<&S3Connection> for S3 {
|
impl From<&S3Connection> for S3 {
|
||||||
@@ -139,6 +143,14 @@ impl From<&S3Connection> for S3 {
|
|||||||
builder = builder.enable_virtual_host_style();
|
builder = builder.enable_virtual_host_style();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if connection.allow_anonymous {
|
||||||
|
builder = builder.allow_anonymous();
|
||||||
|
}
|
||||||
|
|
||||||
|
if connection.disable_config_load {
|
||||||
|
builder = builder.disable_config_load();
|
||||||
|
}
|
||||||
|
|
||||||
builder
|
builder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,8 +117,8 @@ pub async fn new_oss_object_store(oss_config: &OssConfig) -> Result<ObjectStore>
|
|||||||
pub async fn new_s3_object_store(s3_config: &S3Config) -> Result<ObjectStore> {
|
pub async fn new_s3_object_store(s3_config: &S3Config) -> Result<ObjectStore> {
|
||||||
let root = util::normalize_dir(&s3_config.connection.root);
|
let root = util::normalize_dir(&s3_config.connection.root);
|
||||||
info!(
|
info!(
|
||||||
"The s3 storage bucket is: {}, root is: {}",
|
"The s3 storage bucket is: {}, root is: {}, endpoint: {:?}",
|
||||||
s3_config.connection.bucket, &root
|
s3_config.connection.bucket, &root, s3_config.connection.endpoint
|
||||||
);
|
);
|
||||||
|
|
||||||
let client = build_http_client(&s3_config.http_client)?;
|
let client = build_http_client(&s3_config.http_client)?;
|
||||||
|
|||||||
@@ -147,6 +147,8 @@ fn s3_test_config() -> S3Config {
|
|||||||
bucket: env::var("GT_S3_BUCKET").unwrap(),
|
bucket: env::var("GT_S3_BUCKET").unwrap(),
|
||||||
region: Some(env::var("GT_S3_REGION").unwrap()),
|
region: Some(env::var("GT_S3_REGION").unwrap()),
|
||||||
endpoint: env::var("GT_S3_ENDPOINT_URL").ok(),
|
endpoint: env::var("GT_S3_ENDPOINT_URL").ok(),
|
||||||
|
allow_anonymous: true, // Enable anonymous access to bypass reqsign for local testing
|
||||||
|
disable_config_load: true, // Disable config load to bypass reqsign for local MinIO
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|||||||
Reference in New Issue
Block a user