-
Notifications
You must be signed in to change notification settings - Fork 375
feat(aws_s3): Add S3 compatibility environment variables for non-AWS services #198
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,20 @@ static AWS_S3_FORCE_PATH_STYLE: LazyLock<bool> = LazyLock::new(|| { | |
.unwrap_or_default() | ||
}); | ||
|
||
static AWS_S3_DISABLE_SSE: LazyLock<bool> = LazyLock::new(|| { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you'll also want to add them to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll take care of it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright. Let me know if there is anything else you want me to fix or change. |
||
env::var("AWS_S3_DISABLE_SSE") | ||
.ok() | ||
.and_then(|s| s.parse().ok()) | ||
.unwrap_or_default() | ||
}); | ||
|
||
static AWS_S3_DISABLE_CHECKSUMS: LazyLock<bool> = LazyLock::new(|| { | ||
env::var("AWS_S3_DISABLE_CHECKSUMS") | ||
.ok() | ||
.and_then(|s| s.parse().ok()) | ||
.unwrap_or_default() | ||
}); | ||
|
||
/// Similar aws_config::from_env but returns an error if credentials or | ||
/// region is are not. It also doesn't spew out log lines every time | ||
/// credentials are accessed. | ||
|
@@ -62,3 +76,13 @@ pub async fn must_s3_config_from_env() -> anyhow::Result<S3ConfigBuilder> { | |
s3_config_builder = s3_config_builder.force_path_style(*AWS_S3_FORCE_PATH_STYLE); | ||
Ok(s3_config_builder) | ||
} | ||
|
||
/// Returns true if server-side encryption headers should be disabled | ||
pub fn is_sse_disabled() -> bool { | ||
*AWS_S3_DISABLE_SSE | ||
} | ||
|
||
/// Returns true if checksum headers should be disabled | ||
pub fn are_checksums_disabled() -> bool { | ||
*AWS_S3_DISABLE_CHECKSUMS | ||
} |
Uh oh!
There was an error while loading. Please reload this page.