Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Support SAS URL in addition to SAS Token. #123

Open
bmc-msft opened this issue May 20, 2019 · 1 comment
Open

Support SAS URL in addition to SAS Token. #123

bmc-msft opened this issue May 20, 2019 · 1 comment

Comments

@bmc-msft
Copy link

In the Azure portal and Storage Explorer, when you generate a SAS token, you are given the option to use the generated SAS URL, which can include much of the details needed for the rest of the operations.

These are in the form:

https://a.blob.core.windows.net/b/c?d

This would simplify the use of Client::azure_sas() as well as provide some of the needed information when the SAS token is limited to a specific object, rather than container or storage account.

As an example, providing the SAS URL looks like this now:

let client = Client::azure_sas("a", "https://a.blob.core.windows.net/b/c?d");
let future client.get_blob().with_container_name("b").with_blob_name("c").finalize();

Where parsing that information out (of which, Url::Options is already being used to parse the token), it could look like this:

let client = Client::azure_sas_url("https://a.blob.core.windows.net/b/c?d");
let future = client.get_blob().finalize();

Supporting SAS URLs significantly improves the ergonomics of user supplied storage locations. As an example, the javascript library supports these:

@bmc-msft
Copy link
Author

As SAS URLs can be fore the account, container, or blob, doing the parsing to identify the components provided in the URL would be needful.

Example, this would provide everything:
https://a.blob.core.windows.net/b/c?d

Example, this would provide just the account, token, and container name:
https://a.blob.core.windows.net/b?d

Example, this would provide just the account and token:
https://a.blob.core.windows.net/?d

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants