Skip to content
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

Add AuthorityHost to AzureConfigKey #6773

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions object_store/src/azure/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ pub enum AzureConfigKey {
/// - `authority_id`
AuthorityId,

/// Authority host used in oauth flows
///
/// Supported keys:
/// - `azure_storage_authority_host`
/// - `azure_authority_host`
/// - `authority_host`
AuthorityHost,

/// Shared access signature.
///
/// The signature is expected to be percent-encoded, much like they are provided
Expand Down Expand Up @@ -383,6 +391,7 @@ impl AsRef<str> for AzureConfigKey {
Self::ClientId => "azure_storage_client_id",
Self::ClientSecret => "azure_storage_client_secret",
Self::AuthorityId => "azure_storage_tenant_id",
Self::AuthorityHost => "azure_storage_authority_host",
Self::SasKey => "azure_storage_sas_key",
Self::Token => "azure_storage_token",
Self::UseEmulator => "azure_storage_use_emulator",
Expand Down Expand Up @@ -427,6 +436,9 @@ impl FromStr for AzureConfigKey {
| "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)
}
Expand Down Expand Up @@ -556,6 +568,7 @@ impl MicrosoftAzureBuilder {
AzureConfigKey::ClientId => self.client_id = Some(value.into()),
AzureConfigKey::ClientSecret => self.client_secret = Some(value.into()),
AzureConfigKey::AuthorityId => self.tenant_id = Some(value.into()),
AzureConfigKey::AuthorityHost => self.authority_host = Some(value.into()),
AzureConfigKey::SasKey => self.sas_key = Some(value.into()),
AzureConfigKey::Token => self.bearer_token = Some(value.into()),
AzureConfigKey::MsiEndpoint => self.msi_endpoint = Some(value.into()),
Expand Down Expand Up @@ -602,6 +615,7 @@ impl MicrosoftAzureBuilder {
AzureConfigKey::ClientId => self.client_id.clone(),
AzureConfigKey::ClientSecret => self.client_secret.clone(),
AzureConfigKey::AuthorityId => self.tenant_id.clone(),
AzureConfigKey::AuthorityHost => self.authority_host.clone(),
AzureConfigKey::SasKey => self.sas_key.clone(),
AzureConfigKey::Token => self.bearer_token.clone(),
AzureConfigKey::UseEmulator => Some(self.use_emulator.to_string()),
Expand Down
Loading