Skip to content

Commit

Permalink
feat(connector): allow custom s3 endpoint (#8246)
Browse files Browse the repository at this point in the history
  • Loading branch information
adevday authored Mar 1, 2023
1 parent 76af020 commit c75863a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/connector/src/source/filesystem/s3/enumerator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ mod tests {
match_pattern: Some("happy[0-9].csv".to_owned()),
access: None,
secret: None,
endpoint_url: None,
};
let mut enumerator = S3SplitEnumerator::new(props.clone()).await.unwrap();
let splits = enumerator.list_splits().await.unwrap();
Expand Down
6 changes: 6 additions & 0 deletions src/connector/src/source/filesystem/s3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ pub struct S3Properties {
pub access: Option<String>,
#[serde(rename = "s3.credentials.secret", default)]
pub secret: Option<String>,
#[serde(rename = "s3.endpoint_url")]
endpoint_url: Option<String>,
}

impl From<S3Properties> for HashMap<String, String> {
Expand All @@ -46,6 +48,10 @@ impl From<S3Properties> for HashMap<String, String> {
if props.secret.is_some() {
m.insert("secret_access".to_owned(), props.secret.unwrap());
}
if props.endpoint_url.is_some() {
m.insert("endpoint_url".to_owned(), props.endpoint_url.unwrap());
}

m
}
}
1 change: 1 addition & 0 deletions src/connector/src/source/filesystem/s3/source/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ mod tests {
match_pattern: None,
access: None,
secret: None,
endpoint_url: None,
};
let mut enumerator = S3SplitEnumerator::new(props.clone()).await.unwrap();
let splits = enumerator.list_splits().await.unwrap();
Expand Down

0 comments on commit c75863a

Please sign in to comment.