diff --git a/sdk/communication/azure-communication-identity/tests/_shared/communication_service_preparer.py b/sdk/communication/azure-communication-identity/tests/_shared/communication_service_preparer.py index e3907ff011e0..5fedd006201d 100644 --- a/sdk/communication/azure-communication-identity/tests/_shared/communication_service_preparer.py +++ b/sdk/communication/azure-communication-identity/tests/_shared/communication_service_preparer.py @@ -3,87 +3,10 @@ # Licensed under the MIT License. # ------------------------------------ -import datetime +import functools +from devtools_testutils import PowerShellPreparer -from azure.mgmt.communication import CommunicationServiceManagementClient -from azure.mgmt.communication.models import CommunicationServiceResource -from devtools_testutils import( - AzureMgmtPreparer, - ResourceGroupPreparer, - FakeResource +CommunicationPreparer = functools.partial( + PowerShellPreparer, "communication", + communication_connection_string="endpoint=https://sanitized.communication.azure.com/;accesskey=fake===" ) -from devtools_testutils.resource_testcase import RESOURCE_GROUP_PARAM -from azure_devtools.scenario_tests.exceptions import AzureTestError - -class CommunicationServicePreparer(AzureMgmtPreparer): - """Communication Service Preparer. - Creating and destroying test resources on demand - """ - def __init__( - self, - name_prefix="communication", - resource_group_parameter_name=RESOURCE_GROUP_PARAM, - disable_recording=True, - use_cache=False, - playback_fake_resource=None, - client_kwargs=None, - ): - super(CommunicationServicePreparer, self).__init__( - name_prefix, - random_name_length=24, - disable_recording=disable_recording, - playback_fake_resource=playback_fake_resource, - client_kwargs=client_kwargs, - ) - self.resource_group_parameter_name = resource_group_parameter_name - self.random_name_enabled = True - self.service_name = "TEST-SERVICE-NAME" - self.mgmt_client = None - self.set_cache(use_cache) - self.scrubbed_resource_name = "communicationegrcrs" - - def _get_resource_group(self, **kwargs): - try: - return kwargs[self.resource_group_parameter_name] - except KeyError: - template = ( - "To create a communication service a resource group is required. Please add " - "decorator @{} in front of this preparer." - ) - raise AzureTestError(template.format(ResourceGroupPreparer.__name__)) - - def create_resource(self, name, **kwargs): - if not self.is_live: - self.resource = FakeResource(name=self.scrubbed_resource_name, id=name) - - return { - "connection_string": "endpoint=https://{}.communication.azure.com/;accesskey=fake===".format(self.resource.name), - } - - self.test_class_instance.scrubber.register_name_pair(name, self.scrubbed_resource_name) - group_name = self._get_resource_group(**kwargs).name - - self.client = self.create_mgmt_client(CommunicationServiceManagementClient, polling_interval=30) - - self.resource = self.client.communication_service.begin_create_or_update( - group_name, - name, - CommunicationServiceResource(location="global", data_location="UnitedStates") - ).result() - - self.service_name = self.resource.name - - primary_connection_string = self.client.communication_service.list_keys( - group_name, - self.resource.name).primary_connection_string - - return { - "connection_string": primary_connection_string, - } - - def remove_resource(self, name, **kwargs): - if not self.is_live: - return - - group_name = self._get_resource_group(**kwargs).name - self.client.communication_service.begin_delete(group_name, self.service_name).wait() diff --git a/sdk/communication/azure-communication-identity/tests/_shared/helper.py b/sdk/communication/azure-communication-identity/tests/_shared/helper.py index 7338f10940a0..b89a9c548f18 100644 --- a/sdk/communication/azure-communication-identity/tests/_shared/helper.py +++ b/sdk/communication/azure-communication-identity/tests/_shared/helper.py @@ -3,17 +3,22 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- +import re from azure_devtools.scenario_tests import RecordingProcessor +try: + from urllib.parse import urlparse +except ImportError: + from urlparse import urlparse class URIIdentityReplacer(RecordingProcessor): """Replace the identity in request uri""" def process_request(self, request): - import re - request.uri = re.sub('/identities/([^/?]+)', '/identities/sanitized', request.uri) + resource = (urlparse(request.uri).netloc).split('.')[0] + request.uri = re.sub('/identities/([^/?]+)', '/identities/sanitized', request.uri) + request.uri = re.sub(resource, 'sanitized', request.uri) return request def process_response(self, response): - import re if 'url' in response: response['url'] = re.sub('/identities/([^/?]+)', '/identities/sanitized', response['url']) return response \ No newline at end of file diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user.yaml index a5bc813701dc..c7011335ecf7 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user.yaml @@ -13,31 +13,33 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:48:30 GMT + - Tue, 13 Apr 2021 17:54:24 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:48:29 GMT + - Tue, 13 Apr 2021 17:54:24 GMT ms-cv: - - 8tfK3/iTvEmwjYUYlPn7Qg.0 + - UEGC+xqwQkqRRfXm5Md24A.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 209ms + - 12ms status: code: 201 message: Created diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token.yaml index d0e3e6b7a986..24325cd40622 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_and_token.yaml @@ -13,32 +13,34 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:50:21 GMT + - Tue, 13 Apr 2021 17:54:24 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}, "accessToken": {"token": "sanitized", - "expiresOn": "2021-01-30T22:50:20.3668737+00:00"}}' + "expiresOn": "2021-04-14T17:54:25.0058231+00:00"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:50:20 GMT + - Tue, 13 Apr 2021 17:54:25 GMT ms-cv: - - 4wYYchxOnEay3S80a4tugw.0 + - I9ZS0qxvQEKYO/S5ErFh1w.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 38ms + - 215ms status: code: 201 message: Created diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_from_managed_identity.yaml index 2a6a22b80e6b..6ec1415a7621 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_create_user_from_managed_identity.yaml @@ -13,27 +13,29 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:21:01 GMT + - Tue, 13 Apr 2021 17:54:27 GMT ms-cv: - - T/Hx9aJuMka5ZSLjy1uvxA.0 + - Z2JdPGt9IEegXVCKKHjiJg.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 247ms + - 162ms status: code: 201 message: Created diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user.yaml index 4bce56996e55..4b1297bc1fd5 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user.yaml @@ -13,31 +13,33 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:23:15 GMT + - Tue, 13 Apr 2021 17:54:26 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:23:14 GMT + - Tue, 13 Apr 2021 17:54:27 GMT ms-cv: - - TgHUTqnyBk+TTGrk+qGYCg.0 + - NpGxr/VCv0i3/F8p8B/PEw.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 22ms + - 16ms status: code: 201 message: Created @@ -53,27 +55,29 @@ interactions: Content-Length: - '0' Date: - - Fri, 29 Jan 2021 22:23:15 GMT + - Tue, 13 Apr 2021 17:54:27 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2021-03-07 response: body: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 date: - - Fri, 29 Jan 2021 22:23:14 GMT + - Tue, 13 Apr 2021 17:54:27 GMT ms-cv: - - phAKzopa7kCat9napbUQGQ.0 + - zRztRbFrrEe9RLXIARPN7w.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 x-processing-time: - - 245ms + - 583ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user_from_managed_identity.yaml index ecf04ae480d1..d38866508f87 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_delete_user_from_managed_identity.yaml @@ -13,27 +13,29 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:24:21 GMT + - Tue, 13 Apr 2021 17:54:29 GMT ms-cv: - - 8Dz7rbKlnUyC0X9hMkHkGg.0 + - 3qpzL2TAgU2LX4OLE/ZWKQ.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 203ms + - 91ms status: code: 201 message: Created @@ -49,23 +51,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2021-03-07 response: body: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 date: - - Fri, 29 Jan 2021 22:24:21 GMT + - Tue, 13 Apr 2021 17:54:30 GMT ms-cv: - - 573z+Dhr+UOuJm8r75diNA.0 + - 04FDSY1mSkeU92Los0y+zA.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 x-processing-time: - - 479ms + - 591ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token.yaml index 78e4af9e7e07..cdc9bb4ef31d 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token.yaml @@ -13,31 +13,33 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:25:29 GMT + - Tue, 13 Apr 2021 17:54:29 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:25:28 GMT + - Tue, 13 Apr 2021 17:54:30 GMT ms-cv: - - izpRZUdB/kyDNywz7m1KQQ.0 + - ESJNBGhGTEWm2nfyGmja5g.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 20ms + - 12ms status: code: 201 message: Created @@ -55,31 +57,33 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:25:29 GMT + - Tue, 13 Apr 2021 17:54:29 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-01-30T22:25:27.9464673+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:29.7152371+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:25:28 GMT + - Tue, 13 Apr 2021 17:54:30 GMT ms-cv: - - p2Kp9U6Jek6X2zToYblIHA.0 + - 8x1vXQTCY0qKMkC4Z/KGFg.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 26ms + - 28ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_from_managed_identity.yaml index e08c29cde49b..bfab4dfe09a7 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_get_token_from_managed_identity.yaml @@ -13,27 +13,29 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:26:36 GMT + - Tue, 13 Apr 2021 17:54:32 GMT ms-cv: - - sIImdgIO6kSSfNEh18vBHQ.0 + - DkbbkXtjlkOEK0yQgPG8ZA.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 203ms + - 11ms status: code: 201 message: Created @@ -51,27 +53,29 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-01-30T22:26:35.9312051+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:32.0766183+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:26:36 GMT + - Tue, 13 Apr 2021 17:54:33 GMT ms-cv: - - JPBOQWSIBUWpPLVKMVZSTw.0 + - ZOyy1+vBp0eAegnujOspGA.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 30ms + - 135ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens.yaml index 1f520f645a24..f3be0a2823e3 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens.yaml @@ -13,31 +13,33 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:27:44 GMT + - Tue, 13 Apr 2021 17:54:32 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:27:43 GMT + - Tue, 13 Apr 2021 17:54:32 GMT ms-cv: - - xE21Gmx5h0mpZbTaV4qWcA.0 + - uR6j7ujUlkmDU4sMF9jubw.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 20ms + - 22ms status: code: 201 message: Created @@ -55,31 +57,33 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:27:44 GMT + - Tue, 13 Apr 2021 17:54:33 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-01-30T22:27:42.9428277+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:32.9248717+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:27:43 GMT + - Tue, 13 Apr 2021 17:54:33 GMT ms-cv: - - q5Uz363zF0aE4eQEN8C8Ng.0 + - dXFgv5bt8UugQoKws3faAw.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 26ms + - 148ms status: code: 200 message: OK @@ -95,27 +99,29 @@ interactions: Content-Length: - '0' Date: - - Fri, 29 Jan 2021 22:27:44 GMT + - Tue, 13 Apr 2021 17:54:33 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 response: body: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 date: - - Fri, 29 Jan 2021 22:27:43 GMT + - Tue, 13 Apr 2021 17:54:33 GMT ms-cv: - - IZVgWwmBk06K7QlAXuz7LQ.0 + - 4HgQs8RX2keltldeWAixBg.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 x-processing-time: - - 178ms + - 490ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens_from_managed_identity.yaml index 433cabb9de4f..b1fcbb1f1836 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client.test_revoke_tokens_from_managed_identity.yaml @@ -13,27 +13,29 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:28:50 GMT + - Tue, 13 Apr 2021 17:54:35 GMT ms-cv: - - VDeJxLCpwEiwT+0DkDgQ/w.0 + - WmL819euc02RGu6x3tAA5A.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 258ms + - 22ms status: code: 201 message: Created @@ -51,27 +53,29 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-01-30T22:28:50.160399+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:34.775295+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Fri, 29 Jan 2021 22:28:50 GMT + - Tue, 13 Apr 2021 17:54:35 GMT ms-cv: - - qGOKcdu3m0Cwmnn0J3k7Tw.0 + - wv2ATiyGHEqcp4VT0y26NA.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 32ms + - 26ms status: code: 200 message: OK @@ -87,23 +91,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 response: body: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-03-07 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 date: - - Fri, 29 Jan 2021 22:28:51 GMT + - Tue, 13 Apr 2021 17:54:35 GMT ms-cv: - - GGw7vBUa70CbJs5Df0aTSw.0 + - PAEN110k906wOeoSCXZaJA.0 + request-context: + - appId= strict-transport-security: - max-age=2592000 x-processing-time: - - 581ms + - 86ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user.yaml index fda7a5c22f39..a629e0a5dfc7 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user.yaml @@ -9,26 +9,27 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:29:58 GMT + - Tue, 13 Apr 2021 17:54:35 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:29:57 GMT - ms-cv: 1YYCfhRcFkym4hrqBRGZFQ.0 + date: Tue, 13 Apr 2021 17:54:35 GMT + ms-cv: DVwrKeAUsUeqOYv7Vs+ltw.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 19ms + x-processing-time: 12ms status: code: 201 message: Created - url: https://communicationasqoly6jb4x.communication.azure.com/identities?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token.yaml index a1f51269e36a..0b81b567ca1d 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_and_token.yaml @@ -9,27 +9,28 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:32:18 GMT + - Tue, 13 Apr 2021 17:54:35 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}, "accessToken": {"token": "sanitized", - "expiresOn": "2021-01-30T22:32:16.9405213+00:00"}}' + "expiresOn": "2021-04-14T17:54:35.9636866+00:00"}}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:32:17 GMT - ms-cv: W1T1PVQFlEWIXcgu0EeooA.0 + date: Tue, 13 Apr 2021 17:54:36 GMT + ms-cv: ntcPefeAfkSlklnTTjlpkw.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 35ms + x-processing-time: 421ms status: code: 201 message: Created - url: https://communication6l4km7ph3zj.communication.azure.com/identities?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_from_managed_identity.yaml index 1e2fd2003d1f..0f8b82b24228 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_create_user_from_managed_identity.yaml @@ -9,22 +9,23 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:31:04 GMT - ms-cv: z+LL7RQr+U+x/tyygix5Fg.0 + date: Tue, 13 Apr 2021 17:54:37 GMT + ms-cv: SVtnqEBxEUeDJruAkkfcsA.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 183ms + x-processing-time: 235ms status: code: 201 message: Created - url: https://communication3ijwjphimwr.communication.azure.com/identities?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user.yaml index 0b2eab2624c7..cf491cf71922 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user.yaml @@ -9,52 +9,54 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:33:25 GMT + - Tue, 13 Apr 2021 17:54:37 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:33:24 GMT - ms-cv: E+HUdaa+gE+cpD1TJJKNSg.0 + date: Tue, 13 Apr 2021 17:54:38 GMT + ms-cv: 1yFV4s+3E02VnBtVpTsgMw.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 19ms + x-processing-time: 11ms status: code: 201 message: Created - url: https://communicationzgvvggklwoa.communication.azure.com/identities?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 - request: body: '' headers: Accept: - application/json Date: - - Fri, 29 Jan 2021 22:33:25 GMT + - Tue, 13 Apr 2021 17:54:37 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2021-03-07 response: body: string: '' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 - date: Fri, 29 Jan 2021 22:33:25 GMT - ms-cv: q02XjOHx2EKny82QMeoybA.0 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 + date: Tue, 13 Apr 2021 17:54:38 GMT + ms-cv: yrGfSuBG/E+5SV1IVD3agg.0 + request-context: appId= strict-transport-security: max-age=2592000 - x-processing-time: 854ms + x-processing-time: 479ms status: code: 204 message: No Content - url: https://communicationzgvvggklwoa.communication.azure.com/identities/sanitized?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities/sanitized?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user_from_managed_identity.yaml index a5f8633cb199..3d093973827c 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_delete_user_from_managed_identity.yaml @@ -9,44 +9,46 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:34:32 GMT - ms-cv: M4o3j8QviU6dfW/2cZS4ug.0 + date: Tue, 13 Apr 2021 17:54:40 GMT + ms-cv: SH4vZizCxkSGvnv/LRR9SA.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 242ms + x-processing-time: 12ms status: code: 201 message: Created - url: https://communicationvfxjz4kgs5q.communication.azure.com/identities?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2021-03-07 response: body: string: '' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 - date: Fri, 29 Jan 2021 22:34:33 GMT - ms-cv: 4NslPsnjL0iQ1CODgbz7TA.0 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 + date: Tue, 13 Apr 2021 17:54:40 GMT + ms-cv: FyJH/NtpKEKiNRKEb8XvPQ.0 + request-context: appId= strict-transport-security: max-age=2592000 - x-processing-time: 676ms + x-processing-time: 577ms status: code: 204 message: No Content - url: https://communicationvfxjz4kgs5q.communication.azure.com/identities/sanitized?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities/sanitized?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token.yaml index 32210dc46be7..31995b988c54 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token.yaml @@ -9,28 +9,29 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:35:42 GMT + - Tue, 13 Apr 2021 17:54:40 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:35:41 GMT - ms-cv: d5Ncfb9TeEWiZ8EGWkToTw.0 + date: Tue, 13 Apr 2021 17:54:41 GMT + ms-cv: Pj8FRADg+kiDEt1nR45Xpw.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 205ms + x-processing-time: 14ms status: code: 201 message: Created - url: https://communicationdo2ohmwsm52.communication.azure.com/identities?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 - request: body: '{"scopes": ["chat"]}' headers: @@ -41,26 +42,27 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:35:42 GMT + - Tue, 13 Apr 2021 17:54:41 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-01-30T22:35:41.2292482+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:40.9399447+00:00"}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:35:42 GMT - ms-cv: DoX6Mm/9pkqFtpHOKzWiAg.0 + date: Tue, 13 Apr 2021 17:54:41 GMT + ms-cv: 20UrFS+nmUuM9hckNxqX9Q.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 215ms + x-processing-time: 128ms status: code: 200 message: OK - url: https://communicationdo2ohmwsm52.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_from_managed_identity.yaml index e70320714b8b..a5e513fe81fb 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_get_token_from_managed_identity.yaml @@ -9,24 +9,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:36:49 GMT - ms-cv: cUzRyy4LbUigYrZ7lbi4wA.0 + date: Tue, 13 Apr 2021 17:54:45 GMT + ms-cv: 7i9QSGm+qU+VzI7p4eQEig.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 238ms + x-processing-time: 12ms status: code: 201 message: Created - url: https://communication5brewzlj3te.communication.azure.com/identities?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 - request: body: '{"scopes": ["chat"]}' headers: @@ -37,22 +38,23 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-01-30T22:36:48.7283566+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:45.0423527+00:00"}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:36:49 GMT - ms-cv: bFRoAJk3ikGgv2ot2Vwh4A.0 + date: Tue, 13 Apr 2021 17:54:45 GMT + ms-cv: FgTOvdMakkCOCXl3WaKySQ.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 26ms + x-processing-time: 126ms status: code: 200 message: OK - url: https://communication5brewzlj3te.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens.yaml index 7b6b2c57a1fe..bd040c414f2f 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens.yaml @@ -9,28 +9,29 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:37:56 GMT + - Tue, 13 Apr 2021 17:54:45 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:37:55 GMT - ms-cv: vJReSgsEzEC1EVRdWZnCWA.0 + date: Tue, 13 Apr 2021 17:54:45 GMT + ms-cv: YpWO++6ovkOt61REvEzWXA.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 22ms + x-processing-time: 29ms status: code: 201 message: Created - url: https://communication2xbng6lk65f.communication.azure.com/identities?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 - request: body: '{"scopes": ["chat"]}' headers: @@ -41,52 +42,54 @@ interactions: Content-Type: - application/json Date: - - Fri, 29 Jan 2021 22:37:56 GMT + - Tue, 13 Apr 2021 17:54:45 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-01-30T22:37:54.9493083+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:45.5089019+00:00"}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:37:55 GMT - ms-cv: nQk1/zvYyEiAvNDwqRdZAg.0 + date: Tue, 13 Apr 2021 17:54:46 GMT + ms-cv: svbjN4vN+EmbtQxi2pcnCw.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 28ms + x-processing-time: 152ms status: code: 200 message: OK - url: https://communication2xbng6lk65f.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 - request: body: '' headers: Accept: - application/json Date: - - Fri, 29 Jan 2021 22:37:56 GMT + - Tue, 13 Apr 2021 17:54:45 GMT User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 response: body: string: '' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 - date: Fri, 29 Jan 2021 22:37:55 GMT - ms-cv: Bf9FLiU9kkm2bE7qs4H8Yw.0 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 + date: Tue, 13 Apr 2021 17:54:46 GMT + ms-cv: 5tqpKlCa/ESvOY9qWXQP0A.0 + request-context: appId= strict-transport-security: max-age=2592000 - x-processing-time: 674ms + x-processing-time: 208ms status: code: 204 message: No Content - url: https://communication2xbng6lk65f.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens_from_managed_identity.yaml b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens_from_managed_identity.yaml index ff0c50a514a8..fb454ef93117 100644 --- a/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-identity/tests/recordings/test_communication_identity_client_async.test_revoke_tokens_from_managed_identity.yaml @@ -9,24 +9,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: body: string: '{"identity": {"id": "sanitized"}}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:39:03 GMT - ms-cv: /SEx2qFrG0afGsUyQ/WtaQ.0 + date: Tue, 13 Apr 2021 17:54:48 GMT + ms-cv: lWjOWYpL90CS7wvt6sWZmw.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 325ms + x-processing-time: 111ms status: code: 201 message: Created - url: https://communicationztcvutdsdqx.communication.azure.com/identities?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities?api-version=2021-03-07 - request: body: '{"scopes": ["chat"]}' headers: @@ -37,44 +38,46 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: body: - string: '{"token": "sanitized", "expiresOn": "2021-01-30T22:39:02.9481803+00:00"}' + string: '{"token": "sanitized", "expiresOn": "2021-04-14T17:54:47.3442684+00:00"}' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 content-type: application/json; charset=utf-8 - date: Fri, 29 Jan 2021 22:39:03 GMT - ms-cv: ZzKd7QU4k0Or4Bt/g0hClg.0 + date: Tue, 13 Apr 2021 17:54:48 GMT + ms-cv: sdMJ7daQx0GS9bI8pul/bw.0 + request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 25ms + x-processing-time: 123ms status: code: 200 message: OK - url: https://communicationztcvutdsdqx.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.0b4 Python/3.9.0 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST - uri: https://communicationegrcrs.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 response: body: string: '' headers: - api-supported-versions: 2020-07-20-preview2, 2021-03-07 - date: Fri, 29 Jan 2021 22:39:03 GMT - ms-cv: F8O7efYC2EWG7TZ3/dJFpA.0 + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07 + date: Tue, 13 Apr 2021 17:54:48 GMT + ms-cv: s2kwtg8TQkG8aJp6NDHeLg.0 + request-context: appId= strict-transport-security: max-age=2592000 - x-processing-time: 616ms + x-processing-time: 248ms status: code: 204 message: No Content - url: https://communicationztcvutdsdqx.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 + url: https://lakshmanscommunication-communication.communication.azure.com/identities/sanitized/:revokeAccessTokens?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-identity/tests/test_communication_identity_client.py b/sdk/communication/azure-communication-identity/tests/test_communication_identity_client.py index 1cc5c8c4a747..1c0fd6abf10b 100644 --- a/sdk/communication/azure-communication-identity/tests/test_communication_identity_client.py +++ b/sdk/communication/azure-communication-identity/tests/test_communication_identity_client.py @@ -14,8 +14,7 @@ CommunicationTestCase, BodyReplacerProcessor ) -from devtools_testutils import ResourceGroupPreparer -from _shared.communication_service_preparer import CommunicationServicePreparer +from _shared.communication_service_preparer import CommunicationPreparer from azure.identity import DefaultAzureCredential from azure.communication.identity._shared.utils import parse_connection_str @@ -33,10 +32,9 @@ def setUp(self): BodyReplacerProcessor(keys=["id", "token"]), URIIdentityReplacer()]) - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - def test_create_user_from_managed_identity(self, connection_string): - endpoint, access_key = parse_connection_str(connection_string) + @CommunicationPreparer() + def test_create_user_from_managed_identity(self, communication_connection_string): + endpoint, access_key = parse_connection_str(communication_connection_string) from devtools_testutils import is_live if not is_live(): credential = FakeTokenCredential() @@ -47,28 +45,23 @@ def test_create_user_from_managed_identity(self, connection_string): assert user.properties.get('id') is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - def test_create_user(self, connection_string): + @CommunicationPreparer() + def test_create_user(self, communication_connection_string): identity_client = CommunicationIdentityClient.from_connection_string( - connection_string) + communication_connection_string) user = identity_client.create_user() - assert user.properties.get('id') is not None - - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - def test_create_user_and_token(self, connection_string): - identity_client = CommunicationIdentityClient.from_connection_string(connection_string) + @CommunicationPreparer() + def test_create_user_and_token(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string(communication_connection_string) user, token_response = identity_client.create_user_and_token(scopes=[CommunicationTokenScope.CHAT]) assert user.properties.get('id') is not None assert token_response.token is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - def test_get_token_from_managed_identity(self, connection_string): - endpoint, access_key = parse_connection_str(connection_string) + @CommunicationPreparer() + def test_get_token_from_managed_identity(self, communication_connection_string): + endpoint, access_key = parse_connection_str(communication_connection_string) from devtools_testutils import is_live if not is_live(): credential = FakeTokenCredential() @@ -82,11 +75,10 @@ def test_get_token_from_managed_identity(self, connection_string): assert user.properties.get('id') is not None assert token_response.token is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - def test_get_token(self, connection_string): + @CommunicationPreparer() + def test_get_token(self, communication_connection_string): identity_client = CommunicationIdentityClient.from_connection_string( - connection_string) + communication_connection_string) user = identity_client.create_user() token_response = identity_client.get_token(user, scopes=[CommunicationTokenScope.CHAT]) @@ -94,10 +86,9 @@ def test_get_token(self, connection_string): assert user.properties.get('id') is not None assert token_response.token is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - def test_revoke_tokens_from_managed_identity(self, connection_string): - endpoint, access_key = parse_connection_str(connection_string) + @CommunicationPreparer() + def test_revoke_tokens_from_managed_identity(self, communication_connection_string): + endpoint, access_key = parse_connection_str(communication_connection_string) from devtools_testutils import is_live if not is_live(): credential = FakeTokenCredential() @@ -112,11 +103,10 @@ def test_revoke_tokens_from_managed_identity(self, connection_string): assert user.properties.get('id') is not None assert token_response.token is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - def test_revoke_tokens(self, connection_string): + @CommunicationPreparer() + def test_revoke_tokens(self, communication_connection_string): identity_client = CommunicationIdentityClient.from_connection_string( - connection_string) + communication_connection_string) user = identity_client.create_user() token_response = identity_client.get_token(user, scopes=[CommunicationTokenScope.CHAT]) @@ -125,10 +115,9 @@ def test_revoke_tokens(self, connection_string): assert user.properties.get('id') is not None assert token_response.token is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - def test_delete_user_from_managed_identity(self, connection_string): - endpoint, access_key = parse_connection_str(connection_string) + @CommunicationPreparer() + def test_delete_user_from_managed_identity(self, communication_connection_string): + endpoint, access_key = parse_connection_str(communication_connection_string) from devtools_testutils import is_live if not is_live(): credential = FakeTokenCredential() @@ -141,11 +130,10 @@ def test_delete_user_from_managed_identity(self, connection_string): assert user.properties.get('id') is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - def test_delete_user(self, connection_string): + @CommunicationPreparer() + def test_delete_user(self, communication_connection_string): identity_client = CommunicationIdentityClient.from_connection_string( - connection_string) + communication_connection_string) user = identity_client.create_user() identity_client.delete_user(user) diff --git a/sdk/communication/azure-communication-identity/tests/test_communication_identity_client_async.py b/sdk/communication/azure-communication-identity/tests/test_communication_identity_client_async.py index 11674eeb1786..35dcb4d0e475 100644 --- a/sdk/communication/azure-communication-identity/tests/test_communication_identity_client_async.py +++ b/sdk/communication/azure-communication-identity/tests/test_communication_identity_client_async.py @@ -15,7 +15,7 @@ from _shared.helper import URIIdentityReplacer from _shared.asynctestcase import AsyncCommunicationTestCase from _shared.testcase import BodyReplacerProcessor -from _shared.communication_service_preparer import CommunicationServicePreparer +from _shared.communication_service_preparer import CommunicationPreparer from azure.identity import DefaultAzureCredential class FakeTokenCredential(object): @@ -31,10 +31,9 @@ def setUp(self): BodyReplacerProcessor(keys=["id", "token"]), URIIdentityReplacer()]) - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - async def test_create_user_from_managed_identity(self, connection_string): - endpoint, access_key = parse_connection_str(connection_string) + @CommunicationPreparer() + async def test_create_user_from_managed_identity(self, communication_connection_string): + endpoint, access_key = parse_connection_str(communication_connection_string) from devtools_testutils import is_live if not is_live(): credential = FakeTokenCredential() @@ -46,29 +45,26 @@ async def test_create_user_from_managed_identity(self, connection_string): assert user.properties.get('id') is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - async def test_create_user(self, connection_string): - identity_client = CommunicationIdentityClient.from_connection_string(connection_string) + @CommunicationPreparer() + async def test_create_user(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string(communication_connection_string) async with identity_client: user = await identity_client.create_user() assert user.properties.get('id') is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - async def test_create_user_and_token(self, connection_string): - identity_client = CommunicationIdentityClient.from_connection_string(connection_string) + @CommunicationPreparer() + async def test_create_user_and_token(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string(communication_connection_string) async with identity_client: user, token_response = await identity_client.create_user_and_token(scopes=[CommunicationTokenScope.CHAT]) assert user.properties.get('id') is not None assert token_response.token is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - async def test_get_token_from_managed_identity(self, connection_string): - endpoint, access_key = parse_connection_str(connection_string) + @CommunicationPreparer() + async def test_get_token_from_managed_identity(self, communication_connection_string): + endpoint, access_key = parse_connection_str(communication_connection_string) from devtools_testutils import is_live if not is_live(): credential = FakeTokenCredential() @@ -82,10 +78,9 @@ async def test_get_token_from_managed_identity(self, connection_string): assert user.properties.get('id') is not None assert token_response.token is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - async def test_get_token(self, connection_string): - identity_client = CommunicationIdentityClient.from_connection_string(connection_string) + @CommunicationPreparer() + async def test_get_token(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string(communication_connection_string) async with identity_client: user = await identity_client.create_user() token_response = await identity_client.get_token(user, scopes=[CommunicationTokenScope.CHAT]) @@ -93,10 +88,9 @@ async def test_get_token(self, connection_string): assert user.properties.get('id') is not None assert token_response.token is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - async def test_revoke_tokens_from_managed_identity(self, connection_string): - endpoint, access_key = parse_connection_str(connection_string) + @CommunicationPreparer() + async def test_revoke_tokens_from_managed_identity(self, communication_connection_string): + endpoint, access_key = parse_connection_str(communication_connection_string) from devtools_testutils import is_live if not is_live(): credential = FakeTokenCredential() @@ -111,10 +105,9 @@ async def test_revoke_tokens_from_managed_identity(self, connection_string): assert user.properties.get('id') is not None assert token_response.token is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - async def test_revoke_tokens(self, connection_string): - identity_client = CommunicationIdentityClient.from_connection_string(connection_string) + @CommunicationPreparer() + async def test_revoke_tokens(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string(communication_connection_string) async with identity_client: user = await identity_client.create_user() token_response = await identity_client.get_token(user, scopes=[CommunicationTokenScope.CHAT]) @@ -123,10 +116,9 @@ async def test_revoke_tokens(self, connection_string): assert user.properties.get('id') is not None assert token_response.token is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - async def test_delete_user_from_managed_identity(self, connection_string): - endpoint, access_key = parse_connection_str(connection_string) + @CommunicationPreparer() + async def test_delete_user_from_managed_identity(self, communication_connection_string): + endpoint, access_key = parse_connection_str(communication_connection_string) from devtools_testutils import is_live if not is_live(): credential = FakeTokenCredential() @@ -139,10 +131,9 @@ async def test_delete_user_from_managed_identity(self, connection_string): assert user.properties.get('id') is not None - @ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2)) - @CommunicationServicePreparer() - async def test_delete_user(self, connection_string): - identity_client = CommunicationIdentityClient.from_connection_string(connection_string) + @CommunicationPreparer() + async def test_delete_user(self, communication_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string(communication_connection_string) async with identity_client: user = await identity_client.create_user() await identity_client.delete_user(user) diff --git a/sdk/communication/test-resources.json b/sdk/communication/test-resources.json new file mode 100644 index 000000000000..2875b36ca191 --- /dev/null +++ b/sdk/communication/test-resources.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name." + } + }, + "endpointPrefix": { + "defaultValue": "communication", + "type": "string" + }, + "testApplicationOid": { + "type": "string", + "metadata": { + "description": "The client OID to grant access to test resources." + } + } + }, + "variables": { + "uniqueSubDomainName": "[format('{0}-{1}', parameters('baseName'), parameters('endpointPrefix'))]", + "contributorRoleId": "b24988ac-6180-42a0-ab88-20f7382dd24c" + }, + "resources": [ + { + "type": "Microsoft.Communication/CommunicationServices", + "apiVersion": "2020-08-20-preview", + "name": "[variables('uniqueSubDomainName')]", + "location": "global", + "properties": { + "dataLocation": "UnitedStates" + } + }, + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2019-04-01-preview", + "name": "[guid(resourceGroup().id, deployment().name, parameters('baseName'), variables('contributorRoleId'))]", + "properties": { + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('contributorRoleId'))]", + "principalId": "[parameters('testApplicationOid')]", + "scope": "[resourceGroup().id]" + } + } + ], + "outputs": { + "COMMUNICATION_CONNECTION_STRING": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.Communication/CommunicationServices',variables('uniqueSubDomainName')), '2020-08-20-preview').primaryConnectionString]" + } + } +} diff --git a/sdk/communication/tests.yml b/sdk/communication/tests.yml index 200a224b0455..94e5c422688f 100644 --- a/sdk/communication/tests.yml +++ b/sdk/communication/tests.yml @@ -6,6 +6,7 @@ stages: AllocateResourceGroup: 'false' BuildTargetingString: $(BuildTargetingString) ServiceDirectory: communication + DeployArmTemplate: true EnvVars: AZURE_TEST_RUN_LIVE: 'true' AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)