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

fix: azure sas key url encoding #1036

Merged
merged 2 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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}")]
roeap marked this conversation as resolved.
Show resolved Hide resolved
Decode(String),
}

impl From<BuilderError> for DeltaTableError {
Expand Down