Skip to content

Conversation

jonashaag
Copy link

Which issue does this PR close?

Closes #.

Rationale for this change

Similar to #467, also allow server_side_encryption instead of aws_server_side_encryption and some other aws_ prefixed settings.

What changes are included in this PR?

Are there any user-facing changes?

Copy link
Member

@kylebarron kylebarron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good to align with Google and Azure config keys, where every key supports both the vendor prefix like aws_bucket as well as the bare version bucket

match s {
"google_service_account"
| "service_account"
| "google_service_account_path"
| "service_account_path" => Ok(Self::ServiceAccount),
"google_service_account_key" | "service_account_key" => Ok(Self::ServiceAccountKey),
"google_bucket" | "google_bucket_name" | "bucket" | "bucket_name" => Ok(Self::Bucket),
"google_application_credentials" | "application_credentials" => {
Ok(Self::ApplicationCredentials)
}
"google_skip_signature" | "skip_signature" => Ok(Self::SkipSignature),

fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"azure_storage_account_key"
| "azure_storage_access_key"
| "azure_storage_master_key"
| "master_key"
| "account_key"
| "access_key" => Ok(Self::AccessKey),
"azure_storage_account_name" | "account_name" => Ok(Self::AccountName),
"azure_storage_client_id" | "azure_client_id" | "client_id" => Ok(Self::ClientId),
"azure_storage_client_secret" | "azure_client_secret" | "client_secret" => {
Ok(Self::ClientSecret)
}
"azure_storage_tenant_id"
| "azure_storage_authority_id"
| "azure_tenant_id"
| "azure_authority_id"
| "tenant_id"
| "authority_id" => Ok(Self::AuthorityId),
"azure_storage_authority_host" | "azure_authority_host" | "authority_host" => {
Ok(Self::AuthorityHost)
}
"azure_storage_sas_key" | "azure_storage_sas_token" | "sas_key" | "sas_token" => {
Ok(Self::SasKey)
}
"azure_storage_token" | "bearer_token" | "token" => Ok(Self::Token),
"azure_storage_use_emulator" | "use_emulator" => Ok(Self::UseEmulator),
"azure_storage_endpoint" | "azure_endpoint" | "endpoint" => Ok(Self::Endpoint),
"azure_msi_endpoint"
| "azure_identity_endpoint"
| "identity_endpoint"
| "msi_endpoint" => Ok(Self::MsiEndpoint),
"azure_object_id" | "object_id" => Ok(Self::ObjectId),
"azure_msi_resource_id" | "msi_resource_id" => Ok(Self::MsiResourceId),
"azure_federated_token_file" | "federated_token_file" => Ok(Self::FederatedTokenFile),
"azure_use_fabric_endpoint" | "use_fabric_endpoint" => Ok(Self::UseFabricEndpoint),
"azure_use_azure_cli" | "use_azure_cli" => Ok(Self::UseAzureCli),
"azure_skip_signature" | "skip_signature" => Ok(Self::SkipSignature),
"azure_container_name" | "container_name" => Ok(Self::ContainerName),
"azure_disable_tagging" | "disable_tagging" => Ok(Self::DisableTagging),
"azure_fabric_token_service_url" | "fabric_token_service_url" => {
Ok(Self::FabricTokenServiceUrl)
}
"azure_fabric_workload_host" | "fabric_workload_host" => Ok(Self::FabricWorkloadHost),
"azure_fabric_session_token" | "fabric_session_token" => Ok(Self::FabricSessionToken),
"azure_fabric_cluster_identifier" | "fabric_cluster_identifier" => {
Ok(Self::FabricClusterIdentifier)
}
// Backwards compatibility
"azure_allow_http" => Ok(Self::Client(ClientConfigKey::AllowHttp)),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants