Skip to content

Commit fc23712

Browse files
jonashaagalamb
andauthored
Allow more settings without vendor prefix (#500)
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
1 parent 28b2fc5 commit fc23712

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/aws/builder.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,15 @@ impl FromStr for AmazonS3ConfigKey {
452452
"aws_metadata_endpoint" | "metadata_endpoint" => Ok(Self::MetadataEndpoint),
453453
"aws_unsigned_payload" | "unsigned_payload" => Ok(Self::UnsignedPayload),
454454
"aws_checksum_algorithm" | "checksum_algorithm" => Ok(Self::Checksum),
455-
"aws_container_credentials_relative_uri" => Ok(Self::ContainerCredentialsRelativeUri),
456-
"aws_container_credentials_full_uri" => Ok(Self::ContainerCredentialsFullUri),
457-
"aws_container_authorization_token_file" => Ok(Self::ContainerAuthorizationTokenFile),
455+
"aws_container_credentials_relative_uri" | "container_credentials_relative_uri" => {
456+
Ok(Self::ContainerCredentialsRelativeUri)
457+
}
458+
"aws_container_credentials_full_uri" | "container_credentials_full_uri" => {
459+
Ok(Self::ContainerCredentialsFullUri)
460+
}
461+
"aws_container_authorization_token_file" | "container_authorization_token_file" => {
462+
Ok(Self::ContainerAuthorizationTokenFile)
463+
}
458464
"aws_web_identity_token_file" | "web_identity_token_file" => {
459465
Ok(Self::WebIdentityTokenFile)
460466
}
@@ -468,14 +474,16 @@ impl FromStr for AmazonS3ConfigKey {
468474
"aws_request_payer" | "request_payer" => Ok(Self::RequestPayer),
469475
// Backwards compatibility
470476
"aws_allow_http" => Ok(Self::Client(ClientConfigKey::AllowHttp)),
471-
"aws_server_side_encryption" => Ok(Self::Encryption(
477+
"aws_server_side_encryption" | "server_side_encryption" => Ok(Self::Encryption(
472478
S3EncryptionConfigKey::ServerSideEncryption,
473479
)),
474-
"aws_sse_kms_key_id" => Ok(Self::Encryption(S3EncryptionConfigKey::KmsKeyId)),
475-
"aws_sse_bucket_key_enabled" => {
480+
"aws_sse_kms_key_id" | "sse_kms_key_id" => {
481+
Ok(Self::Encryption(S3EncryptionConfigKey::KmsKeyId))
482+
}
483+
"aws_sse_bucket_key_enabled" | "sse_bucket_key_enabled" => {
476484
Ok(Self::Encryption(S3EncryptionConfigKey::BucketKeyEnabled))
477485
}
478-
"aws_sse_customer_key_base64" => Ok(Self::Encryption(
486+
"aws_sse_customer_key_base64" | "sse_customer_key_base64" => Ok(Self::Encryption(
479487
S3EncryptionConfigKey::CustomerEncryptionKey,
480488
)),
481489
_ => match s.strip_prefix("aws_").unwrap_or(s).parse() {

0 commit comments

Comments
 (0)