Skip to content

Commit

Permalink
fix: azure sas key url encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
roeap committed Dec 21, 2022
1 parent 28d4aa3 commit d5745da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rust/src/builder/azure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::DeltaResult;

use object_store::azure::MicrosoftAzureBuilder;
use once_cell::sync::Lazy;
use percent_encoding::percent_decode_str;

#[derive(PartialEq, Eq)]
enum AzureConfigKey {
Expand Down Expand Up @@ -220,6 +221,9 @@ fn parse_boolean(term: &str) -> Option<bool> {
}

fn split_sas(sas: &str) -> Result<Vec<(String, String)>, BuilderError> {
let sas = percent_decode_str(sas)
.decode_utf8()
.map_err(|err| BuilderError::Decode(err.to_string()))?;
let kv_str_pairs = sas
.trim_start_matches('?')
.split('&')
Expand Down
2 changes: 2 additions & 0 deletions rust/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ enum BuilderError {
Required(String),
#[error("Failed to find valid credential.")]
MissingCredential,
#[error("Failed to decode sas key. {0}")]
Decode(String),
}

impl From<BuilderError> for DeltaTableError {
Expand Down

0 comments on commit d5745da

Please sign in to comment.