-
Notifications
You must be signed in to change notification settings - Fork 319
[Storage] set/get_access_policy for ContainerClient
#3303
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
base: main
Are you sure you want to change the base?
[Storage] set/get_access_policy for ContainerClient
#3303
Conversation
set/get_access_policy for ContainerClient
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs
Outdated
Show resolved
Hide resolved
sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for setting and getting access policies on blob containers, allowing control over public access to container data. The implementation follows Azure Storage's access policy model using signed identifiers.
Key Changes
- Added
set_access_policy()andget_access_policy()methods toBlobContainerClient - Changed
AccessPolicydate fields fromOffsetDateTimetoStringto support custom formatting with exactly 7 decimal precision - Changed
BlobTagstoHashMap<String, String>conversion fromTryFromtoFrom(breaking change)
Reviewed Changes
Copilot reviewed 11 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/storage/azure_storage_blob/tsp-location.yaml | Updated TypeSpec commit reference |
| sdk/storage/azure_storage_blob/tests/blob_container_client.rs | Added comprehensive test for access policy set/get operations |
| sdk/storage/azure_storage_blob/tests/blob_client.rs | Updated blob tags test to use into() instead of try_into() |
| sdk/storage/azure_storage_blob/src/parsers.rs | Added format_storage_datetime() helper function for RFC3339 formatting with 7 decimal places |
| sdk/storage/azure_storage_blob/src/models/mod.rs | Added exports for new types: AccessPolicy, SignedIdentifiers, SignedIdentifiersHeaders, and related options |
| sdk/storage/azure_storage_blob/src/models/extensions.rs | Changed BlobTags to HashMap conversion from TryFrom to From; added HashMap<String, AccessPolicy> to SignedIdentifiers conversion |
| sdk/storage/azure_storage_blob/src/generated/models/pub_models.rs | Updated generated models: AccessPolicy fields changed to String, removed BlobContainerClientSetAccessPolicyResult, added SignedIdentifiers struct |
| sdk/storage/azure_storage_blob/src/generated/models/models_impl.rs | Added TryFrom implementation for SignedIdentifiers to RequestContent |
| sdk/storage/azure_storage_blob/src/generated/models/header_traits.rs | Removed BlobContainerClientSetAccessPolicyResultHeaders trait, added SignedIdentifiersHeaders trait, updated response types |
| sdk/storage/azure_storage_blob/src/generated/clients/blob_container_client.rs | Updated generated client: get_access_policy() returns SignedIdentifiers, set_access_policy() returns unit type |
| sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs | Added public wrapper methods for set_access_policy() and get_access_policy() with documentation |
| sdk/storage/azure_storage_blob/assets.json | Updated test assets tag |
| sdk/storage/azure_storage_blob/Cargo.toml | Added time workspace dependency |
| sdk/storage/azure_storage_blob/CHANGELOG.md | Added changelog entries for new features and breaking changes |
| sdk/storage/.dict.txt | Added "subsecond" to dictionary |
| Cargo.lock | Updated dependencies including include-file version bump and added time to azure_storage_blob |
.tsp: [Storage]get/set_access_policyTypeSpec Changes azure-rest-api-specs#38633set_access_policy()andget_access_policy()Fromimpl forHashMap<String, AccessPolicy>->SignedIdentifiersTryFromtoFromfor consistency, especially since fallible case was not actually fallibleSetAccessPolicy: Completely NULLED
GetAccessPolicy: