Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions core/services/azblob/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ impl Builder for AzblobBuilder {
encryption_algorithm,
container: self.config.container.clone(),
skip_signature: self.config.skip_signature,
sas_token: self.config.sas_token.clone(),
signer,
}),
})
Expand Down
6 changes: 6 additions & 0 deletions core/services/azblob/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ pub struct AzblobCore {
pub encryption_key_sha256: Option<HeaderValue>,
pub encryption_algorithm: Option<HeaderValue>,
pub skip_signature: bool,
pub sas_token: Option<String>,
pub signer: Signer<Credential>,
}

Expand Down Expand Up @@ -790,6 +791,10 @@ impl AzblobCore {
.push("versionid", &percent_encode_path(version))
.finish();
}
if let Some(sas_token) = &self.sas_token {
let sep = if source.contains('?') { '&' } else { '?' };
source = format!("{source}{sep}{sas_token}");
}
let target = self.build_path_url(to);

let mut req = Request::put(&target)
Expand Down Expand Up @@ -955,6 +960,7 @@ mod tests {
encryption_key_sha256: None,
encryption_algorithm: None,
skip_signature: true,
sas_token: None,
signer: Signer::new(
Context::new(),
StaticCredentialProvider::new_shared_key("acc", "a2V5"),
Expand Down
1 change: 1 addition & 0 deletions core/services/ghac/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ impl GhacWriter {
encryption_key_sha256: None,
encryption_algorithm: None,
skip_signature: false,
sas_token: None,
signer,
});
let w = AzblobWriter::new(
Expand Down
Loading