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
7 changes: 6 additions & 1 deletion cterasdk/direct/lib.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import asyncio
import urllib.parse

from ..lib.retries import execute_with_retries
from .types import Metadata, Block
Expand Down Expand Up @@ -72,6 +73,10 @@ async def get_object(client, file_id, chunk):
raise exception


def is_azure_object_storage(chunk):
return urllib.parse.urlparse(chunk.url).netloc.endswith('core.windows.net')


async def decrypt_object(file_id, encrypted_object, encryption_key, chunk):
"""
Decrypt Encrypted Object.
Expand All @@ -83,7 +88,7 @@ async def decrypt_object(file_id, encrypted_object, encryption_key, chunk):
:rtype: bytes
"""
try:
return decrypt_block(encrypted_object, encryption_key)
return decrypt_block(encrypted_object[16:] if is_azure_object_storage(chunk) else encrypted_object, encryption_key)
except DirectIOError:
logger.error('Failed to decrypt block.')
raise DecryptBlockError(file_id, chunk)
Expand Down
9 changes: 9 additions & 0 deletions docs/source/UserGuides/Miscellaneous/Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
=========

2.20.30
-------

Bug Fixes
^^^^^^^^^
* Update documentation to require :py:class:`cterasdk.core.types.UserAccount` in :py:class:`cterasdk.core.types.CloudFSFolderFindingHelper`
* Support downloading files from Azure Blob Storage via CTERA Direct I/O.


2.20.28
-------

Expand Down