Skip to content

fix(azure): accept SAS tokens with a leading question mark - #996

Merged
Xuanwo merged 3 commits into
mainfrom
xuanwo/normalize-azure-sas-query
Nov 22, 2026
Merged

Xuanwo merged 3 commits into
mainfrom
xuanwo/normalize-azure-sas-query

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 22, 2026

Copy link
Copy Markdown
Member

Azure SAS tokens are commonly copied from a full URL, so they can start with ?. The Azure credential constructors previously stored that delimiter verbatim, and signing appended another separator, producing ??... or &?....

Normalize one optional leading ? in the Azure SAS credential constructors so static and environment SAS credentials sign the same raw query text. Existing query parameters, percent-encoding, ordering, expiry checks, and non-SAS credentials are unchanged.

OpenDAL #8438/#8432 need this so they can derive the source URI by calling Signer::sign(&mut parts, None) instead of appending the configured SAS themselves.

Validation:

  • cargo test -p reqsign-azure-storage --no-fail-fast
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo check -p reqsign-azure-storage --target wasm32-unknown-unknown
  • cargo build --manifest-path reqsign/Cargo.toml --target wasm32-unknown-unknown --no-default-features --features=azure

Normalize one optional leading `?` in the Azure SAS credential constructors so static and environment SAS values copied from URLs sign without producing a doubled query delimiter.
Exercise a single optional leading delimiter in the live SAS signing case and compare the signed URI against the configured token with that delimiter removed.
@Xuanwo
Xuanwo merged commit 485d90d into main Nov 22, 2026
27 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/normalize-azure-sas-query branch November 22, 2026 22:11
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