Skip to content

Commit

Permalink
Privated hierarchy traversal and fixed encryption algorithm (Azure#18212
Browse files Browse the repository at this point in the history
)

* Privated hierarchy traversal

* fixed encryption algo

* updated changelog
  • Loading branch information
tasherif-msft authored Apr 22, 2021
1 parent bfb7119 commit 582085e
Show file tree
Hide file tree
Showing 24 changed files with 190 additions and 267 deletions.
4 changes: 1 addition & 3 deletions sdk/storage/azure-storage-blob/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Release History

## 12.8.1 (2021-04-20)
**New Features**
- Added support for `BlobClient -> ContainerClient -> BlobServiceClient` Traversal

**Fixes**
- Fixed retry on large block upload
- Make `AccountName`, `AccountKey` etc. in conn_str case insensitive
Expand All @@ -14,6 +11,7 @@
- Fixed retries for blob download streams (#18164, #17974, #10572 (comment))
- Added chunk streaming docstrings and samples (#17149, #11009)
- Added retry for blob download (#17974, #10572)
- Fixed encryption algorithm hardcoded setting (#17835)


## 12.8.0 (2021-03-01)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3754,7 +3754,7 @@ def seal_append_blob(self, **kwargs):
process_storage_error(error)

@distributed_trace
def get_container_client(self): # pylint: disable=client-method-missing-kwargs
def _get_container_client(self): # pylint: disable=client-method-missing-kwargs
# type: (...) -> ContainerClient
"""Get a client to interact with the blob's parent container.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def set_container_metadata( # type: ignore
process_storage_error(error)

@distributed_trace
def get_blob_service_client(self): # pylint: disable=client-method-missing-kwargs
def _get_blob_service_client(self): # pylint: disable=client-method-missing-kwargs
# type: (...) -> BlobServiceClient
"""Get a client to interact with the container's parent service account.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ async def create(
content_length: int,
timeout: Optional[int] = None,
metadata: Optional[str] = None,
encryption_algorithm: Optional[str] = "AES256",
request_id_parameter: Optional[str] = None,
blob_tags_string: Optional[str] = None,
blob_http_headers: Optional["_models.BlobHTTPHeaders"] = None,
Expand All @@ -71,10 +70,6 @@ async def create(
rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more
information.
:type metadata: str
:param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently,
the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is
provided.
:type encryption_algorithm: str
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled.
:type request_id_parameter: str
Expand Down Expand Up @@ -110,6 +105,7 @@ async def create(
_blob_content_disposition = None
_encryption_key = None
_encryption_key_sha256 = None
_encryption_algorithm = None
_encryption_scope = None
_if_modified_since = None
_if_unmodified_since = None
Expand All @@ -126,6 +122,7 @@ async def create(
if cpk_info is not None:
_encryption_key = cpk_info.encryption_key
_encryption_key_sha256 = cpk_info.encryption_key_sha256
_encryption_algorithm = cpk_info.encryption_algorithm
if cpk_scope_info is not None:
_encryption_scope = cpk_scope_info.encryption_scope
if lease_access_conditions is not None:
Expand Down Expand Up @@ -175,8 +172,8 @@ async def create(
header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str')
if _encryption_key_sha256 is not None:
header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str')
if encryption_algorithm is not None:
header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str')
if _encryption_algorithm is not None:
header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str')
if _encryption_scope is not None:
header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str')
if _if_modified_since is not None:
Expand Down Expand Up @@ -230,7 +227,6 @@ async def append_block(
timeout: Optional[int] = None,
transactional_content_md5: Optional[bytearray] = None,
transactional_content_crc64: Optional[bytearray] = None,
encryption_algorithm: Optional[str] = "AES256",
request_id_parameter: Optional[str] = None,
lease_access_conditions: Optional["_models.LeaseAccessConditions"] = None,
append_position_access_conditions: Optional["_models.AppendPositionAccessConditions"] = None,
Expand All @@ -257,10 +253,6 @@ async def append_block(
:param transactional_content_crc64: Specify the transactional crc64 for the body, to be
validated by the service.
:type transactional_content_crc64: bytearray
:param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently,
the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is
provided.
:type encryption_algorithm: str
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled.
:type request_id_parameter: str
Expand Down Expand Up @@ -290,6 +282,7 @@ async def append_block(
_append_position = None
_encryption_key = None
_encryption_key_sha256 = None
_encryption_algorithm = None
_encryption_scope = None
_if_modified_since = None
_if_unmodified_since = None
Expand All @@ -302,6 +295,7 @@ async def append_block(
if cpk_info is not None:
_encryption_key = cpk_info.encryption_key
_encryption_key_sha256 = cpk_info.encryption_key_sha256
_encryption_algorithm = cpk_info.encryption_algorithm
if cpk_scope_info is not None:
_encryption_scope = cpk_scope_info.encryption_scope
if lease_access_conditions is not None:
Expand Down Expand Up @@ -346,8 +340,8 @@ async def append_block(
header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str')
if _encryption_key_sha256 is not None:
header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str')
if encryption_algorithm is not None:
header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str')
if _encryption_algorithm is not None:
header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str')
if _encryption_scope is not None:
header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str')
if _if_modified_since is not None:
Expand Down Expand Up @@ -406,7 +400,6 @@ async def append_block_from_url(
source_contentcrc64: Optional[bytearray] = None,
timeout: Optional[int] = None,
transactional_content_md5: Optional[bytearray] = None,
encryption_algorithm: Optional[str] = "AES256",
request_id_parameter: Optional[str] = None,
cpk_info: Optional["_models.CpkInfo"] = None,
cpk_scope_info: Optional["_models.CpkScopeInfo"] = None,
Expand Down Expand Up @@ -440,10 +433,6 @@ async def append_block_from_url(
:param transactional_content_md5: Specify the transactional md5 for the body, to be validated
by the service.
:type transactional_content_md5: bytearray
:param encryption_algorithm: The algorithm used to produce the encryption key hash. Currently,
the only accepted value is "AES256". Must be provided if the x-ms-encryption-key header is
provided.
:type encryption_algorithm: str
:param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
limit that is recorded in the analytics logs when storage analytics logging is enabled.
:type request_id_parameter: str
Expand Down Expand Up @@ -472,6 +461,7 @@ async def append_block_from_url(

_encryption_key = None
_encryption_key_sha256 = None
_encryption_algorithm = None
_encryption_scope = None
_lease_id = None
_max_size = None
Expand All @@ -491,6 +481,7 @@ async def append_block_from_url(
if cpk_info is not None:
_encryption_key = cpk_info.encryption_key
_encryption_key_sha256 = cpk_info.encryption_key_sha256
_encryption_algorithm = cpk_info.encryption_algorithm
if cpk_scope_info is not None:
_encryption_scope = cpk_scope_info.encryption_scope
if lease_access_conditions is not None:
Expand Down Expand Up @@ -538,8 +529,8 @@ async def append_block_from_url(
header_parameters['x-ms-encryption-key'] = self._serialize.header("encryption_key", _encryption_key, 'str')
if _encryption_key_sha256 is not None:
header_parameters['x-ms-encryption-key-sha256'] = self._serialize.header("encryption_key_sha256", _encryption_key_sha256, 'str')
if encryption_algorithm is not None:
header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", encryption_algorithm, 'str')
if _encryption_algorithm is not None:
header_parameters['x-ms-encryption-algorithm'] = self._serialize.header("encryption_algorithm", _encryption_algorithm, 'str')
if _encryption_scope is not None:
header_parameters['x-ms-encryption-scope'] = self._serialize.header("encryption_scope", _encryption_scope, 'str')
if _lease_id is not None:
Expand Down
Loading

0 comments on commit 582085e

Please sign in to comment.