feat: Add SAS token support to azure_storage_queue#3645
feat: Add SAS token support to azure_storage_queue#3645lsiddiquee wants to merge 2 commits intomainfrom
Conversation
This release introduces several significant changes, including: - Updated version to 0.4.0 in Cargo.toml and Cargo.lock. - Added support for constructing clients directly from SAS URLs. - Removed deprecated methods and changed parameter types for better flexibility. - Enhanced examples to demonstrate SAS token usage. - Updated tests to validate SAS token functionality for both QueueClient and QueueServiceClient.
806aa08 to
2d2c9d7
Compare
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
vincenttran-msft
left a comment
There was a problem hiding this comment.
One nit about changelog, but other than that refactor looks like went smoothly! Thanks for your contributions here Likhan, we greatly appreciate it and Queue crate consumers surely will too 😄
Going to leave Jacob to do a final-pass.
…not released Updated the version of the azure_storage_queue package to 0.3.0 in Cargo.toml and Cargo.lock. Adjusted the CHANGELOG to reflect the correct versioning. Added documentation for using SAS URLs in the README.
|
|
||
| /// Test creating, listing, and deleting a queue using SAS token authentication with from_url | ||
| #[recorded::test] | ||
| async fn test_sas_token_from_url(ctx: TestContext) -> Result<()> { |
There was a problem hiding this comment.
Unfortunately, we can't really check-in SAS tests for now as we don't have the ability to generate a SAS from the SDK. Also be careful about accidentally recording a real SAS URL into the assets and that would leak your account info (and flag us). I took a look at your assets for this PR, and it doesn't look like you leaked anything (the recordings for these tests were empty for some reason) but best to just remove these checked-in tests for now.
When removing tests, it's best to delete the recordings from the assets too.
Adds support for Shared Access Signature (SAS) token authentication to the Azure Queue Storage client library, aligning with the authentication patterns used in azure_storage_blob.
Changes
Features Added
from_url()constructors forQueueClientandQueueServiceClientto enable direct URL-based client constructioncredentialparameter optional (Option<Arc<dyn TokenCredential>>) on bothnew()andfrom_url()methods to support multiple authentication scenarios:Breaking Changes
credentialparameter toOption<Arc<dyn TokenCredential>>on client constructorsqueue_nameparameter from ownedStringto&strreference onQueueClient::new()queue_name()accessor fromQueueClientendpointstruct field (now accessed via method)QueueServiceClient::queue_client()to returnResult<QueueClient>instead ofQueueClientImplementation Details
GeneratedQueueClientandGeneratedQueueServiceClient) to implement custom construction logicBearerTokenAuthorizationPolicyonly when credentials are providedQueueServiceClientweren't inheriting test proxy instrumentationQueueServiceClientOptionsinQueueServiceClientto pass client options to childQueueClientinstancesExamples and Tests
Documentation