From 1a5c70542a0032d8ec4a6d150d5fb5c702ce2f4a Mon Sep 17 00:00:00 2001 From: antisch Date: Mon, 7 Jun 2021 10:40:53 -0700 Subject: [PATCH 1/6] Updated access policy behaviour --- sdk/tables/azure-data-tables/CHANGELOG.md | 2 ++ .../azure/data/tables/_models.py | 4 ---- .../azure/data/tables/_table_client.py | 20 +++++++++++-------- .../data/tables/aio/_table_client_async.py | 19 ++++++++++-------- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index 3638e63d0d9f..1e3d7a698db1 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -9,6 +9,8 @@ `TableAccessPolicy`, `TableMetrics`, `TableRetentionPolicy`, `TableCorsRule` * All parameters for `TableServiceClient.set_service_properties` are now keyword-only. * The `credential` parameter for all Clients is now keyword-only. +* The parameters for `TableAccessPolicy` are now all required. +* The method `TableClient.get_access_policy` will now return `None` where previously it returned an "empty" access policy object. **Fixes** * Fixed support for Cosmos emulator endpoint, via URL/credential or connection string. diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py index a5835fea79ee..ba069965c133 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py @@ -73,10 +73,6 @@ class TableAccessPolicy(GenAccessPolicy): be UTC. :paramtype start: ~datetime.datetime or str """ - def __init__(self, **kwargs): # pylint: disable=super-init-not-called - self.start = kwargs.get('start') - self.expiry = kwargs.get('expiry') - self.permission = kwargs.get('permission') class TableAnalyticsLogging(GeneratedLogging): diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 8cecd4846783..5aebe26cd279 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -169,12 +169,12 @@ def from_table_url(cls, table_url, **kwargs): def get_table_access_policy( self, **kwargs # type: Any ): - # type: (...) -> Dict[str, TableAccessPolicy] + # type: (...) -> Dict[str, Optional[TableAccessPolicy]] """Retrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures. :return: Dictionary of SignedIdentifiers - :rtype: Dict[str, :class:`~azure.data.tables.TableAccessPolicy`] + :rtype: Dict[str, Optional[:class:`~azure.data.tables.TableAccessPolicy`]] :raises: :class:`~azure.core.exceptions.HttpResponseError` """ timeout = kwargs.pop("timeout", None) @@ -187,29 +187,33 @@ def get_table_access_policy( ) except HttpResponseError as error: _process_table_error(error) - return {s.id: s.access_policy or TableAccessPolicy() for s in identifiers} # type: ignore + return {s.id: s.access_policy or None for s in identifiers} # type: ignore @distributed_trace def set_table_access_policy( self, - signed_identifiers, # type: Dict[str, TableAccessPolicy] + signed_identifiers, # type: Dict[str, Optional[TableAccessPolicy]] **kwargs ): # type: (...) -> None """Sets stored access policies for the table that may be used with Shared Access Signatures. :param signed_identifiers: Access policies to set for the table - :type signed_identifiers: Dict[str, :class:`~azure.data.tables.TableAccessPolicy`] + :type signed_identifiers: Dict[str, Optional[:class:`~azure.data.tables.TableAccessPolicy`]] :return: None :rtype: None :raises: :class:`~azure.core.exceptions.HttpResponseError` """ identifiers = [] for key, value in signed_identifiers.items(): + payload = None if value: - value.start = serialize_iso(value.start) - value.expiry = serialize_iso(value.expiry) - identifiers.append(SignedIdentifier(id=key, access_policy=value)) + payload = TableAccessPolicy( + start=serialize_iso(value.start), + expiry=serialize_iso(value.expiry), + permission=value.permission + ) + identifiers.append(SignedIdentifier(id=key, access_policy=payload)) signed_identifiers = identifiers # type: ignore try: self._client.table.set_access_policy( diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 84ffaea67f41..cdf1614f8ba5 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -158,13 +158,13 @@ def from_table_url( return cls(endpoint, table_name=table_name, **kwargs) @distributed_trace_async - async def get_table_access_policy(self, **kwargs) -> Mapping[str, TableAccessPolicy]: + async def get_table_access_policy(self, **kwargs) -> Mapping[str, Optional[TableAccessPolicy]]: """ Retrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures. :return: Dictionary of SignedIdentifiers - :rtype: Dict[str, :class:`~azure.data.tables.TableAccessPolicy`] + :rtype: Dict[str, Optional[:class:`~azure.data.tables.TableAccessPolicy`]] :raises: :class:`~azure.core.exceptions.HttpResponseError` """ timeout = kwargs.pop("timeout", None) @@ -178,15 +178,14 @@ async def get_table_access_policy(self, **kwargs) -> Mapping[str, TableAccessPol except HttpResponseError as error: _process_table_error(error) return { - s.id: s.access_policy - or TableAccessPolicy(start=None, expiry=None, permission=None) + s.id: s.access_policy or None for s in identifiers # type: ignore } @distributed_trace_async async def set_table_access_policy( self, - signed_identifiers: Mapping[str, TableAccessPolicy], + signed_identifiers: Mapping[str, Optional[TableAccessPolicy]], **kwargs ) -> None: """Sets stored access policies for the table that may be used with Shared Access Signatures. @@ -199,10 +198,14 @@ async def set_table_access_policy( """ identifiers = [] for key, value in signed_identifiers.items(): + payload = None if value: - value.start = serialize_iso(value.start) - value.expiry = serialize_iso(value.expiry) - identifiers.append(SignedIdentifier(id=key, access_policy=value)) + payload = TableAccessPolicy( + start=serialize_iso(value.start), + expiry=serialize_iso(value.expiry), + permission=value.permission + ) + identifiers.append(SignedIdentifier(id=key, access_policy=payload)) try: await self._client.table.set_access_policy( table=self.table_name, table_acl=identifiers or None, **kwargs # type: ignore From b0c0365ded1e0aea555bdd330223a8ff252f428a Mon Sep 17 00:00:00 2001 From: antisch Date: Mon, 7 Jun 2021 19:17:54 -0700 Subject: [PATCH 2/6] Reverted model constructor --- sdk/tables/azure-data-tables/CHANGELOG.md | 1 - sdk/tables/azure-data-tables/azure/data/tables/_models.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index 1e3d7a698db1..d73b4a2a2c30 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -9,7 +9,6 @@ `TableAccessPolicy`, `TableMetrics`, `TableRetentionPolicy`, `TableCorsRule` * All parameters for `TableServiceClient.set_service_properties` are now keyword-only. * The `credential` parameter for all Clients is now keyword-only. -* The parameters for `TableAccessPolicy` are now all required. * The method `TableClient.get_access_policy` will now return `None` where previously it returned an "empty" access policy object. **Fixes** diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_models.py b/sdk/tables/azure-data-tables/azure/data/tables/_models.py index ba069965c133..a5835fea79ee 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_models.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_models.py @@ -73,6 +73,10 @@ class TableAccessPolicy(GenAccessPolicy): be UTC. :paramtype start: ~datetime.datetime or str """ + def __init__(self, **kwargs): # pylint: disable=super-init-not-called + self.start = kwargs.get('start') + self.expiry = kwargs.get('expiry') + self.permission = kwargs.get('permission') class TableAnalyticsLogging(GeneratedLogging): From b1e5830eb502bfb654cbb339693404bad487ecba Mon Sep 17 00:00:00 2001 From: antisch Date: Mon, 7 Jun 2021 19:20:19 -0700 Subject: [PATCH 3/6] Fixed deserialization --- sdk/tables/azure-data-tables/CHANGELOG.md | 1 + .../azure/data/tables/_deserialize.py | 5 +++++ .../azure/data/tables/_table_client.py | 14 ++++++++++++-- .../data/tables/aio/_table_client_async.py | 17 ++++++++++++----- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index d73b4a2a2c30..39bb505d0e87 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -10,6 +10,7 @@ * All parameters for `TableServiceClient.set_service_properties` are now keyword-only. * The `credential` parameter for all Clients is now keyword-only. * The method `TableClient.get_access_policy` will now return `None` where previously it returned an "empty" access policy object. +* Timestamp properties on `TableAccessPolicy` instances returned from `TableClient.get_access_policy` will now be deserialized to `datetime` instances. **Fixes** * Fixed support for Cosmos emulator endpoint, via URL/credential or connection string. diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py b/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py index 103443e23f8e..e81c5ada9a85 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py @@ -91,6 +91,11 @@ def clean_up_dotnet_timestamps(value): return value[0] +def deserialize_iso(value): + if not value: + return value + return _from_entity_datetime(value) + def _from_entity_guid(value): return UUID(value) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 5aebe26cd279..35998c632d18 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -33,7 +33,7 @@ from ._serialize import _get_match_headers, _add_entity_properties from ._base_client import parse_connection_str, TablesBaseClient from ._serialize import serialize_iso, _parameter_filter_substitution -from ._deserialize import _return_headers_and_deserialized +from ._deserialize import deserialize_iso, _return_headers_and_deserialized from ._table_batch import TableBatchOperations from ._models import ( TableEntityPropertiesPaged, @@ -187,7 +187,17 @@ def get_table_access_policy( ) except HttpResponseError as error: _process_table_error(error) - return {s.id: s.access_policy or None for s in identifiers} # type: ignore + output = {} + for identifier in identifiers: + if identifier.access_policy: + output[identifier.id] = TableAccessPolicy( + start=deserialize_iso(identifier.access_policy.start), + expiry=deserialize_iso(identifier.access_policy.expiry), + permission=identifier.access_policy.permission + ) + else: + output[identifier.id] = None + return output @distributed_trace def set_table_access_policy( diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index cdf1614f8ba5..6a9904b1e48a 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -23,7 +23,7 @@ from .._generated.models import SignedIdentifier, TableProperties, QueryOptions from .._models import TableAccessPolicy, TableItem from .._serialize import serialize_iso, _parameter_filter_substitution -from .._deserialize import _return_headers_and_deserialized +from .._deserialize import deserialize_iso, _return_headers_and_deserialized from .._error import ( _process_table_error, _validate_table_name, @@ -177,10 +177,17 @@ async def get_table_access_policy(self, **kwargs) -> Mapping[str, Optional[Table ) except HttpResponseError as error: _process_table_error(error) - return { - s.id: s.access_policy or None - for s in identifiers # type: ignore - } + output = {} + for identifier in identifiers: + if identifier.access_policy: + output[identifier.id] = TableAccessPolicy( + start=deserialize_iso(identifier.access_policy.start), + expiry=deserialize_iso(identifier.access_policy.expiry), + permission=identifier.access_policy.permission + ) + else: + output[identifier.id] = None + return output @distributed_trace_async async def set_table_access_policy( From 1b75d52e1fd942b7bc3f4b58133db87cdda0e7eb Mon Sep 17 00:00:00 2001 From: antisch Date: Mon, 7 Jun 2021 19:29:21 -0700 Subject: [PATCH 4/6] Updated tests --- .../tests/_shared/testcase.py | 9 ++ ...table.test_set_table_acl_too_many_ids.yaml | 28 ++--- ...able_acl_with_empty_signed_identifier.yaml | 115 +++++++++++++++--- ...ble_acl_with_empty_signed_identifiers.yaml | 36 +++--- ...set_table_acl_with_signed_identifiers.yaml | 36 +++--- ...async.test_set_table_acl_too_many_ids.yaml | 28 ++--- ...able_acl_with_empty_signed_identifier.yaml | 100 ++++++++++++--- ...ble_acl_with_empty_signed_identifiers.yaml | 36 +++--- ...set_table_acl_with_signed_identifiers.yaml | 36 +++--- .../azure-data-tables/tests/test_table.py | 54 ++++++-- .../tests/test_table_async.py | 54 ++++++-- 11 files changed, 368 insertions(+), 164 deletions(-) diff --git a/sdk/tables/azure-data-tables/tests/_shared/testcase.py b/sdk/tables/azure-data-tables/tests/_shared/testcase.py index ffebec0366ca..e8315f52cb1e 100644 --- a/sdk/tables/azure-data-tables/tests/_shared/testcase.py +++ b/sdk/tables/azure-data-tables/tests/_shared/testcase.py @@ -296,6 +296,15 @@ def _assert_properties_default(self, prop): self._assert_metrics_equal(prop["minute_metrics"], TableMetrics()) self._assert_cors_equal(prop["cors"], list()) + def _assert_policy_datetime(self, val1, val2): + assert isinstance(val2, datetime) + assert val1.year == val2.year + assert val1.month == val2.month + assert val1.day == val2.day + assert val1.hour == val2.hour + assert val1.minute == val2.minute + assert val1.second == val2.second + def _assert_logging_equal(self, log1, log2): if log1 is None or log2 is None: assert log1 == log2 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_too_many_ids.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_too_many_ids.yaml index ac2c18bc5bc4..b7d1e5e20d8e 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_too_many_ids.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_too_many_ids.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 14 Apr 2021 18:10:59 GMT + - Tue, 08 Jun 2021 02:27:57 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b7 Python/3.7.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 14 Apr 2021 18:10:59 GMT + - Tue, 08 Jun 2021 02:27:57 GMT x-ms-version: - '2019-02-02' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 14 Apr 2021 18:10:59 GMT + - Tue, 08 Jun 2021 02:27:57 GMT location: - https://fake_table_account.table.core.windows.net/Tables('pytablesync6f17111b') server: @@ -63,11 +63,11 @@ interactions: Content-Type: - application/xml Date: - - Wed, 14 Apr 2021 18:11:00 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b7 Python/3.7.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 14 Apr 2021 18:11:00 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: PUT @@ -77,16 +77,16 @@ interactions: string: 'InvalidXmlDocumentXML specified is not syntactically valid. - RequestId:e4afd8b3-1002-0010-1959-311f4c000000 + RequestId:e4d09754-d002-00a6-300d-5c6d3a000000 - Time:2021-04-14T18:11:00.9932670Z' + Time:2021-06-08T02:27:58.1749862Z' headers: content-length: - '327' content-type: - application/xml date: - - Wed, 14 Apr 2021 18:11:00 GMT + - Tue, 08 Jun 2021 02:27:58 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-ms-error-code: @@ -108,11 +108,11 @@ interactions: Content-Length: - '0' Date: - - Wed, 14 Apr 2021 18:11:01 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b7 Python/3.7.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 14 Apr 2021 18:11:01 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -126,7 +126,7 @@ interactions: content-length: - '0' date: - - Wed, 14 Apr 2021 18:11:00 GMT + - Tue, 08 Jun 2021 02:27:58 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifier.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifier.yaml index 792c153c0ec3..dead1550bcb9 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifier.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifier.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:29:43 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:43 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Fri, 18 Dec 2020 17:29:43 GMT + - Tue, 08 Jun 2021 02:27:57 GMT location: - https://fake_table_account.table.core.windows.net/Tables('pytablesyncb9bd17bb') server: @@ -50,7 +50,8 @@ interactions: - request: body: ' - empty' + nullemptypartialrfull2021-06-08T02:10:09Z2021-06-08T02:10:09Zr' headers: Accept: - application/xml @@ -59,15 +60,15 @@ interactions: Connection: - keep-alive Content-Length: - - '129' + - '480' Content-Type: - application/xml Date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: PUT @@ -79,7 +80,7 @@ interactions: content-length: - '0' date: - - Fri, 18 Dec 2020 17:29:43 GMT + - Tue, 08 Jun 2021 02:27:57 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: @@ -97,23 +98,99 @@ interactions: Connection: - keep-alive Date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: GET uri: https://fake_table_account.table.core.windows.net/pytablesyncb9bd17bb?comp=acl response: body: - string: "\uFEFFempty" + string: "\uFEFFnullemptypartialrfull2021-06-08T02:10:09.0000000Z2021-06-08T02:10:09.0000000Zr" headers: content-type: - application/xml date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:57 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +- request: + body: ' + + nullpartialfull2021-06-08T02:10:09Z2021-06-08T02:10:09Zr' + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '358' + Content-Type: + - application/xml + Date: + - Tue, 08 Jun 2021 02:27:58 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 08 Jun 2021 02:27:58 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://fake_table_account.table.core.windows.net/pytablesyncb9bd17bb?comp=acl + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 08 Jun 2021 02:27:57 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2019-02-02' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 08 Jun 2021 02:27:58 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 08 Jun 2021 02:27:58 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/pytablesyncb9bd17bb?comp=acl + response: + body: + string: "\uFEFFnullpartialfull2021-06-08T02:10:09.0000000Z2021-06-08T02:10:09.0000000Zr" + headers: + content-type: + - application/xml + date: + - Tue, 08 Jun 2021 02:27:57 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -135,11 +212,11 @@ interactions: Content-Length: - '0' Date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -153,7 +230,7 @@ interactions: content-length: - '0' date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:57 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifiers.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifiers.yaml index 035b1baebd0d..41b20a0b390b 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifiers.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_empty_signed_identifiers.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Fri, 18 Dec 2020 17:29:44 GMT + - Tue, 08 Jun 2021 02:27:58 GMT location: - https://fake_table_account.table.core.windows.net/Tables('pytablesyncd1eb182e') server: @@ -61,11 +61,11 @@ interactions: Content-Type: - application/xml Date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: PUT @@ -77,7 +77,7 @@ interactions: content-length: - '0' date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: @@ -95,24 +95,24 @@ interactions: Connection: - keep-alive Date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: GET uri: https://fake_table_account.table.core.windows.net/pytablesyncd1eb182e?comp=acl response: body: - string: "\uFEFF" + string: "\uFEFF" headers: content-type: - application/xml date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -134,11 +134,11 @@ interactions: Content-Length: - '0' Date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -152,7 +152,7 @@ interactions: content-length: - '0' date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_signed_identifiers.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_signed_identifiers.yaml index 78ae67559379..3a8c65bbe053 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_signed_identifiers.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table.test_set_table_acl_with_signed_identifiers.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:45 GMT + - Tue, 08 Jun 2021 02:27:58 GMT x-ms-version: - '2019-02-02' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Fri, 18 Dec 2020 17:29:46 GMT + - Tue, 08 Jun 2021 02:27:58 GMT location: - https://fake_table_account.table.core.windows.net/Tables('pytablesync45dd15a0') server: @@ -50,7 +50,7 @@ interactions: - request: body: ' - testid2020-12-18T17:24:46Z2020-12-18T18:29:46Zr' + testid2021-06-08T02:05:09Z2021-06-08T03:10:09Zr' headers: Accept: - application/xml @@ -63,11 +63,11 @@ interactions: Content-Type: - application/xml Date: - - Fri, 18 Dec 2020 17:29:46 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:46 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: PUT @@ -79,7 +79,7 @@ interactions: content-length: - '0' date: - - Fri, 18 Dec 2020 17:29:46 GMT + - Tue, 08 Jun 2021 02:27:58 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: @@ -97,23 +97,23 @@ interactions: Connection: - keep-alive Date: - - Fri, 18 Dec 2020 17:29:46 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:46 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: GET uri: https://fake_table_account.table.core.windows.net/pytablesync45dd15a0?comp=acl response: body: - string: "\uFEFFtestid2020-12-18T17:24:46.0000000Z2020-12-18T18:29:46.0000000Zr" + string: "\uFEFFtestid2021-06-08T02:05:09.0000000Z2021-06-08T03:10:09.0000000Zr" headers: content-type: - application/xml date: - - Fri, 18 Dec 2020 17:29:46 GMT + - Tue, 08 Jun 2021 02:27:58 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -135,11 +135,11 @@ interactions: Content-Length: - '0' Date: - - Fri, 18 Dec 2020 17:29:46 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:46 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -153,7 +153,7 @@ interactions: content-length: - '0' date: - - Fri, 18 Dec 2020 17:29:46 GMT + - Tue, 08 Jun 2021 02:27:58 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_too_many_ids.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_too_many_ids.yaml index a9c6722a7034..03fc2d299491 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_too_many_ids.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_too_many_ids.yaml @@ -11,11 +11,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 14 Apr 2021 18:11:01 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b7 Python/3.7.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 14 Apr 2021 18:11:01 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: POST @@ -26,7 +26,7 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 14 Apr 2021 18:11:01 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT location: https://fake_table_account.table.core.windows.net/Tables('pytableasynce03c1398') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -48,11 +48,11 @@ interactions: Content-Type: - application/xml Date: - - Wed, 14 Apr 2021 18:11:01 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b7 Python/3.7.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 14 Apr 2021 18:11:01 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: PUT @@ -62,13 +62,13 @@ interactions: string: 'InvalidXmlDocumentXML specified is not syntactically valid. - RequestId:a8b32b21-b002-008f-3959-31534e000000 + RequestId:c71a2395-8002-0084-1b0d-5ca825000000 - Time:2021-04-14T18:11:01.5586123Z' + Time:2021-06-08T02:27:59.4368658Z' headers: content-length: '327' content-type: application/xml - date: Wed, 14 Apr 2021 18:11:01 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-ms-error-code: InvalidXmlDocument x-ms-version: '2019-02-02' @@ -82,11 +82,11 @@ interactions: Accept: - application/json Date: - - Wed, 14 Apr 2021 18:11:01 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b7 Python/3.7.4 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 14 Apr 2021 18:11:01 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -97,7 +97,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Wed, 14 Apr 2021 18:11:01 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: nosniff x-ms-version: '2019-02-02' diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifier.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifier.yaml index cb3c8b625696..7307b6ad016d 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifier.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifier.yaml @@ -11,11 +11,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:29:58 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:58 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: POST @@ -26,7 +26,7 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Fri, 18 Dec 2020 17:29:58 GMT + date: Tue, 08 Jun 2021 02:27:58 GMT location: https://fake_table_account.table.core.windows.net/Tables('pytableasync52c11a38') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -39,20 +39,21 @@ interactions: - request: body: ' - empty' + nullemptypartialrfull2021-06-08T02:10:09Z2021-06-08T02:10:09Zr' headers: Accept: - application/xml Content-Length: - - '129' + - '480' Content-Type: - application/xml Date: - - Fri, 18 Dec 2020 17:29:58 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:58 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: PUT @@ -62,7 +63,7 @@ interactions: string: '' headers: content-length: '0' - date: Fri, 18 Dec 2020 17:29:58 GMT + date: Tue, 08 Jun 2021 02:27:58 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: '2019-02-02' status: @@ -75,21 +76,82 @@ interactions: Accept: - application/xml Date: - - Fri, 18 Dec 2020 17:29:58 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:58 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: GET uri: https://fake_table_account.table.core.windows.net/pytableasync52c11a38?comp=acl response: body: - string: "\uFEFFempty" + string: "\uFEFFnullemptypartialrfull2021-06-08T02:10:09.0000000Z2021-06-08T02:10:09.0000000Zr" headers: content-type: application/xml - date: Fri, 18 Dec 2020 17:29:58 GMT + date: Tue, 08 Jun 2021 02:27:58 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: https://seankaneprim.table.core.windows.net/pytableasync52c11a38?comp=acl +- request: + body: ' + + nullpartialfull2021-06-08T02:10:09Z2021-06-08T02:10:09Zr' + headers: + Accept: + - application/xml + Content-Length: + - '358' + Content-Type: + - application/xml + Date: + - Tue, 08 Jun 2021 02:27:59 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 08 Jun 2021 02:27:59 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://fake_table_account.table.core.windows.net/pytableasync52c11a38?comp=acl + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 08 Jun 2021 02:27:58 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/pytableasync52c11a38?comp=acl +- request: + body: null + headers: + Accept: + - application/xml + Date: + - Tue, 08 Jun 2021 02:27:59 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 08 Jun 2021 02:27:59 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/pytableasync52c11a38?comp=acl + response: + body: + string: "\uFEFFnullpartialfull2021-06-08T02:10:09.0000000Z2021-06-08T02:10:09.0000000Zr" + headers: + content-type: application/xml + date: Tue, 08 Jun 2021 02:27:59 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-ms-version: '2019-02-02' @@ -103,11 +165,11 @@ interactions: Accept: - application/json Date: - - Fri, 18 Dec 2020 17:29:59 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:59 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -118,7 +180,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Fri, 18 Dec 2020 17:29:58 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: nosniff x-ms-version: '2019-02-02' diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifiers.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifiers.yaml index 1a0ae6b2518e..c351f7fb5d96 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifiers.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_empty_signed_identifiers.yaml @@ -11,11 +11,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:29:59 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:59 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: POST @@ -26,7 +26,7 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Fri, 18 Dec 2020 17:29:59 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT location: https://fake_table_account.table.core.windows.net/Tables('pytableasync6d6c1aab') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -44,11 +44,11 @@ interactions: Content-Type: - application/xml Date: - - Fri, 18 Dec 2020 17:29:59 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:59 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: PUT @@ -58,7 +58,7 @@ interactions: string: '' headers: content-length: '0' - date: Fri, 18 Dec 2020 17:29:59 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: '2019-02-02' status: @@ -71,22 +71,22 @@ interactions: Accept: - application/xml Date: - - Fri, 18 Dec 2020 17:29:59 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:59 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: GET uri: https://fake_table_account.table.core.windows.net/pytableasync6d6c1aab?comp=acl response: body: - string: "\uFEFF" + string: "\uFEFF" headers: content-type: application/xml - date: Fri, 18 Dec 2020 17:29:59 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-ms-version: '2019-02-02' @@ -100,11 +100,11 @@ interactions: Accept: - application/json Date: - - Fri, 18 Dec 2020 17:29:59 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:29:59 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -115,7 +115,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Fri, 18 Dec 2020 17:30:00 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: nosniff x-ms-version: '2019-02-02' diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_signed_identifiers.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_signed_identifiers.yaml index a9b2c693c8b2..f86bf70275de 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_signed_identifiers.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_async.test_set_table_acl_with_signed_identifiers.yaml @@ -11,11 +11,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:30:00 GMT + - Tue, 08 Jun 2021 02:27:59 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:30:00 GMT + - Tue, 08 Jun 2021 02:27:59 GMT x-ms-version: - '2019-02-02' method: POST @@ -26,7 +26,7 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Fri, 18 Dec 2020 17:30:00 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT location: https://fake_table_account.table.core.windows.net/Tables('pytableasyncd261181d') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -39,7 +39,7 @@ interactions: - request: body: ' - testid2020-12-18T17:25:00Z2020-12-18T18:30:00Zr' + testid2021-06-08T02:05:09Z2021-06-08T03:10:09Zr' headers: Accept: - application/xml @@ -48,11 +48,11 @@ interactions: Content-Type: - application/xml Date: - - Fri, 18 Dec 2020 17:30:00 GMT + - Tue, 08 Jun 2021 02:28:00 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:30:00 GMT + - Tue, 08 Jun 2021 02:28:00 GMT x-ms-version: - '2019-02-02' method: PUT @@ -62,7 +62,7 @@ interactions: string: '' headers: content-length: '0' - date: Fri, 18 Dec 2020 17:30:00 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: '2019-02-02' status: @@ -75,21 +75,21 @@ interactions: Accept: - application/xml Date: - - Fri, 18 Dec 2020 17:30:00 GMT + - Tue, 08 Jun 2021 02:28:00 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:30:00 GMT + - Tue, 08 Jun 2021 02:28:00 GMT x-ms-version: - '2019-02-02' method: GET uri: https://fake_table_account.table.core.windows.net/pytableasyncd261181d?comp=acl response: body: - string: "\uFEFFtestid2020-12-18T17:25:00.0000000Z2020-12-18T18:30:00.0000000Zr" + string: "\uFEFFtestid2021-06-08T02:05:09.0000000Z2021-06-08T03:10:09.0000000Zr" headers: content-type: application/xml - date: Fri, 18 Dec 2020 17:30:00 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-ms-version: '2019-02-02' @@ -103,11 +103,11 @@ interactions: Accept: - application/json Date: - - Fri, 18 Dec 2020 17:30:00 GMT + - Tue, 08 Jun 2021 02:28:00 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:30:00 GMT + - Tue, 08 Jun 2021 02:28:00 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -118,7 +118,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Fri, 18 Dec 2020 17:30:01 GMT + date: Tue, 08 Jun 2021 02:27:59 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: nosniff x-ms-version: '2019-02-02' diff --git a/sdk/tables/azure-data-tables/tests/test_table.py b/sdk/tables/azure-data-tables/tests/test_table.py index d53aa3098b30..50dc26dd0722 100644 --- a/sdk/tables/azure-data-tables/tests/test_table.py +++ b/sdk/tables/azure-data-tables/tests/test_table.py @@ -311,16 +311,42 @@ def test_set_table_acl_with_empty_signed_identifier(self, tables_storage_account table = self._create_table(ts) try: - # Act - table.set_table_access_policy(signed_identifiers={'empty': None}) - # Assert + dt = datetime(2021, 6, 8, 2, 10, 9) + signed_identifiers={ + 'null': None, + 'empty': TableAccessPolicy(start=None, expiry=None, permission=None), + 'partial': TableAccessPolicy(permission='r'), + 'full': TableAccessPolicy(start=dt, expiry=dt, permission='r') + } + table.set_table_access_policy(signed_identifiers) acl = table.get_table_access_policy() assert acl is not None - assert len(acl) == 1 - assert acl['empty'] is not None - assert acl['empty'].permission is None - assert acl['empty'].expiry is None - assert acl['empty'].start is None + assert len(acl) == 4 + assert acl['null'] is None + assert acl['empty'] is None + assert acl['partial'] is not None + assert acl['partial'].permission is 'r' + assert acl['partial'].expiry is None + assert acl['partial'].start is None + assert acl['full'] is not None + assert acl['full'].permission is 'r' + self._assert_policy_datetime(dt, acl['full'].expiry) + self._assert_policy_datetime(dt, acl['full'].start) + + signed_identifiers.pop('empty') + signed_identifiers['partial'] = None + + table.set_table_access_policy(signed_identifiers) + acl = table.get_table_access_policy() + assert acl is not None + assert len(acl) == 3 + assert 'empty' not in acl + assert acl['null'] is None + assert acl['partial'] is None + assert acl['full'] is not None + assert acl['full'].permission is 'r' + self._assert_policy_datetime(dt, acl['full'].expiry) + self._assert_policy_datetime(dt, acl['full'].start) finally: ts.delete_table(table.table_name) @@ -335,17 +361,19 @@ def test_set_table_acl_with_signed_identifiers(self, tables_storage_account_name client = ts.get_table_client(table_name=table.table_name) # Act - identifiers = dict() - identifiers['testid'] = TableAccessPolicy(start=datetime.utcnow() - timedelta(minutes=5), - expiry=datetime.utcnow() + timedelta(hours=1), - permission='r') + start = datetime(2021, 6, 8, 2, 10, 9) - timedelta(minutes=5) + expiry = datetime(2021, 6, 8, 2, 10, 9) + timedelta(hours=1) + identifiers = {'testid': TableAccessPolicy(start=start, expiry=expiry, permission='r')} try: client.set_table_access_policy(signed_identifiers=identifiers) # Assert acl = client.get_table_access_policy() assert acl is not None assert len(acl) == 1 - assert 'testid' in acl + assert acl.get('testid') + self._assert_policy_datetime(start, acl['testid'].start) + self._assert_policy_datetime(expiry, acl['testid'].expiry) + assert acl['testid'].permission == 'r' finally: ts.delete_table(table.table_name) diff --git a/sdk/tables/azure-data-tables/tests/test_table_async.py b/sdk/tables/azure-data-tables/tests/test_table_async.py index e5b7ce4e344c..3c2a28e607da 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_async.py @@ -255,16 +255,42 @@ async def test_set_table_acl_with_empty_signed_identifier(self, tables_storage_a ts = TableServiceClient(url, credential=tables_primary_storage_account_key) table = await self._create_table(ts) try: - # Act - await table.set_table_access_policy(signed_identifiers={'empty': None}) - # Assert + dt = datetime(2021, 6, 8, 2, 10, 9) + signed_identifiers={ + 'null': None, + 'empty': TableAccessPolicy(start=None, expiry=None, permission=None), + 'partial': TableAccessPolicy(permission='r'), + 'full': TableAccessPolicy(start=dt, expiry=dt, permission='r') + } + await table.set_table_access_policy(signed_identifiers) acl = await table.get_table_access_policy() assert acl is not None - assert len(acl) == 1 - assert acl['empty'] is not None - assert acl['empty'].permission is None - assert acl['empty'].expiry is None - assert acl['empty'].start is None + assert len(acl) == 4 + assert acl['null'] is None + assert acl['empty'] is None + assert acl['partial'] is not None + assert acl['partial'].permission is 'r' + assert acl['partial'].expiry is None + assert acl['partial'].start is None + assert acl['full'] is not None + assert acl['full'].permission is 'r' + self._assert_policy_datetime(dt, acl['full'].expiry) + self._assert_policy_datetime(dt, acl['full'].start) + + signed_identifiers.pop('empty') + signed_identifiers['partial'] = None + + await table.set_table_access_policy(signed_identifiers) + acl = await table.get_table_access_policy() + assert acl is not None + assert len(acl) == 3 + assert 'empty' not in acl + assert acl['null'] is None + assert acl['partial'] is None + assert acl['full'] is not None + assert acl['full'].permission is 'r' + self._assert_policy_datetime(dt, acl['full'].expiry) + self._assert_policy_datetime(dt, acl['full'].start) finally: await ts.delete_table(table.table_name) @@ -277,10 +303,9 @@ async def test_set_table_acl_with_signed_identifiers(self, tables_storage_accoun client = ts.get_table_client(table_name=table.table_name) # Act - identifiers = dict() - identifiers['testid'] = TableAccessPolicy(start=datetime.utcnow() - timedelta(minutes=5), - expiry=datetime.utcnow() + timedelta(hours=1), - permission=TableSasPermissions(read=True)) + start = datetime(2021, 6, 8, 2, 10, 9) - timedelta(minutes=5) + expiry = datetime(2021, 6, 8, 2, 10, 9) + timedelta(hours=1) + identifiers = {'testid': TableAccessPolicy(start=start, expiry=expiry, permission=TableSasPermissions(read=True))} try: await client.set_table_access_policy(signed_identifiers=identifiers) @@ -288,7 +313,10 @@ async def test_set_table_acl_with_signed_identifiers(self, tables_storage_accoun acl = await client.get_table_access_policy() assert acl is not None assert len(acl) == 1 - assert 'testid' in acl + assert acl.get('testid') + self._assert_policy_datetime(start, acl['testid'].start) + self._assert_policy_datetime(expiry, acl['testid'].expiry) + assert acl['testid'].permission == 'r' finally: await ts.delete_table(table.table_name) From a837486b5b96b949bf964e53e03a884c2773ece4 Mon Sep 17 00:00:00 2001 From: antisch Date: Tue, 8 Jun 2021 06:24:05 -0700 Subject: [PATCH 5/6] Fix test --- sdk/tables/azure-data-tables/tests/test_table.py | 6 +++--- sdk/tables/azure-data-tables/tests/test_table_async.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/tables/azure-data-tables/tests/test_table.py b/sdk/tables/azure-data-tables/tests/test_table.py index 50dc26dd0722..5bdca6ae32d6 100644 --- a/sdk/tables/azure-data-tables/tests/test_table.py +++ b/sdk/tables/azure-data-tables/tests/test_table.py @@ -325,11 +325,11 @@ def test_set_table_acl_with_empty_signed_identifier(self, tables_storage_account assert acl['null'] is None assert acl['empty'] is None assert acl['partial'] is not None - assert acl['partial'].permission is 'r' + assert acl['partial'].permission == 'r' assert acl['partial'].expiry is None assert acl['partial'].start is None assert acl['full'] is not None - assert acl['full'].permission is 'r' + assert acl['full'].permission == 'r' self._assert_policy_datetime(dt, acl['full'].expiry) self._assert_policy_datetime(dt, acl['full'].start) @@ -344,7 +344,7 @@ def test_set_table_acl_with_empty_signed_identifier(self, tables_storage_account assert acl['null'] is None assert acl['partial'] is None assert acl['full'] is not None - assert acl['full'].permission is 'r' + assert acl['full'].permission == 'r' self._assert_policy_datetime(dt, acl['full'].expiry) self._assert_policy_datetime(dt, acl['full'].start) finally: diff --git a/sdk/tables/azure-data-tables/tests/test_table_async.py b/sdk/tables/azure-data-tables/tests/test_table_async.py index 3c2a28e607da..f8f53c4b600f 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_async.py @@ -269,11 +269,11 @@ async def test_set_table_acl_with_empty_signed_identifier(self, tables_storage_a assert acl['null'] is None assert acl['empty'] is None assert acl['partial'] is not None - assert acl['partial'].permission is 'r' + assert acl['partial'].permission == 'r' assert acl['partial'].expiry is None assert acl['partial'].start is None assert acl['full'] is not None - assert acl['full'].permission is 'r' + assert acl['full'].permission == 'r' self._assert_policy_datetime(dt, acl['full'].expiry) self._assert_policy_datetime(dt, acl['full'].start) @@ -288,7 +288,7 @@ async def test_set_table_acl_with_empty_signed_identifier(self, tables_storage_a assert acl['null'] is None assert acl['partial'] is None assert acl['full'] is not None - assert acl['full'].permission is 'r' + assert acl['full'].permission == 'r' self._assert_policy_datetime(dt, acl['full'].expiry) self._assert_policy_datetime(dt, acl['full'].start) finally: From f3b3eb1ad04006103a5a41931f4c723db9e8b943 Mon Sep 17 00:00:00 2001 From: antisch Date: Tue, 8 Jun 2021 07:44:37 -0700 Subject: [PATCH 6/6] Fixed mypy --- .../azure-data-tables/azure/data/tables/_table_client.py | 6 +++--- .../azure/data/tables/aio/_table_client_async.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 35998c632d18..d8d4c8b1adb1 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -5,7 +5,7 @@ # -------------------------------------------------------------------------- import functools -from typing import Optional, Any, TYPE_CHECKING, Union, List, Tuple, Dict, Mapping, Iterable, overload +from typing import Optional, Any, TYPE_CHECKING, Union, List, Tuple, Dict, Mapping, Iterable, overload, cast try: from urllib.parse import urlparse, unquote except ImportError: @@ -187,8 +187,8 @@ def get_table_access_policy( ) except HttpResponseError as error: _process_table_error(error) - output = {} - for identifier in identifiers: + output = {} # type: Dict[str, Optional[TableAccessPolicy]] + for identifier in cast(List[SignedIdentifier], identifiers): if identifier.access_policy: output[identifier.id] = TableAccessPolicy( start=deserialize_iso(identifier.access_policy.start), diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 6a9904b1e48a..ed4f669e9717 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -4,7 +4,7 @@ # license information. # -------------------------------------------------------------------------- import functools -from typing import List, Union, Any, Optional, Mapping, Iterable, Dict, overload +from typing import List, Union, Any, Optional, Mapping, Iterable, Dict, overload, cast try: from urllib.parse import urlparse, unquote except ImportError: @@ -177,8 +177,8 @@ async def get_table_access_policy(self, **kwargs) -> Mapping[str, Optional[Table ) except HttpResponseError as error: _process_table_error(error) - output = {} - for identifier in identifiers: + output = {} # type: Dict[str, Optional[TableAccessPolicy]] + for identifier in cast(List[SignedIdentifier], identifiers): if identifier.access_policy: output[identifier.id] = TableAccessPolicy( start=deserialize_iso(identifier.access_policy.start),