diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/authentication.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/authentication.py index b11dc5757808..d04c1e4fb539 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/authentication.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/authentication.py @@ -79,7 +79,9 @@ def _get_canonicalized_resource(self, request): uri_path = urlparse(request.http_request.url).path try: if isinstance(request.context.transport, AioHttpTransport) or \ - isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport): + isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport) or \ + isinstance(getattr(getattr(request.context.transport, "_transport", None), "_transport", None), + AioHttpTransport): uri_path = URL(uri_path) return '/' + self.account_name + str(uri_path) except TypeError: diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_create_blob_with_equal_sign.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_create_blob_with_equal_sign.yaml new file mode 100644 index 000000000000..67ecf96393b5 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_common_blob_async.test_create_blob_with_equal_sign.yaml @@ -0,0 +1,104 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.4.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 27 Aug 2020 01:48:41 GMT + x-ms-version: + - '2019-12-12' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer775c1685?timeout=5&restype=container + response: + body: + string: '' + headers: + content-length: '0' + date: Thu, 27 Aug 2020 01:48:40 GMT + etag: '"0x8D84A2B5357BF80"' + last-modified: Thu, 27 Aug 2020 01:48:41 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: '2019-12-12' + status: + code: 201 + message: Created + url: https://emilyeuap.blob.core.windows.net/utcontainer775c1685?timeout=5&restype=container +- request: + body: ??? + headers: + Content-Length: + - '3' + Content-Type: + - application/octet-stream + If-None-Match: + - '*' + User-Agent: + - azsdk-python-storage-blob/12.4.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-blob-type: + - BlockBlob + x-ms-date: + - Thu, 27 Aug 2020 01:48:41 GMT + x-ms-version: + - '2019-12-12' + method: PUT + uri: https://storagename.blob.core.windows.net/utcontainer775c1685/=ques=tion! + response: + body: + string: '' + headers: + content-length: '0' + content-md5: DRsIw0hYkhvHxmKyKKy3ug== + date: Thu, 27 Aug 2020 01:48:40 GMT + etag: '"0x8D84A2B536556A6"' + last-modified: Thu, 27 Aug 2020 01:48:41 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-content-crc64: VtoDJyOMw/A= + x-ms-request-server-encrypted: 'true' + x-ms-version: '2019-12-12' + x-ms-version-id: '2020-08-27T01:48:41.6124582Z' + status: + code: 201 + message: Created + url: https://emilyeuap.blob.core.windows.net/utcontainer775c1685/=ques=tion! +- request: + body: null + headers: + Accept: + - application/xml + User-Agent: + - azsdk-python-storage-blob/12.4.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Thu, 27 Aug 2020 01:48:41 GMT + x-ms-range: + - bytes=0-33554431 + x-ms-version: + - '2019-12-12' + method: GET + uri: https://storagename.blob.core.windows.net/utcontainer775c1685/=ques=tion! + response: + body: + string: ??? + headers: + accept-ranges: bytes + content-length: '3' + content-range: bytes 0-2/3 + content-type: application/octet-stream + date: Thu, 27 Aug 2020 01:48:41 GMT + etag: '"0x8D84A2B536556A6"' + last-modified: Thu, 27 Aug 2020 01:48:41 GMT + server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-content-md5: DRsIw0hYkhvHxmKyKKy3ug== + x-ms-blob-type: BlockBlob + x-ms-creation-time: Thu, 27 Aug 2020 01:48:41 GMT + x-ms-is-current-version: 'true' + x-ms-lease-state: available + x-ms-lease-status: unlocked + x-ms-server-encrypted: 'true' + x-ms-version: '2019-12-12' + x-ms-version-id: '2020-08-27T01:48:41.6124582Z' + status: + code: 206 + message: Partial Content + url: https://emilyeuap.blob.core.windows.net/utcontainer775c1685/=ques=tion! +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index c99a9a9fc152..b2a7bc6235d8 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -272,6 +272,24 @@ async def test_create_blob_with_question_mark(self, resource_group, location, st content = data.decode('utf-8') self.assertEqual(content, blob_data) + @GlobalStorageAccountPreparer() + @AsyncStorageTestCase.await_prepared_test + async def test_create_blob_with_equal_sign(self, resource_group, location, storage_account, storage_account_key): + # Arrange + await self._setup(storage_account, storage_account_key) + blob_name = '=ques=tion!' + blob_data = u'???' + + # Act + blob = self.bsc.get_blob_client(self.container_name, blob_name) + await blob.upload_blob(blob_data) + + # Assert + stream = await blob.download_blob() + data = await stream.readall() + self.assertIsNotNone(data) + content = data.decode('utf-8') + self.assertEqual(content, blob_data) @GlobalStorageAccountPreparer() @AsyncStorageTestCase.await_prepared_test diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/authentication.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/authentication.py index b11dc5757808..d04c1e4fb539 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/authentication.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/authentication.py @@ -79,7 +79,9 @@ def _get_canonicalized_resource(self, request): uri_path = urlparse(request.http_request.url).path try: if isinstance(request.context.transport, AioHttpTransport) or \ - isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport): + isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport) or \ + isinstance(getattr(getattr(request.context.transport, "_transport", None), "_transport", None), + AioHttpTransport): uri_path = URL(uri_path) return '/' + self.account_name + str(uri_path) except TypeError: diff --git a/sdk/storage/azure-storage-file-datalake/tests/recordings/test_directory.test_using_oauth_token_credential_to_create_directory.yaml b/sdk/storage/azure-storage-file-datalake/tests/recordings/test_directory.test_using_oauth_token_credential_to_create_directory.yaml index 85c4f30bc646..bede1438811a 100644 --- a/sdk/storage/azure-storage-file-datalake/tests/recordings/test_directory.test_using_oauth_token_credential_to_create_directory.yaml +++ b/sdk/storage/azure-storage-file-datalake/tests/recordings/test_directory.test_using_oauth_token_credential_to_create_directory.yaml @@ -1,6 +1,164 @@ interactions: - request: - body: client_id=68390a19-a897-236b-b453-488abf67b4fc&client_secret=%3A%5BGuwaYeN%5DIIJ%3Fq1XFGWRFSnypwoP415&grant_type=client_credentials&scope=https%3A%2F%2Fstorage.azure.com%2F.default + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0/.well-known/openid-configuration + response: + body: + string: '{"token_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code + id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}' + headers: + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=86400, private + Content-Length: + - '1651' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 27 Aug 2020 19:43:23 GMT + P3P: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + Set-Cookie: + - fpc=ArX8CgCJKeBBiLk96TvcGf4; expires=Sat, 26-Sep-2020 19:43:23 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tANQDiBGwHlEZcSRa2s41lHAqO6VnKpuNSl_YZYO2GRVmQpaO5y3vHc7U7_4-V2FSf9DnZBix_LZbKov2hu0xLK2GseVztO7bb8cVjzFkF55NZCEfclbO7vWn8FaXRnqsNvbwpf7ZJrhr8ZYlkdYyZfQOuQTv7SLf2LW1FssDoTPUgAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + x-ms-ests-server: + - 2.1.10985.8 - NCUS ProdSlices + x-ms-request-id: + - a5d6ec15-1687-4eb7-b7d9-152080097400 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Cookie: + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tANQDiBGwHlEZcSRa2s41lHAqO6VnKpuNSl_YZYO2GRVmQpaO5y3vHc7U7_4-V2FSf9DnZBix_LZbKov2hu0xLK2GseVztO7bb8cVjzFkF55NZCEfclbO7vWn8FaXRnqsNvbwpf7ZJrhr8ZYlkdYyZfQOuQTv7SLf2LW1FssDoTPUgAA; + fpc=ArX8CgCJKeBBiLk96TvcGf4; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd + User-Agent: + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.microsoftonline.com/common/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}' + headers: + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=86400, private + Content-Length: + - '945' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 27 Aug 2020 19:43:23 GMT + P3P: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + Set-Cookie: + - fpc=ArX8CgCJKeBBiLk96TvcGf4; expires=Sat, 26-Sep-2020 19:43:24 GMT; path=/; + secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=corp; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + nel: + - '{"report_to":"network-errors","max_age":86400,"success_fraction":0.001,"failure_fraction":1.0}' + report-to: + - '{"group":"network-errors","max_age":86400,"endpoints":[{"url":"https://ffde.nelreports.net/api/report?cat=estscorp+wst"}]}' + x-ms-ests-server: + - 2.1.10985.8 - WUS2 ProdSlices + x-ms-request-id: + - 6e0e9cbd-4b5c-4176-a1b8-889ffc84eb00 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0/.well-known/openid-configuration + response: + body: + string: '{"token_endpoint":"https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code + id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}' + headers: + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=86400, private + Content-Length: + - '1611' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 27 Aug 2020 19:43:23 GMT + P3P: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + Set-Cookie: + - fpc=Am3shTATcn1GgW_9smTLN8c; expires=Sat, 26-Sep-2020 19:43:24 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tA8sXhKMq7Y8s3PIAq0uWpjoTwVmcYbgd6A-FL5IrfkfYxDRzGy5R_n-QK4AtzqcgW5DLDVEsz50_FFlto5Sty4iBf6c8jHFGjPcItL1p008N6YLpUVcRWfav9rOUBsCxTWhDR15LkYpZsmFERj2gghy61FZwh8AXedcK9MVqvqlUgAA; + domain=.login.windows.net; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=corp; path=/; secure; samesite=none; httponly + - stsservicecookie=estscorp; path=/; secure; samesite=none; httponly + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + nel: + - '{"report_to":"network-errors","max_age":86400,"success_fraction":0.001,"failure_fraction":1.0}' + report-to: + - '{"group":"network-errors","max_age":86400,"endpoints":[{"url":"https://ffde.nelreports.net/api/report?cat=estscorp+wst"}]}' + x-ms-ests-server: + - 2.1.10985.8 - SAN ProdSlices + x-ms-request-id: + - 03176312-f1a8-4ce0-ae74-fc28f5bf5e01 + status: + code: 200 + message: OK +- request: + body: null headers: Accept: - '*/*' @@ -8,26 +166,143 @@ interactions: - gzip, deflate Connection: - keep-alive + User-Agent: + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sts.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0/.well-known/openid-configuration + response: + body: + string: '{"token_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code + id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}' + headers: + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=86400, private + Content-Length: + - '1651' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 27 Aug 2020 19:43:23 GMT + P3P: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + Set-Cookie: + - fpc=An5JSVy1kyVFtDPA9QhBN-I; expires=Sat, 26-Sep-2020 19:43:24 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tAMrtMe9CNNkntlarWvg7R37hVHilDlQAh7zQDu9bc89Lec17GuCfW5d819vnTP-4Ns1H5zPNkrcVMmS3LSZTuYqBp7eUNXiSv5LvCkGA01MJDkzJtGSZqM0w7WtbeEqpV3mpj6_tSF5BJmpD4NjiIuPZUZjkxGDNw7uil3iVOnAcgAA; + domain=.sts.windows.net; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=corp; path=/; secure; samesite=none; httponly + - stsservicecookie=estscorp; path=/; secure; samesite=none; httponly + X-Content-Type-Options: + - nosniff + nel: + - '{"report_to":"network-errors","max_age":86400,"success_fraction":0.001,"failure_fraction":1.0}' + report-to: + - '{"group":"network-errors","max_age":86400,"endpoints":[{"url":"https://ffde.nelreports.net/api/report?cat=estscorp+wst"}]}' + x-ms-ests-server: + - 2.1.10985.8 - SAN ProdSlices + x-ms-request-id: + - 03d5db39-9439-4dd6-9bbf-8b9dfc582401 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0/.well-known/openid-configuration + response: + body: + string: '{"token_endpoint":"https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code + id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}' + headers: + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=86400, private + Content-Length: + - '1621' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 27 Aug 2020 19:43:24 GMT + P3P: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + Set-Cookie: + - fpc=AhifQYkNJ6VNiAU7iech23s; expires=Sat, 26-Sep-2020 19:43:24 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tAc5RlvsLQvIW_M8QKru1RtbePDn_HiSxD39sjSzUDZ7h7fwAcEiQyE4fJNG-IQqY6jp4hgY1d8K32nvStnsA4PVnBVpT-3nBpuewxrFSl9ovLBivz3UYy7mAMw09egNHXLE536uj8isem9I5XCzw6oKTfK9SHJExBR9m_ixXd98QgAA; + domain=.login.microsoft.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + x-ms-ests-server: + - 2.1.10985.8 - SCUS ProdSlices + x-ms-request-id: + - 176377d5-050a-410d-b20e-3bbd2b907500 + status: + code: 200 + message: OK +- request: + body: client_id=68390a19-a897-236b-b453-488abf67b4fc&grant_type=client_credentials&client_info=1&client_secret=3Ujhg7pzkOeE7flc6Z187ugf5/cJnszGPjAiXmcwhaY=&scope=https%3A%2F%2Fstorage.azure.com%2F.default + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive Content-Length: - - '180' + - '188' Content-Type: - application/x-www-form-urlencoded + Cookie: + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tANQDiBGwHlEZcSRa2s41lHAqO6VnKpuNSl_YZYO2GRVmQpaO5y3vHc7U7_4-V2FSf9DnZBix_LZbKov2hu0xLK2GseVztO7bb8cVjzFkF55NZCEfclbO7vWn8FaXRnqsNvbwpf7ZJrhr8ZYlkdYyZfQOuQTv7SLf2LW1FssDoTPUgAA; + fpc=ArX8CgCJKeBBiLk96TvcGf4; stsservicecookie=estsfd; x-ms-gateway-slice=corp User-Agent: - - python-requests/2.22.0 + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + client-request-id: + - 1444602a-5083-4b78-8c74-ae7f1d535ce4 + x-client-cpu: + - x64 + x-client-current-telemetry: + - 1|730,0| + x-client-os: + - win32 + x-client-sku: + - MSAL.Python + x-client-ver: + - 1.3.0 method: POST uri: https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/token response: body: - string: '{"token_type":"Bearer","expires_in":3600,"ext_expires_in":3600,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJCOENlRlZxeWFHckdOdWVoSklpTDRkZmp6dyIsImtpZCI6IkJCOENlRlZxeWFHckdOdWVoSklpTDRkZmp6dyJ9.eyJhdWQiOiJodHRwczovL3N0b3JhZ2UuYXp1cmUuY29tIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3LyIsImlhdCI6MTU3NTQ3NTk1MiwibmJmIjoxNTc1NDc1OTUyLCJleHAiOjE1NzU0Nzk4NTIsImFpbyI6IjQyVmdZQ2o2OG5SVnJiY3dBN2ZuSlFjZjFYdHVBQT09IiwiYXBwaWQiOiI2ODM5MGExOS1hNjQzLTQ1OGItYjcyNi00MDhhYmY2N2I0ZmMiLCJhcHBpZGFjciI6IjEiLCJpZHAiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC83MmY5ODhiZi04NmYxLTQxYWYtOTFhYi0yZDdjZDAxMWRiNDcvIiwib2lkIjoiYzRmNDgyODktYmI4NC00MDg2LWIyNTAtNmY5NGE4ZjY0Y2VlIiwic3ViIjoiYzRmNDgyODktYmI4NC00MDg2LWIyNTAtNmY5NGE4ZjY0Y2VlIiwidGlkIjoiNzJmOTg4YmYtODZmMS00MWFmLTkxYWItMmQ3Y2QwMTFkYjQ3IiwidXRpIjoiM2kzU2hta1Zxa1dKZV9ZOXN4SXdBQSIsInZlciI6IjEuMCJ9.d6cR7q_McOzp-iASiwVbs0N0KpUhtjit4g7zqzFGcrjyLSClvikLtsG4FRiCURj1vDm8V_iB9FMZ6OznTiOeS71C3eRRIeElwK8PXCL88tYz31xm2QO1IxWYO_nlOfQDdXVsdsa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FhYi0yZDdjZDAxMWRiNDciLCJ1dGkiOiJ3R3l0YzkxUkcwcTVQaXBzelRWMkFBIiwidmVyIjoiMS4wIn0.aKvw67PDCID7yTHzaAv14lAXfJpBIs6dn12kbq5HHReK1V7adcRIVr-FwDAqm0CgddDsPfODg0QQbVjs99HleWDsEgVC1LCpoJ2Bk3GMnQ4oGqxrgna69tn1RIig8s5t8OnbqTvue6ZWQUfbCQqFyv_Nh9zMEQEMTdBI1BQY4zDlhlujAPzMt38aq0-l9Y9Mj_Uwr1hDTo4Fks6-zTS7RScCYs5MJLJPRbmTk1H3tTCQSPbnX9aUICZwXkn3JuyMo_xCUJuehi9bwfm-XfqzG4DjKtTeoibgsClKXEZSuZetwm5JLDy8EGm6xdk5xLrUP-J6gJfgdztZ0mwetVfnRQ"}' headers: Cache-Control: - - no-cache, no-store + - no-store, no-cache Content-Length: - - '1233' + - '1318' Content-Type: - application/json; charset=utf-8 Date: - - Wed, 04 Dec 2019 16:17:32 GMT + - Thu, 27 Aug 2020 19:43:23 GMT Expires: - '-1' P3P: @@ -35,18 +310,22 @@ interactions: Pragma: - no-cache Set-Cookie: - - fpc=AjT4VpG8k-9Oqn7rUwgB7vveSEc1AQAAABzTedUOAAAA; expires=Fri, 03-Jan-2020 - 16:17:32 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; SameSite=None; secure; HttpOnly - - stsservicecookie=estsfd; path=/; SameSite=None; secure; HttpOnly + - fpc=ArX8CgCJKeBBiLk96TvcGf7eSEc1AQAAANsD2tYOAAAA; expires=Sat, 26-Sep-2020 + 19:43:24 GMT; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly Strict-Transport-Security: - max-age=31536000; includeSubDomains X-Content-Type-Options: - nosniff + client-request-id: + - 1444602a-5083-4b78-8c74-ae7f1d535ce4 + x-ms-clitelem: + - 1,0,0,, x-ms-ests-server: - - 2.1.9707.16 - NCUS ProdSlices + - 2.1.10985.8 - WUS2 ProdSlices x-ms-request-id: - - 86d22dde-1569-45aa-897b-f63db3123000 + - 73ad6cc0-51dd-4a1b-b93e-2a6ccd357600 status: code: 200 message: OK @@ -62,15 +341,15 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-dfs/12.0.0b5 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-dfs/12.1.1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-client-request-id: - - 936a3c0a-16b1-11ea-afc0-001a7dda7113 + - 919b5c74-e89d-11ea-b6bd-001a7dda7113 x-ms-date: - - Wed, 04 Dec 2019 16:17:32 GMT + - Thu, 27 Aug 2020 19:43:23 GMT x-ms-properties: - '' x-ms-version: - - '2019-02-02' + - '2019-12-12' method: PUT uri: https://storagename.dfs.core.windows.net/filesystemcc271c2b/directorycc271c2b?resource=directory response: @@ -80,17 +359,17 @@ interactions: Content-Length: - '0' Date: - - Wed, 04 Dec 2019 16:17:32 GMT + - Thu, 27 Aug 2020 19:43:24 GMT ETag: - - '"0x8D778D57815E31D"' + - '"0x8D84AC1768A7CF1"' Last-Modified: - - Wed, 04 Dec 2019 16:17:33 GMT + - Thu, 27 Aug 2020 19:43:25 GMT Server: - Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-id: - - 58612a7b-901f-001d-45be-aa4028000000 + - a0b6cfbc-e01f-0028-3faa-7c2c3c000000 x-ms-version: - - '2019-02-02' + - '2019-12-12' status: code: 201 message: Created diff --git a/sdk/storage/azure-storage-file-datalake/tests/recordings/test_file.test_create_file_using_oauth_token_credential.yaml b/sdk/storage/azure-storage-file-datalake/tests/recordings/test_file.test_create_file_using_oauth_token_credential.yaml index c2bd9f9b8e65..9f553426c5be 100644 --- a/sdk/storage/azure-storage-file-datalake/tests/recordings/test_file.test_create_file_using_oauth_token_credential.yaml +++ b/sdk/storage/azure-storage-file-datalake/tests/recordings/test_file.test_create_file_using_oauth_token_credential.yaml @@ -1,6 +1,162 @@ interactions: - request: - body: client_id=68390a19-a897-236b-b453-488abf67b4fc&client_secret=%3A%5BGuwaYeN%5DIIJ%3Fq1XFGWRFSnypwoP415&grant_type=client_credentials&scope=https%3A%2F%2Fstorage.azure.com%2F.default + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0/.well-known/openid-configuration + response: + body: + string: '{"token_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code + id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}' + headers: + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=86400, private + Content-Length: + - '1651' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 27 Aug 2020 19:44:15 GMT + P3P: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + Set-Cookie: + - fpc=AhWOZd3t29dKq4xz4nfTKW0; expires=Sat, 26-Sep-2020 19:44:16 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tAiROcMdTRj99As0iPbqrAZ0MfDIiulTR46Q0plg6aSBUKSBlqy3zWxkLj0r73GFysR199Sq2KZnMUELt-GYhucXwjpC53L0u_vR7bFqyuQk-fuJA0ir8jFG5jxCxfKZ2iwDQKyj-9lEUFucu4QtzWC4jdesI_L0IPAYMbPCD8Zm0gAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + x-ms-ests-server: + - 2.1.10985.8 - EUS ProdSlices + x-ms-request-id: + - f4b8eaf0-306a-4034-ae38-db314f9f6900 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Cookie: + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tAiROcMdTRj99As0iPbqrAZ0MfDIiulTR46Q0plg6aSBUKSBlqy3zWxkLj0r73GFysR199Sq2KZnMUELt-GYhucXwjpC53L0u_vR7bFqyuQk-fuJA0ir8jFG5jxCxfKZ2iwDQKyj-9lEUFucu4QtzWC4jdesI_L0IPAYMbPCD8Zm0gAA; + fpc=AhWOZd3t29dKq4xz4nfTKW0; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd + User-Agent: + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.microsoftonline.com/common/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}' + headers: + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=86400, private + Content-Length: + - '945' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 27 Aug 2020 19:44:15 GMT + P3P: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + Set-Cookie: + - fpc=AhWOZd3t29dKq4xz4nfTKW0; expires=Sat, 26-Sep-2020 19:44:16 GMT; path=/; + secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=corp; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + nel: + - '{"report_to":"network-errors","max_age":86400,"success_fraction":0.001,"failure_fraction":1.0}' + report-to: + - '{"group":"network-errors","max_age":86400,"endpoints":[{"url":"https://ffde.nelreports.net/api/report?cat=estscorp+wst"}]}' + x-ms-ests-server: + - 2.1.10985.8 - SAN ProdSlices + x-ms-request-id: + - 4f67a1b3-05b5-4fd4-8f4d-66ec553d6d01 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sts.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0/.well-known/openid-configuration + response: + body: + string: '{"token_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code + id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}' + headers: + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=86400, private + Content-Length: + - '1651' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 27 Aug 2020 19:44:16 GMT + P3P: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + Set-Cookie: + - fpc=An8oYeGPk5dNvtGVVGymjQw; expires=Sat, 26-Sep-2020 19:44:16 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tAG1Zv0wt89MPE8SIpv4HmO3xIMU7rtaw9laKbyCTQW6G7YQCOou3EcWmPnep08JUZFihaVAKHbvqphltTm4Gx8QIuJmEjgHHtQSDB2YpvWwafxWXlr8t-NevKgELaM3CKwJTCtLRsRY2VsxdrWGfHjNHnZC8B-egSpRzGHI685e0gAA; + domain=.sts.windows.net; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=corp; path=/; secure; samesite=none; httponly + - stsservicecookie=estscorp; path=/; secure; samesite=none; httponly + X-Content-Type-Options: + - nosniff + nel: + - '{"report_to":"network-errors","max_age":86400,"success_fraction":0.001,"failure_fraction":1.0}' + report-to: + - '{"group":"network-errors","max_age":86400,"endpoints":[{"url":"https://ffde.nelreports.net/api/report?cat=estscorp+wst"}]}' + x-ms-ests-server: + - 2.1.10985.8 - WUS2 ProdSlices + x-ms-request-id: + - ef688111-dc8e-4a16-8b5e-3b76ab91f100 + status: + code: 200 + message: OK +- request: + body: null headers: Accept: - '*/*' @@ -8,26 +164,145 @@ interactions: - gzip, deflate Connection: - keep-alive + User-Agent: + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0/.well-known/openid-configuration + response: + body: + string: '{"token_endpoint":"https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code + id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoft.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}' + headers: + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=86400, private + Content-Length: + - '1621' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 27 Aug 2020 19:44:16 GMT + P3P: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + Set-Cookie: + - fpc=AiuhCGlUHdtFjIiYUm5jSiw; expires=Sat, 26-Sep-2020 19:44:16 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tAlCJ0DKaoU7scca6eRX-lgcvvF3dXcAZJBcCCxWP2Go-DZBtHS9croIOK_yCuibLWebKkQkL9bnlDcf8dkzZZiZooD7Qwb4sZR8_sVlNQZjGnNpdLmSE-xGnk9VYzCI5omsnCJUitilElAiSAY6VqHmm2saCKKk_d1zGn1isqU2YgAA; + domain=.login.microsoft.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + x-ms-ests-server: + - 2.1.10985.8 - SCUS ProdSlices + x-ms-request-id: + - db75844a-78f6-48ec-8795-4a3e0ed67600 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0/.well-known/openid-configuration + response: + body: + string: '{"token_endpoint":"https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code + id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.windows.net/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}' + headers: + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - max-age=86400, private + Content-Length: + - '1611' + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 27 Aug 2020 19:44:16 GMT + P3P: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + Set-Cookie: + - fpc=ArRkzBvfEalJn5sVWdp7Dh8; expires=Sat, 26-Sep-2020 19:44:16 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tAtO0xKr9YefLVXjzfgaENBvbWBKX57xQYCBo96UlmvrzcxEjFzWWjCwAshsIwUcP_v02EED2bTDQUK0fpZttU5KTw6IAzjOZ5pgi8MOlVl0JIuShbVAWI6Qu4hIc7I7nuSktxVt5JsBul5L4I4a_e3SrfvAIj2mJPuEvfK-9bzIAgAA; + domain=.login.windows.net; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=corp; path=/; secure; samesite=none; httponly + - stsservicecookie=estscorp; path=/; secure; samesite=none; httponly + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + nel: + - '{"report_to":"network-errors","max_age":86400,"success_fraction":0.001,"failure_fraction":1.0}' + report-to: + - '{"group":"network-errors","max_age":86400,"endpoints":[{"url":"https://ffde.nelreports.net/api/report?cat=estscorp+wst"}]}' + x-ms-ests-server: + - 2.1.10985.8 - SAN ProdSlices + x-ms-request-id: + - 03d5db39-9439-4dd6-9bbf-8b9d57622401 + status: + code: 200 + message: OK +- request: + body: client_id=68390a19-a897-236b-b453-488abf67b4fc&grant_type=client_credentials&client_info=1&client_secret=3Ujhg7pzkOeE7flc6Z187ugf5/cJnszGPjAiXmcwhaY=&scope=https%3A%2F%2Fstorage.azure.com%2F.default + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive Content-Length: - - '180' + - '188' Content-Type: - application/x-www-form-urlencoded + Cookie: + - esctx=AQABAAAAAAAGV_bv21oQQ4ROqh0_1-tAiROcMdTRj99As0iPbqrAZ0MfDIiulTR46Q0plg6aSBUKSBlqy3zWxkLj0r73GFysR199Sq2KZnMUELt-GYhucXwjpC53L0u_vR7bFqyuQk-fuJA0ir8jFG5jxCxfKZ2iwDQKyj-9lEUFucu4QtzWC4jdesI_L0IPAYMbPCD8Zm0gAA; + fpc=AhWOZd3t29dKq4xz4nfTKW0; stsservicecookie=estsfd; x-ms-gateway-slice=corp User-Agent: - - python-requests/2.22.0 + - azsdk-python-identity/1.5.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0) + client-request-id: + - 6753ca4f-56cc-4b0c-95dd-2487b97d835c + x-client-cpu: + - x64 + x-client-current-telemetry: + - 1|730,0| + x-client-os: + - win32 + x-client-sku: + - MSAL.Python + x-client-ver: + - 1.3.0 method: POST uri: https://login.microsoftonline.com/32f988bf-54f1-15af-36ab-2d7cd364db47/oauth2/v2.0/token response: body: - string: '{"token_type":"Bearer","expires_in":3600,"ext_expires_in":3600,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkJCOENlRlZxeWFHckdOdWVoSklpTDRkZmp6dyIsImtpZCI6IkJCOENlRlZxeWFHckdOdWVoSklpTDRkZmp6dyJ9.eyJhdWQ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klRAwPWL9g1xtuKP5TYpdFFx_mi3DXyjJAAfb0WhK9vE-r4-ZDMFMFKAaJMcbV6oSldv7hz-byl1JxtrR6q6FJoCAhziHylw-4_YAMuoJdnK9gRUMXN5YZSsCuz93X0V_ynOwRA8w4BYWDJY1rQ"}' headers: Cache-Control: - - no-cache, no-store + - no-store, no-cache Content-Length: - - '1233' + - '1318' Content-Type: - application/json; charset=utf-8 Date: - - Wed, 04 Dec 2019 16:19:07 GMT + - Thu, 27 Aug 2020 19:44:16 GMT Expires: - '-1' P3P: @@ -35,18 +310,22 @@ interactions: Pragma: - no-cache Set-Cookie: - - fpc=AkwEWaKOZNpBtXky1EeutcjeSEc1AQAAAHvTedUOAAAA; expires=Fri, 03-Jan-2020 - 16:19:08 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; SameSite=None; secure; HttpOnly - - stsservicecookie=estsfd; path=/; SameSite=None; secure; HttpOnly + - fpc=AhWOZd3t29dKq4xz4nfTKW3eSEc1AQAAABAE2tYOAAAA; expires=Sat, 26-Sep-2020 + 19:44:17 GMT; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly Strict-Transport-Security: - max-age=31536000; includeSubDomains X-Content-Type-Options: - nosniff + client-request-id: + - 6753ca4f-56cc-4b0c-95dd-2487b97d835c + x-ms-clitelem: + - 1,0,0,, x-ms-ests-server: - - 2.1.9707.16 - WUS ProdSlices + - 2.1.10985.8 - NCUS ProdSlices x-ms-request-id: - - 4e280258-e85f-4d53-a798-d6f202fbdf00 + - cc364e43-a1fd-4770-8a32-ca6b140d7200 status: code: 200 message: OK @@ -62,15 +341,15 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-dfs/12.0.0b5 Python/3.7.3 (Windows-10-10.0.18362-SP0) + - azsdk-python-storage-dfs/12.1.1 Python/3.7.3 (Windows-10-10.0.19041-SP0) x-ms-client-request-id: - - cc420a78-16b1-11ea-aad8-001a7dda7113 + - b0c57194-e89d-11ea-a525-001a7dda7113 x-ms-date: - - Wed, 04 Dec 2019 16:19:08 GMT + - Thu, 27 Aug 2020 19:44:16 GMT x-ms-properties: - '' x-ms-version: - - '2019-02-02' + - '2019-12-12' method: PUT uri: https://storagename.dfs.core.windows.net/filesystem73a6167f/file73a6167f?resource=file response: @@ -80,17 +359,17 @@ interactions: Content-Length: - '0' Date: - - Wed, 04 Dec 2019 16:19:08 GMT + - Thu, 27 Aug 2020 19:44:16 GMT ETag: - - '"0x8D778D5B10053EC"' + - '"0x8D84AC195C35579"' Last-Modified: - - Wed, 04 Dec 2019 16:19:08 GMT + - Thu, 27 Aug 2020 19:44:17 GMT Server: - Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-id: - - 8fcb852e-601f-0026-60be-aa058c000000 + - 6837e147-501f-0002-16aa-7cf32c000000 x-ms-version: - - '2019-02-02' + - '2019-12-12' status: code: 201 message: Created diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/authentication.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/authentication.py index b11dc5757808..d04c1e4fb539 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/authentication.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/authentication.py @@ -79,7 +79,9 @@ def _get_canonicalized_resource(self, request): uri_path = urlparse(request.http_request.url).path try: if isinstance(request.context.transport, AioHttpTransport) or \ - isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport): + isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport) or \ + isinstance(getattr(getattr(request.context.transport, "_transport", None), "_transport", None), + AioHttpTransport): uri_path = URL(uri_path) return '/' + self.account_name + str(uri_path) except TypeError: diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/authentication.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/authentication.py index b11dc5757808..d04c1e4fb539 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/authentication.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/authentication.py @@ -79,7 +79,9 @@ def _get_canonicalized_resource(self, request): uri_path = urlparse(request.http_request.url).path try: if isinstance(request.context.transport, AioHttpTransport) or \ - isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport): + isinstance(getattr(request.context.transport, "_transport", None), AioHttpTransport) or \ + isinstance(getattr(getattr(request.context.transport, "_transport", None), "_transport", None), + AioHttpTransport): uri_path = URL(uri_path) return '/' + self.account_name + str(uri_path) except TypeError: