Skip to content
Merged
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
2 changes: 2 additions & 0 deletions sdk/storage/azure-storage-blob/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

**Breaking changes**

- `set_container_access_policy` has required parameter `signed_identifiers`.
- NoRetry policy has been removed. Use keyword argument `retry_total=0` for no retries.


## Version 12.0.0b4:

**Breaking changes**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ async def get_container_access_policy(self, **kwargs):

@distributed_trace_async
async def set_container_access_policy(
self, signed_identifiers=None, # type: Optional[Dict[str, Optional[AccessPolicy]]]
self, signed_identifiers, # type: Dict[str, AccessPolicy]
public_access=None, # type: Optional[Union[str, PublicAccess]]
**kwargs # type: Any
): # type: (...) -> Dict[str, Union[str, datetime]]
Expand Down Expand Up @@ -473,18 +473,17 @@ async def set_container_access_policy(
"""
timeout = kwargs.pop('timeout', None)
lease = kwargs.pop('lease', None)
if signed_identifiers:
if len(signed_identifiers) > 5:
raise ValueError(
'Too many access policies provided. The server does not support setting '
'more than 5 access policies on a single resource.')
identifiers = []
for key, value in signed_identifiers.items():
if value:
value.start = serialize_iso(value.start)
value.expiry = serialize_iso(value.expiry)
identifiers.append(SignedIdentifier(id=key, access_policy=value)) # type: ignore
signed_identifiers = identifiers # type: ignore
if len(signed_identifiers) > 5:
raise ValueError(
'Too many access policies provided. The server does not support setting '
'more than 5 access policies on a single resource.')
identifiers = []
for key, value in signed_identifiers.items():
if value:
value.start = serialize_iso(value.start)
value.expiry = serialize_iso(value.expiry)
identifiers.append(SignedIdentifier(id=key, access_policy=value)) # type: ignore
signed_identifiers = identifiers # type: ignore

mod_conditions = ModifiedAccessConditions(
if_modified_since=kwargs.pop('if_modified_since', None),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def get_container_access_policy(self, **kwargs):

@distributed_trace
def set_container_access_policy(
self, signed_identifiers=None, # type: Optional[Dict[str, Optional[AccessPolicy]]]
self, signed_identifiers, # type: Dict[str, AccessPolicy]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using the signed_identifiers in the code and we are still guarding it from being None. But the check may be incorrect (not because of this change) - what is supposed to happen if you specify an empty set of of signed identifiers?

public_access=None, # type: Optional[Union[str, PublicAccess]]
**kwargs
): # type: (...) -> Dict[str, Union[str, datetime]]
Expand Down Expand Up @@ -680,18 +680,17 @@ def set_container_access_policy(
:dedent: 12
:caption: Setting access policy on the container.
"""
if signed_identifiers:
if len(signed_identifiers) > 5:
raise ValueError(
'Too many access policies provided. The server does not support setting '
'more than 5 access policies on a single resource.')
identifiers = []
for key, value in signed_identifiers.items():
if value:
value.start = serialize_iso(value.start)
value.expiry = serialize_iso(value.expiry)
identifiers.append(SignedIdentifier(id=key, access_policy=value)) # type: ignore
signed_identifiers = identifiers # type: ignore
if len(signed_identifiers) > 5:
raise ValueError(
'Too many access policies provided. The server does not support setting '
'more than 5 access policies on a single resource.')
identifiers = []
for key, value in signed_identifiers.items():
if value:
value.start = serialize_iso(value.start)
value.expiry = serialize_iso(value.expiry)
identifiers.append(SignedIdentifier(id=key, access_policy=value)) # type: ignore
signed_identifiers = identifiers # type: ignore
lease = kwargs.pop('lease', None)
mod_conditions = ModifiedAccessConditions(
if_modified_since=kwargs.pop('if_modified_since', None),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ interactions:
uri: https://remotestoragename.blob.core.windows.net/utcontainera4ad1b5c?restype=container&comp=acl
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><SignedIdentifiers\
\ />"
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><SignedIdentifiers
/>"
headers:
Content-Type:
- application/xml
Expand Down Expand Up @@ -241,8 +241,8 @@ interactions:
uri: https://storagename.blob.core.windows.net/utcontainera4ad1b5c?restype=container&comp=acl
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><SignedIdentifiers\
\ />"
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><SignedIdentifiers
/>"
headers:
Content-Type:
- application/xml
Expand All @@ -265,4 +265,138 @@ interactions:
status:
code: 200
message: OK
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '0'
User-Agent:
- azsdk-python-storage-blob/12.0.0b4 Python/3.7.3 (Windows-10-10.0.18362-SP0)
x-ms-client-request-id:
- 2d14fd68-ec82-11e9-ab8c-b831b58100e8
x-ms-date:
- Fri, 11 Oct 2019 23:52:25 GMT
x-ms-version:
- '2019-02-02'
method: PUT
uri: https://blobstoragename.blob.core.windows.net/utcontainera4ad1b5c?restype=container
response:
body:
string: ''
headers:
Content-Length:
- '0'
Date:
- Fri, 11 Oct 2019 23:52:25 GMT
ETag:
- '"0x8D74EA61176CF51"'
Last-Modified:
- Fri, 11 Oct 2019 23:52:26 GMT
Server:
- Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id:
- eb7a1742-201e-007b-518e-800fb0000000
x-ms-version:
- '2019-02-02'
status:
code: 201
message: Created
- request:
body: '<?xml version=''1.0'' encoding=''utf-8''?>

<SignedIdentifiers><SignedIdentifier><Id>testid</Id><AccessPolicy><Start>2019-10-11T23:52:26Z</Start><Expiry>2019-10-12T00:52:26Z</Expiry><Permission>r</Permission></AccessPolicy></SignedIdentifier></SignedIdentifiers>'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '257'
Content-Type:
- application/xml; charset=utf-8
If-Modified-Since:
- Fri, 11 Oct 2019 23:37:26 GMT
User-Agent:
- azsdk-python-storage-blob/12.0.0b4 Python/3.7.3 (Windows-10-10.0.18362-SP0)
x-ms-client-request-id:
- 2d685e10-ec82-11e9-b855-b831b58100e8
x-ms-date:
- Fri, 11 Oct 2019 23:52:26 GMT
x-ms-version:
- '2019-02-02'
method: PUT
uri: https://blobstoragename.blob.core.windows.net/utcontainera4ad1b5c?restype=container&comp=acl
response:
body:
string: ''
headers:
Content-Length:
- '0'
Date:
- Fri, 11 Oct 2019 23:52:25 GMT
ETag:
- '"0x8D74EA6118184BD"'
Last-Modified:
- Fri, 11 Oct 2019 23:52:26 GMT
Server:
- Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id:
- eb7a178d-201e-007b-188e-800fb0000000
x-ms-version:
- '2019-02-02'
status:
code: 200
message: OK
- request:
body: null
headers:
Accept:
- application/xml
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- azsdk-python-storage-blob/12.0.0b4 Python/3.7.3 (Windows-10-10.0.18362-SP0)
x-ms-client-request-id:
- 2d71d352-ec82-11e9-b01f-b831b58100e8
x-ms-date:
- Fri, 11 Oct 2019 23:52:26 GMT
x-ms-version:
- '2019-02-02'
method: GET
uri: https://blobstoragename.blob.core.windows.net/utcontainera4ad1b5c?restype=container&comp=acl
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><SignedIdentifiers><SignedIdentifier><Id>testid</Id><AccessPolicy><Start>2019-10-11T23:52:26.0000000Z</Start><Expiry>2019-10-12T00:52:26.0000000Z</Expiry><Permission>r</Permission></AccessPolicy></SignedIdentifier></SignedIdentifiers>"
headers:
Content-Type:
- application/xml
Date:
- Fri, 11 Oct 2019 23:52:25 GMT
ETag:
- '"0x8D74EA6118184BD"'
Last-Modified:
- Fri, 11 Oct 2019 23:52:26 GMT
Server:
- Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
Transfer-Encoding:
- chunked
Vary:
- Origin
x-ms-request-id:
- eb7a17a3-201e-007b-2c8e-800fb0000000
x-ms-version:
- '2019-02-02'
status:
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ interactions:
uri: https://remotestoragename.blob.core.windows.net/utcontainer335c1d57?restype=container&comp=acl
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ConditionNotMet</Code><Message>The\
\ condition specified using HTTP conditional header(s) is not met.\nRequestId:57e22d37-601e-0077-15d7-22e141000000\n\
Time:2019-06-14T17:33:32.9009539Z</Message></Error>"
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ConditionNotMet</Code><Message>The
condition specified using HTTP conditional header(s) is not met.\nRequestId:57e22d37-601e-0077-15d7-22e141000000\nTime:2019-06-14T17:33:32.9009539Z</Message></Error>"
headers:
Content-Length:
- '252'
Expand Down Expand Up @@ -158,9 +157,8 @@ interactions:
uri: https://storagename.blob.core.windows.net/utcontainer335c1d57?restype=container&comp=acl
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ConditionNotMet</Code><Message>The\
\ condition specified using HTTP conditional header(s) is not met.\nRequestId:e127eba1-801e-00d7-65e0-222e27000000\n\
Time:2019-06-14T18:36:01.6265171Z</Message></Error>"
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ConditionNotMet</Code><Message>The
condition specified using HTTP conditional header(s) is not met.\nRequestId:e127eba1-801e-00d7-65e0-222e27000000\nTime:2019-06-14T18:36:01.6265171Z</Message></Error>"
headers:
Content-Length:
- '252'
Expand All @@ -179,4 +177,95 @@ interactions:
status:
code: 412
message: The condition specified using HTTP conditional header(s) is not met.
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '0'
User-Agent:
- azsdk-python-storage-blob/12.0.0b4 Python/3.7.3 (Windows-10-10.0.18362-SP0)
x-ms-client-request-id:
- 8dfea392-ec83-11e9-8e23-b831b58100e8
x-ms-date:
- Sat, 12 Oct 2019 00:02:17 GMT
x-ms-version:
- '2019-02-02'
method: PUT
uri: https://blobstoragename.blob.core.windows.net/utcontainer335c1d57?restype=container
response:
body:
string: ''
headers:
Content-Length:
- '0'
Date:
- Sat, 12 Oct 2019 00:02:17 GMT
ETag:
- '"0x8D74EA7723A4757"'
Last-Modified:
- Sat, 12 Oct 2019 00:02:17 GMT
Server:
- Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id:
- 98a0c07f-b01e-0013-4090-8051e1000000
x-ms-version:
- '2019-02-02'
status:
code: 201
message: Created
- request:
body: '<?xml version=''1.0'' encoding=''utf-8''?>

<SignedIdentifiers><SignedIdentifier><Id>testid</Id><AccessPolicy><Start>2019-10-12T00:02:18Z</Start><Expiry>2019-10-12T01:02:18Z</Expiry><Permission>r</Permission></AccessPolicy></SignedIdentifier></SignedIdentifiers>'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '257'
Content-Type:
- application/xml; charset=utf-8
If-Modified-Since:
- Sat, 12 Oct 2019 00:17:18 GMT
User-Agent:
- azsdk-python-storage-blob/12.0.0b4 Python/3.7.3 (Windows-10-10.0.18362-SP0)
x-ms-client-request-id:
- 8e2c6bb6-ec83-11e9-a8b5-b831b58100e8
x-ms-date:
- Sat, 12 Oct 2019 00:02:18 GMT
x-ms-version:
- '2019-02-02'
method: PUT
uri: https://blobstoragename.blob.core.windows.net/utcontainer335c1d57?restype=container&comp=acl
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ConditionNotMet</Code><Message>The
condition specified using HTTP conditional header(s) is not met.\nRequestId:98a0c09a-b01e-0013-5790-8051e1000000\nTime:2019-10-12T00:02:17.9791922Z</Message></Error>"
headers:
Content-Length:
- '252'
Content-Type:
- application/xml
Date:
- Sat, 12 Oct 2019 00:02:17 GMT
Server:
- Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-error-code:
- ConditionNotMet
x-ms-request-id:
- 98a0c09a-b01e-0013-5790-8051e1000000
x-ms-version:
- '2019-02-02'
status:
code: 412
message: The condition specified using HTTP conditional header(s) is not met.
version: 1
Loading