From 245c0bb59af5998c9a6b18975a727d9e2b4b8b8a Mon Sep 17 00:00:00 2001 From: EmmaZhu-MSFT Date: Mon, 16 Oct 2023 14:46:36 +0800 Subject: [PATCH] [Storage]Add support to indicate audience in client options and upgrade REST API version (#27402) ### Packages impacted by this PR ### Issues associated with this PR ### Describe the problem that is addressed by this PR ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary) --- sdk/storage/storage-blob/CHANGELOG.md | 6 +- ...ding_bearer_token_challenge_should_work.js | 445 +++++++++++++++ ...cording_customized_audience_should_work.js | 229 ++++++++ .../recording_default_audience_should_work.js | 231 ++++++++ ...ding_bearer_token_challenge_should_work.js | 370 +++++++++++++ ...cording_customized_audience_should_work.js | 145 +++++ .../recording_default_audience_should_work.js | 141 +++++ ...ding_bearer_token_challenge_should_work.js | 455 +++++++++++++++ ...cording_customized_audience_should_work.js | 239 ++++++++ .../recording_default_audience_should_work.js | 241 ++++++++ ...ding_bearer_token_challenge_should_work.js | 424 ++++++++++++++ ...cording_customized_audience_should_work.js | 197 +++++++ .../recording_default_audience_should_work.js | 199 +++++++ ...ding_bearer_token_challenge_should_work.js | 449 +++++++++++++++ ...cording_customized_audience_should_work.js | 229 ++++++++ .../recording_default_audience_should_work.js | 229 ++++++++ .../storage-blob/review/storage-blob.api.md | 3 + sdk/storage/storage-blob/src/Pipeline.ts | 1 + .../src/generated/src/models/parameters.ts | 2 +- .../src/generated/src/storageClientContext.ts | 2 +- sdk/storage/storage-blob/src/index.ts | 1 + sdk/storage/storage-blob/src/models.ts | 4 + .../storage-blob/src/utils/constants.ts | 2 +- sdk/storage/storage-blob/swagger/README.md | 4 +- .../test/node/appendblobclient.spec.ts | 55 ++ .../test/node/blobserviceclient.spec.ts | 64 ++- .../test/node/blockblobclient.spec.ts | 56 ++ .../test/node/containerclient.spec.ts | 57 +- .../test/node/pageblobclient.spec.ts | 54 ++ .../storage-file-datalake/CHANGELOG.md | 7 + .../storage-file-datalake/package.json | 2 +- ...ient_bearer_token_challenge_should_work.js | 426 ++++++++++++++ ...eclient_customized_audience_should_work.js | 264 +++++++++ ...fileclient_default_audience_should_work.js | 199 +++++++ ...ient_bearer_token_challenge_should_work.js | 430 +++++++++++++++ ...mclient_customized_audience_should_work.js | 262 +++++++++ ...stemclient_default_audience_should_work.js | 203 +++++++ ...ient_bearer_token_challenge_should_work.js | 520 ++++++++++++++++++ ...yclient_customized_audience_should_work.js | 362 ++++++++++++ ...toryclient_default_audience_should_work.js | 306 +++++++++++ ...ient_bearer_token_challenge_should_work.js | 492 +++++++++++++++++ ...eclient_customized_audience_should_work.js | 340 ++++++++++++ ...fileclient_default_audience_should_work.js | 280 ++++++++++ ...ient_bearer_token_challenge_should_work.js | 366 ++++++++++++ ...eclient_customized_audience_should_work.js | 208 +++++++ ...viceclient_default_audience_should_work.js | 143 +++++ .../review/storage-file-datalake.api.md | 9 + .../storage-file-datalake/src/Pipeline.ts | 12 +- .../src/generated/src/models/parameters.ts | 2 +- .../src/generated/src/storageClientContext.ts | 4 +- .../storage-file-datalake/src/models.ts | 14 + ...earerTokenChallengeAuthenticationPolicy.ts | 351 ++++++++++++ .../src/utils/constants.ts | 4 +- .../storage-file-datalake/swagger/README.md | 6 +- .../test/node/filesystemclient.spec.ts | 54 +- .../test/node/pathclient.spec.ts | 106 ++++ .../test/node/serviceclient.spec.ts | 56 +- .../test/utils/assert.ts | 5 +- sdk/storage/storage-file-share/CHANGELOG.md | 7 + sdk/storage/storage-file-share/package.json | 2 +- .../recording_bad_audience_should_fail.js | 235 ++++++++ ...cording_customized_audience_should_work.js | 259 +++++++++ .../recording_default_audience_should_work.js | 257 +++++++++ .../recording_bad_audience_should_fail.js | 253 +++++++++ ...cording_customized_audience_should_work.js | 283 ++++++++++ .../recording_default_audience_should_work.js | 283 ++++++++++ .../recording_bad_audience_should_fail.js | 221 ++++++++ ...cording_customized_audience_should_work.js | 219 ++++++++ .../recording_default_audience_should_work.js | 217 ++++++++ .../review/storage-file-share.api.md | 9 + .../storage-file-share/src/Pipeline.ts | 12 +- .../src/generated/src/models/parameters.ts | 2 +- .../src/generated/src/storageClientContext.ts | 4 +- sdk/storage/storage-file-share/src/index.ts | 2 + sdk/storage/storage-file-share/src/models.ts | 14 + .../storage-file-share/src/utils/constants.ts | 4 +- .../storage-file-share/swagger/README.md | 6 +- .../test/node/directoryclient.spec.ts | 44 +- .../test/node/fileclient.spec.ts | 46 ++ .../test/node/shareclient.spec.ts | 80 ++- .../storage-file-share/test/utils/index.ts | 12 + .../test/utils/testutils.common.ts | 3 + sdk/storage/storage-queue/CHANGELOG.md | 7 + sdk/storage/storage-queue/package.json | 2 +- ...ient_bearer_token_challenge_should_work.js | 402 ++++++++++++++ ...eclient_customized_audience_should_work.js | 179 ++++++ ...ueueclient_default_audience_should_work.js | 181 ++++++ .../storage-queue/review/storage-queue.api.md | 9 + sdk/storage/storage-queue/src/Pipeline.ts | 12 +- .../src/generated/src/models/parameters.ts | 2 +- .../src/generated/src/storageClientContext.ts | 4 +- sdk/storage/storage-queue/src/index.ts | 2 +- sdk/storage/storage-queue/src/models.ts | 14 + ...earerTokenChallengeAuthenticationPolicy.ts | 351 ++++++++++++ .../storage-queue/src/utils/constants.ts | 4 +- sdk/storage/storage-queue/swagger/README.md | 6 +- .../test/node/queueclient.spec.ts | 61 +- .../storage-queue/test/utils/assert.ts | 5 +- .../test/utils/testutils.common.ts | 47 ++ 99 files changed, 13668 insertions(+), 61 deletions(-) create mode 100644 sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_customized_audience_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_default_audience_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_customized_audience_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_default_audience_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_customized_audience_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_default_audience_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_customized_audience_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_default_audience_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_customized_audience_should_work.js create mode 100644 sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_default_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_customized_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_default_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_customized_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_default_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_customized_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_default_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_customized_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_default_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_customized_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_default_audience_should_work.js create mode 100644 sdk/storage/storage-file-datalake/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.ts create mode 100644 sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_bad_audience_should_fail.js create mode 100644 sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_customized_audience_should_work.js create mode 100644 sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_default_audience_should_work.js create mode 100644 sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_bad_audience_should_fail.js create mode 100644 sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_customized_audience_should_work.js create mode 100644 sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_default_audience_should_work.js create mode 100644 sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_bad_audience_should_fail.js create mode 100644 sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_customized_audience_should_work.js create mode 100644 sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_default_audience_should_work.js create mode 100644 sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_bearer_token_challenge_should_work.js create mode 100644 sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_customized_audience_should_work.js create mode 100644 sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_default_audience_should_work.js create mode 100644 sdk/storage/storage-queue/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.ts diff --git a/sdk/storage/storage-blob/CHANGELOG.md b/sdk/storage/storage-blob/CHANGELOG.md index 143b617d07f3..099bcf90ae15 100644 --- a/sdk/storage/storage-blob/CHANGELOG.md +++ b/sdk/storage/storage-blob/CHANGELOG.md @@ -4,11 +4,7 @@ ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added support for service version 2023-11-03. ## 12.16.0 (2023-09-14) diff --git a/sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js b/sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..3d6ab60f55e7 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js @@ -0,0 +1,445 @@ +let nock = require('nock'); + +module.exports.hash = "ab705226f6d1186c79bc18955dc8bff7"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708258064700999","blob":"blob169708258076008779"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708258064700999') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:41 GMT', + 'ETag', + '"0x8DBCAD6440123A9"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27577-f01e-0036-69bf-fc1e51000000', + 'x-ms-client-request-id', + '207e65a7-9108-4b2e-ba15-9cd56f6a3a10', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:40 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708258064700999/blob169708258076008779') + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:41 GMT', + 'ETag', + '"0x8DBCAD64412CFFE"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a275f2-f01e-0036-63bf-fc1e51000000', + 'x-ms-client-request-id', + 'bad83099-07a0-4d9d-af0f-6194bd6d6cdb', + 'x-ms-version', + '2023-08-03', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-version-id', + '2023-10-12T03:49:41.6962827Z', + 'Date', + 'Thu, 12 Oct 2023 03:49:41 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'ff6bc074-d15d-45fb-8470-4a9538eb1d00', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-Q7VG5DvwadrVVwvwIu86HQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvpCbWypozpLlmh8tKT4aJQ; expires=Sat, 11-Nov-2023 03:49:41 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPi4lD1WoDs6h0EaLCrTvJk47YctlTdv1h0Nam8LAgiT71NMblu6hw67mEzj1xXG_0v62wc7NYy3it8MKMm0m61FOx-7Ctuqta9EAWoeblHBCtJibxjXgW7UVhUgxczuD8-UMQo1ZD6zZRZaDLHVkBqKLrGu405dE832Pq29IvrrAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:41 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-268853ca0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvRa_E43pLtMp_wHRhf9GHY; expires=Sat, 11-Nov-2023 03:49:41 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPcH5UXgdFw90pcl3JCm-PmK3vEe9drmjdRK7SInmv9xaq7gS88t5o5-ZSeQAZo_yJQumbeGsTqw9v_Ar0MmvgudiYXmU50RVi4omdkpNdFiO-hXa4GeOkmK1IZI2_TJqseOsAl8V0G9fYb7oyEkwnZ9moRa2BOwnlfxuBs2fH6JggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:41 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=e74d9ef7-a6d2-4bad-91ad-70ccf6130a8b&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '49e7c5ab-9f74-4bfa-b280-f34619340e00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AjksrF2byqZAgoQycqotkUOt-wbLAQAAANVjudwOAAAA; expires=Sat, 11-Nov-2023 03:49:42 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:42 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708258064700999/blob169708258076008779') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27837-f01e-0036-09bf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:41 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708258064700999/blob169708258076008779') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27888-f01e-0036-58bf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:41 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'f99dcba1-b28d-4c1a-8718-e2fbea181600', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Am5jsji6CmVDnRy64QWl8HM; expires=Sat, 11-Nov-2023 03:49:42 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPWfyJgxxszzNIiL_tOkM_7_qD2gLawEpzZNvUkcMaDPrw-4mFEflyDwLB3MNRMFByoDzi_4Ww8nXnEeQ6YVF2zb8oogPrGpqwV79FZQmuNrz6O-zfRaSAl7wU5egh8fkCxzox9SmPZGrzFLP4kAl40bwZykaZbd4RqlUW37ncXUAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:42 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-268860ca0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AiGcTyzEPT9PosIrjhxwum8; expires=Sat, 11-Nov-2023 03:49:42 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPHRMRIub94KAADKeSLRNyV5DJ1l1euBQtm1X3VFDLDh2omiFb70cUWkaxlqApTZlPxTbhvKoVGSuHkQaGnzH1zKqtkfdrg2oxLJa8PUzD2zyfzl5KBz270xE-LvrzOJzF6w9RPGsYaK-s0zljYa-FvUQX2BGhRyMlAyf5qOrtM-MgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:42 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=73851be0-d037-4574-8d33-49dd76739d83&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '7f9dab17-3556-43d7-b080-eed3a0ce0200', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-AWxEFX8Iws4-VJ88i_-1iw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AubR1s_AyCRCi1yc9eR08pA; expires=Sat, 11-Nov-2023 03:49:42 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:42 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708258064700999/blob169708258076008779') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a279db-f01e-0036-1cbf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:42 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=a9eec8ff-cd7b-4256-b4de-cf2cb46481bd&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'c5ecb3cd-12c6-4dd9-9a71-b6afd5598500', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-UspctRhOxaYTc11zWaHmaA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AtQK19drn_BKmH3a_IUTXBDeeSdeAQAAANZjudwOAAAA; expires=Sat, 11-Nov-2023 03:49:43 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:43 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708258064700999/blob169708258076008779') + .reply(200, "", [ + 'Content-Length', + '0', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:41 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAD64412CFFE"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27ac8-f01e-0036-05bf-fc1e51000000', + 'x-ms-client-request-id', + '42d1be21-ccf2-4915-98d6-32c8d27f4b36', + 'x-ms-version', + '2023-08-03', + 'x-ms-version-id', + '2023-10-12T03:49:41.6962827Z', + 'x-ms-is-current-version', + 'true', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 03:49:41 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'AppendBlob', + 'x-ms-blob-committed-block-count', + '0', + 'x-ms-server-encrypted', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-blob-committed-block-count,x-ms-server-encrypted,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:42 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708258064700999') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27af4-f01e-0036-31bf-fc1e51000000', + 'x-ms-client-request-id', + '86c75085-c37f-448b-ba9b-a8ce1fb39665', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:42 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_customized_audience_should_work.js b/sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_customized_audience_should_work.js new file mode 100644 index 000000000000..c9012a64e84c --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_customized_audience_should_work.js @@ -0,0 +1,229 @@ +let nock = require('nock'); + +module.exports.hash = "9b30169daa98691c31ebc7f9034a4260"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708257961707991","blob":"blob169708257972809389"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708257961707991') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:40 GMT', + 'ETag', + '"0x8DBCAD64363C1FE"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a271c0-f01e-0036-64bf-fc1e51000000', + 'x-ms-client-request-id', + 'ab0bcaf3-476a-42ed-a030-6b0dab6bbdd7', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:39 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708257961707991/blob169708257972809389') + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:40 GMT', + 'ETag', + '"0x8DBCAD643756E53"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27251-f01e-0036-67bf-fc1e51000000', + 'x-ms-client-request-id', + '5180adca-0b39-4ae3-b011-8d43543e9b73', + 'x-ms-version', + '2023-08-03', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-version-id', + '2023-10-12T03:49:40.6638675Z', + 'Date', + 'Thu, 12 Oct 2023 03:49:40 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'd46c7940-91af-4b3b-a132-81f782db1c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aja5kyh3-JxErMZt3GekjzQ; expires=Sat, 11-Nov-2023 03:49:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPf5N6cgFapLYBavMEnIQTVyWfEAG2E7a0PFeLwmtp50ZPHZVIOWWAMBb_L9PuSOSqxmKbLdEOZb1TylaTl4cA1ZABqfpuk0pGfpshixHdJq7tQziA7mJDm-eV8p0DEH5Vg1lhy2VSP_tTLYB9jYvFxHU86ANQSAjpDw59RiKGF3wgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:40 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '3d4fca17-ef71-46b2-bac4-ab0056242d00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce--0fg-YqcdkWYY91AAgy8EA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AkItMCt4FQFOgYbb9QyYnMw; expires=Sat, 11-Nov-2023 03:49:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPZliRr9Ww_DCCpk3FNi8tcRE_fAqAiGzpiWoVZpCMIi2b6vFEo7iNSuS10dsGSkqIosRADmK_gIaNBxtkNvYXtadun5Ln2dRwSjD8svfqB07W8D3vyQUIGkkU5hzNDxUP2lD-Kg66Q9qvWKrptvJ30cGVjFXnnEnLgnbEt7fyov0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:40 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=e7d98e9f-e813-4a70-9ce4-b3756aa360b1&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-268845ca0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aj7TmTp0NpREiAxorGe7sCsaUecJAQAAANRjudwOAAAA; expires=Sat, 11-Nov-2023 03:49:41 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:40 GMT', + 'Content-Length', + '1337' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708257961707991/blob169708257972809389') + .reply(200, "", [ + 'Content-Length', + '0', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:40 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAD643756E53"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a274b5-f01e-0036-2dbf-fc1e51000000', + 'x-ms-client-request-id', + '91589df2-7692-49aa-a5f1-eb08db964e7d', + 'x-ms-version', + '2023-08-03', + 'x-ms-version-id', + '2023-10-12T03:49:40.6638675Z', + 'x-ms-is-current-version', + 'true', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 03:49:40 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'AppendBlob', + 'x-ms-blob-committed-block-count', + '0', + 'x-ms-server-encrypted', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-blob-committed-block-count,x-ms-server-encrypted,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:40 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708257961707991') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27508-f01e-0036-7cbf-fc1e51000000', + 'x-ms-client-request-id', + 'f9128264-8372-423d-9f86-dc85bc02cc06', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:40 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_default_audience_should_work.js b/sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_default_audience_should_work.js new file mode 100644 index 000000000000..e781f44a9d4d --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/appendblobclient_nodejs_only/recording_default_audience_should_work.js @@ -0,0 +1,231 @@ +let nock = require('nock'); + +module.exports.hash = "9dbfdeaebb563bef6b12e1a7201b3644"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708257775407657","blob":"blob169708257843106749"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708257775407657') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:39 GMT', + 'ETag', + '"0x8DBCAD6429A4DA7"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a26de1-f01e-0036-25bf-fc1e51000000', + 'x-ms-client-request-id', + '00f0925c-6c39-49b6-becf-c34a4cfcd11a', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:38 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708257775407657/blob169708257843106749') + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:39 GMT', + 'ETag', + '"0x8DBCAD642AFA2FB"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a26e4d-f01e-0036-0cbf-fc1e51000000', + 'x-ms-client-request-id', + '730ad1e1-346f-420a-9713-d52a943c5b34', + 'x-ms-version', + '2023-08-03', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-version-id', + '2023-10-12T03:49:39.3686015Z', + 'Date', + 'Thu, 12 Oct 2023 03:49:38 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fa698571-3a4d-43ac-8b45-cc95bb617700', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-S8XeSzTO-zPd8f-RT9bk4g' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvsyPIR0ZCJMuLqbw5tmxt0; expires=Sat, 11-Nov-2023 03:49:39 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPG1t6QhXwxw67oLVzrWFOvbm-ouxmWz-1qrfogaNjurlaB-DZYGsrYjYYo3bpH-8VS9g_TD9Ifk3yghcExnJ-O5VvAWs4mjDHyNyT0JvpZyhp_106PBiaE6asgbu_hIgRBZNIyhlP9HnyKLmhp6Fj-HLAbUnOY49C8qaiBOfJZTcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:39 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '49e7c5ab-9f74-4bfa-b280-f346ea330e00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgJMxZjS6BxHg39NGnlV2SQ; expires=Sat, 11-Nov-2023 03:49:39 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPRSs5fAq4jFZpjK6mG7TlpTwysjs6Tst7O58dURzeXKKMH6Uo-6Ye_o3AnkeRcCcYAq_RtovJ3VQLcIuoWBPYCt_3OVjDwoKE0YQLej37ljW84ACxUJPeeMGaxjMZ2vdww4TLWSem5bKkGwKf6MFvrESRHv_h9HxqVNltemBfoAUgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:39 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=f8a14b58-e9df-45fc-8cd7-7b5166f79ba1&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'ff6bc074-d15d-45fb-8470-4a951beb1d00', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-B0GAmdF4_NjREB78eHMTJg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AkqQu507akxBi0WveNyJiW_eeSdeAQAAANNjudwOAAAA; expires=Sat, 11-Nov-2023 03:49:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:39 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708257775407657/blob169708257843106749') + .reply(200, "", [ + 'Content-Length', + '0', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:39 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAD642AFA2FB"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a270ca-f01e-0036-75bf-fc1e51000000', + 'x-ms-client-request-id', + '09541ab8-3062-4b25-b42a-cf2573218290', + 'x-ms-version', + '2023-08-03', + 'x-ms-version-id', + '2023-10-12T03:49:39.3686015Z', + 'x-ms-is-current-version', + 'true', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 03:49:39 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'AppendBlob', + 'x-ms-blob-committed-block-count', + '0', + 'x-ms-server-encrypted', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-blob-committed-block-count,x-ms-server-encrypted,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:39 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708257775407657') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27143-f01e-0036-6cbf-fc1e51000000', + 'x-ms-client-request-id', + 'ca3f10b6-56af-4108-a82b-47992f0232f3', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:39 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_bearer_token_challenge_should_work.js b/sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..c886826a10b5 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_bearer_token_challenge_should_work.js @@ -0,0 +1,370 @@ +let nock = require('nock'); + +module.exports.hash = "bd4494ec6d94df324ba54680a1b214cd"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0dfe5555-fda6-416e-9aea-d3a45ee71e00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AnR19XtHmfdChpWOi0-AZIM; expires=Sat, 11-Nov-2023 03:49:45 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPQlQ4hOmuLK4LBL_jzGKCUcozaHvwAUZgL9rRKcfsq24eg_3TiALtY5uCsyinvZz4o27fjGnYRiLz0MFfZkqD-KeDATrCAOutMhnFZ3eTTbiudJTWNZHDOfPiTybLd6zZC0huczXjOK4rwunjsMeVVjHCXMtjEckytkHffWAwXjogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:44 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'c5ecb3cd-12c6-4dd9-9a71-b6af085a8500', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-4EHIWk3M-fS2A9u7x1B51Q' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ar7Vsjo2czpBh1CNj7HM2Jo; expires=Sat, 11-Nov-2023 03:49:45 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPmAC2OBfHr64L77DXNtah5z0YeOCir9dwrwK0Y9-KU-bBcGKxWvMNGH3tTLFgdncqZkz7UebtnfgX5iezp0Y82yqf1Hii8hx3czDv0nzXXYChG1wCKSgdO6Fr6HstOXMWtn8kxS741oYI0JR36bpzjjHoLIENtvRiMOW_sU_emksgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:44 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=f6b5f12b-fba6-4dd4-a6b2-24567303f131&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'd46c7940-91af-4b3b-a132-81f7bedb1c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AmE9c1zeVfxMqX5UkR58LCut-wbLAQAAANljudwOAAAA; expires=Sat, 11-Nov-2023 03:49:45 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:45 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:58a27f7b-f01e-0036-7abf-fc1e51000000\nTime:2023-10-12T03:49:45.5082354ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27f7b-f01e-0036-7abf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:44 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:58a27fe9-f01e-0036-5ebf-fc1e51000000\nTime:2023-10-12T03:49:45.6121776ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27fe9-f01e-0036-5ebf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:44 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fa698571-3a4d-43ac-8b45-cc9544627700', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-SH2zp1qE49U2jZyeCmxPfQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AotElbogCf9HnE8JN1dgFRg; expires=Sat, 11-Nov-2023 03:49:45 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPWA_XC1vkOzcu8RP-9gSQtFQZRBusOQTQt5oa8YuWvkb1rtMbQcI90iVsghiqAyEtCdW_aoWvoOs8ae66zgha8HE3osez8RAhQxdXxObmTlC7BVrObpTZdu7uy3x0m9Itr62bWpbXJbvav3zeQeGrxKQuI3SxxUOFsCKe5IA8-H8gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:45 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '593924ce-c021-4ad7-9112-05c171061900', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApTz8ZVYWpFGmpPjwqKk4WE; expires=Sat, 11-Nov-2023 03:49:45 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPG7oVznL8_vmeOfS-Vcy1jWuYJemS-go7bWTLIJqSQRJir1IznDcVtf8WcG6l58qFDaqOBFmAtF-aJ63o1XDiZMv6Idb_AKSmJzZHYCEFIUB-ymMwtxUFnrbTP85kQMo2_5_JlFGcdu1G8LJs7E-pxB1k73N0FmwQ1ttK4j4oYNEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:45 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=1198fe45-9ae7-4c2e-8cd3-5b713cfac13c&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-2064d9120600', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-MDRGweg-q7eN_8deLF_5Zw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AjIXY2beAspHv2SRnREJ05yt-wbLAQAAANpjudwOAAAA; expires=Sat, 11-Nov-2023 03:49:46 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:45 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:58a281f7-f01e-0036-5ebf-fc1e51000000\nTime:2023-10-12T03:49:46.2398207ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a281f7-f01e-0036-5ebf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:45 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=7b8eb891-8d8c-4235-af2c-562ce78784e1&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '3d4fca17-ef71-46b2-bac4-ab00dd242d00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-9irizlKN8I1ay6EwSdMT0Q' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ai_s4MlXR3NOrUbJspEMkmveeSdeAQAAANljudwOAAAA; expires=Sat, 11-Nov-2023 03:49:46 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:46 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(200, "1.0truetruetruetrue51.0truetruetrue31.0truetruetrue4GET,DELETE,HEAD,MERGE,POST,OPTIONS,PUT,PATCH***86400GETexample.com**8888GETexample.com**8888GETexample.com**8888GETexample.com**8888true7falsetrueerror/404.htmlindex.html", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28376-f01e-0036-3ebf-fc1e51000000', + 'x-ms-client-request-id', + 'cfd52a52-252b-483e-845f-26e4c78e4303', + 'x-ms-version', + '2023-08-03', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:46 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_customized_audience_should_work.js b/sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_customized_audience_should_work.js new file mode 100644 index 000000000000..7644e305ad61 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_customized_audience_should_work.js @@ -0,0 +1,145 @@ +let nock = require('nock'); + +module.exports.hash = "ee9d75389199c51fb63980ab1ed670f6"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-2064ab120600', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-Q1qULxC1h67KFkFzReoi_g' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AuhNqCjE-bdGvau7o0mLG4g; expires=Sat, 11-Nov-2023 03:49:44 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPKWPNic9-2PQ47QyZJgXhLML8BdOe01Nrku69BNcZiICbdhMCk7XXzDNF_7RaKxKqqIxRhdWE_-vIzG-OWB_OR8p8QxWH8gIuI9aMQAeCKVqLF17Kl_mha-osVKjqCVctILUFr84aMEkuh-rWB83s3L2sNnV_e6dc0y_pDKyEFtUgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:44 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-26887cca0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AiMkZcdgOPtJhK_PistApzQ; expires=Sat, 11-Nov-2023 03:49:44 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPlhsqI_s6_A_ruo2BJPLeuL2DaFSHBI7tYK0ubtwzuo2mKy-sAlReOUwB754J0GNufkaWxJfkLUJ45bZjJIVqBfB5GswGMZzwvoPozAfQApcNW9B1J4cNqOSMN0rmTvU2JfUSNmeKE2tEHMAlOYEock4478DtTcbU9eUvvPLnVUcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:44 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=e1cb65b7-6faa-4f67-b0e4-2b1625dfd564&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-2064b3120600', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-JZNNlGcb7BEPYudZ5G1E7Q' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Au4ReJmQB15Eq6KfwYYqMFgaUecJAQAAANhjudwOAAAA; expires=Sat, 11-Nov-2023 03:49:44 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:44 GMT', + 'Content-Length', + '1337' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(200, "1.0truetruetruetrue51.0truetruetrue31.0truetruetrue4GET,DELETE,HEAD,MERGE,POST,OPTIONS,PUT,PATCH***86400GETexample.com**8888GETexample.com**8888GETexample.com**8888GETexample.com**8888true7falsetrueerror/404.htmlindex.html", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27de7-f01e-0036-02bf-fc1e51000000', + 'x-ms-client-request-id', + '1845fba0-03ed-4162-8509-c0324056ff1c', + 'x-ms-version', + '2023-08-03', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:44 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_default_audience_should_work.js b/sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_default_audience_should_work.js new file mode 100644 index 000000000000..32be6727ec09 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/blobserviceclient_nodejs_only/recording_default_audience_should_work.js @@ -0,0 +1,141 @@ +let nock = require('nock'); + +module.exports.hash = "873c7d2672e37f50592656ce9f504f7c"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-26886fca0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApM1XWj7zh9CrVyTfdJBpR4; expires=Sat, 11-Nov-2023 03:49:43 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPffm0qks6Jprm6n0aMMcKFwK4a6oBkU6crPRB32AARtmd9j59qdsnxCIRz8wqO3yubvudMih8kC3_NddHdy_JMKTsn4ef9osHraL5ZUeca04GKX9ir2WAlTuk4cMCzv7k0ni3SPP9bhIurOv-b3SMJykEE_3hGoPcaaQSWoFY1-UgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:43 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0dfe5555-fda6-416e-9aea-d3a44ee71e00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgttWpW8H75MrYPoHbfM2SA; expires=Sat, 11-Nov-2023 03:49:43 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPKLsm2uNq-5gKnYF2yLWsQvXNKnInOfsn332jErrM3CfBM2VZf_pEkvpXzJbTPU9c9wmUdh5RzNCfCLwNXWLrE2PzHEyqalP1F9hESrMVUCLCnqYZ-68HJmHLRacj6OwEcQs6C1bzabcFqEQh0XNQekaL95Yspc7Qwm-BuMVbeskgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:43 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=f0843114-5ac0-46b9-ba9f-e36323cb804f&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-268873ca0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AsPjNjUBFTxEv5sZB_sie83eeSdeAQAAANdjudwOAAAA; expires=Sat, 11-Nov-2023 03:49:44 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:43 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(200, "1.0truetruetruetrue51.0truetruetrue31.0truetruetrue4GET,DELETE,HEAD,MERGE,POST,OPTIONS,PUT,PATCH***86400GETexample.com**8888GETexample.com**8888GETexample.com**8888GETexample.com**8888true7falsetrueerror/404.htmlindex.html", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a27c8e-f01e-0036-37bf-fc1e51000000', + 'x-ms-client-request-id', + 'b33fed40-0852-432f-a6ea-4483d02de19d', + 'x-ms-version', + '2023-08-03', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:43 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js b/sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..e19c668c96f0 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js @@ -0,0 +1,455 @@ +let nock = require('nock'); + +module.exports.hash = "c050c4cf6eeceb3010c278f20d9d242d"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708258785003838","blob":"blob169708258796104526"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708258785003838') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'ETag', + '"0x8DBCAD6484C10B8"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28868-f01e-0036-7cbf-fc1e51000000', + 'x-ms-client-request-id', + 'b71830df-b1d1-4638-89f4-72b0514dc36a', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:48 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708258785003838/blob169708258796104526', "Hello") + .reply(201, "", [ + 'Content-Length', + '0', + 'Content-MD5', + 'ixqZU8RhEpaoJ6v4xHgE1w==', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'ETag', + '"0x8DBCAD6485D6EC3"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a288ba-f01e-0036-4cbf-fc1e51000000', + 'x-ms-client-request-id', + 'c70b2b07-ddf2-4de1-8853-5661452cfe95', + 'x-ms-version', + '2023-08-03', + 'x-ms-content-crc64', + '7YooR2vuA24=', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-version-id', + '2023-10-12T03:49:48.8952003Z', + 'Date', + 'Thu, 12 Oct 2023 03:49:48 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '3d4fca17-ef71-46b2-bac4-ab001a252d00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce--LXHcnwtx7vA1tod0NBGBg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgHdW0oUGLJJmMMna0y0b6Q; expires=Sat, 11-Nov-2023 03:49:49 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPUnhY1X6Y6XWxaUT4a1-uNNwU38j9JAb_byTCpN6FGQkwmrLnKARGViq5PdGuKyHbvyormnm75ouN9dUSGqNbz8gXgdo11Mti_z84sEaADSCyvYP6YNYyDw85pSJ33pjzvftuw_RxotHdedYTSxrshBqm3xVMd68VQroiA2j2m7ogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'd46c7940-91af-4b3b-a132-81f704dc1c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AlZPv3pWY_ZCqEW8XMyoXo0; expires=Sat, 11-Nov-2023 03:49:49 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPtQUs2JCldx6XGjA7wheD7sxnawcdPgg1rhVqvLEVE4ftWILbqN73ZxWrMQcEXwRWS4FtjkrC59Q-QK1lvfgAXIIR7HsVdZylP3bUWTlNTEw7WasWcPsdkLhDHicDHQPlO9o6tlvo2QwZwFEEyU7rYr7S41uoh9R-8uQ6jpIkD-EgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=88abeeb3-6799-4e84-b129-875adec6f797&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '3d4fca17-ef71-46b2-bac4-ab001e252d00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-i9C94DHLkSKVwGB_CN3uxw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AlZXsy7enDFNtldFQadjmc6t-wbLAQAAANxjudwOAAAA; expires=Sat, 11-Nov-2023 03:49:49 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:49 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708258785003838/blob169708258796104526') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28b03-f01e-0036-7ebf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:49 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708258785003838/blob169708258796104526') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28b3c-f01e-0036-32bf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:49 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fa698571-3a4d-43ac-8b45-cc9599627700', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-O_7-U5l739Uy4rkzyQPs8Q' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AhSAgRPOOcBKjfezfV6nN2I; expires=Sat, 11-Nov-2023 03:49:49 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPai__dAwhtafBww7ikwlDl_hbizekD-j7wym3VTDGQOrjukwJ4uAY16k5sZsSZqItz52bPNqVZ44teTgcPYhmlj0oeBg-K3Ube4fKgaee6SWVQFUFbAYS-DnzoVg88z_c-aQuRBoVRvUvW0k5ib4S6U6kHVExLhLN_P9x_7B-LU0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:49 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'f99dcba1-b28d-4c1a-8718-e2fb50191600', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AlmezX1lmGVOtG1kvjdW-2Y; expires=Sat, 11-Nov-2023 03:49:50 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPdg8llN7ryI-P65Cvmr9vmRQfpVNlawEZysY-FivR7jxLiyR7irPJ_R85Bg8nQLIktEt0PrNq5HKq3W2SsvzGA4EMOPXkg-hDNG8IznsG8uoikjQqGyIET7LAc_x8w_69BzRpv099iA4eeNrDeiaSMwGhgyQn47cYy0i9kKiIGFsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:49 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=f1d71ed0-12b1-4eca-9e43-46aa58986c9e&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-2688e5ca0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AsgrJ1SbIEhGvCzkWnAOZa2t-wbLAQAAAN1judwOAAAA; expires=Sat, 11-Nov-2023 03:49:50 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:50 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708258785003838/blob169708258796104526') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28cdf-f01e-0036-49bf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:49 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=ea96881c-a704-4dbd-9517-2aee5355ae95&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-20644e130600', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-zsIBatZrEdD-Pv1Jh_hmTQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aqhza6hPT2NKiomTpChPn67eeSdeAQAAAN5judwOAAAA; expires=Sat, 11-Nov-2023 03:49:50 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:50 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708258785003838/blob169708258796104526') + .reply(200, "", [ + 'Content-Length', + '5', + 'Content-Type', + 'application/octet-stream', + 'Content-MD5', + 'ixqZU8RhEpaoJ6v4xHgE1w==', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAD6485D6EC3"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28e23-f01e-0036-7dbf-fc1e51000000', + 'x-ms-client-request-id', + 'e73aa707-a442-4395-8a0e-2a3f46cdad62', + 'x-ms-version', + '2023-08-03', + 'x-ms-version-id', + '2023-10-12T03:49:48.8952003Z', + 'x-ms-is-current-version', + 'true', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:50 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708258785003838') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28e52-f01e-0036-2cbf-fc1e51000000', + 'x-ms-client-request-id', + '7814cc2d-05f3-4dd2-831c-25343b13f9bb', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:50 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_customized_audience_should_work.js b/sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_customized_audience_should_work.js new file mode 100644 index 000000000000..f4e043e2a780 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_customized_audience_should_work.js @@ -0,0 +1,239 @@ +let nock = require('nock'); + +module.exports.hash = "3b0e2979b8d73a030a609995367ddcba"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708258695009246","blob":"blob169708258706602844"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708258695009246') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:47 GMT', + 'ETag', + '"0x8DBCAD647C2A959"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a285f1-f01e-0036-17bf-fc1e51000000', + 'x-ms-client-request-id', + 'e7713c2e-a7e1-4f95-80eb-50f2fa8d7865', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:47 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708258695009246/blob169708258706602844', "Hello") + .reply(201, "", [ + 'Content-Length', + '0', + 'Content-MD5', + 'ixqZU8RhEpaoJ6v4xHgE1w==', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'ETag', + '"0x8DBCAD647D4F1A6"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28651-f01e-0036-72bf-fc1e51000000', + 'x-ms-client-request-id', + '68926042-7f44-442f-8f45-6b76d8a42cc7', + 'x-ms-version', + '2023-08-03', + 'x-ms-content-crc64', + '7YooR2vuA24=', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-version-id', + '2023-10-12T03:49:48.0007078Z', + 'Date', + 'Thu, 12 Oct 2023 03:49:47 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-206415130600', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-RPoFyJHJl1erF1ahVyCBbQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=As01IgAeKHpCuL36urYNJ5k; expires=Sat, 11-Nov-2023 03:49:48 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPgL5olnOUQxQ8WMz6-kVmEuNjyaeUqwsKjMYa-bSrcq3LbiqO2pDUp3nUYqCtkHuEADEQyhmtPO_NscqfHvc0ngWKN1JJU2MChA87t7lC3Hlv33kTwxIdZr2BZLi_mIED157nvXmL6QIBGxUnzRsYCcV2v8F7IZNBrrdxEpCR5iAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:47 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-206418130600', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-hhW9-QImncnINxZG-ZCQDg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ah66BUoscelBrXectjUKMX8; expires=Sat, 11-Nov-2023 03:49:48 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPyUAvS_soyXOdUgWNwux6UBj9NEzvKduggaOHr3CM2PmTWmNo1_Hg2A3kWTRxDtJf3UXI6HlpmoOkP-ENT41fwPXrz96q38J2Y5UnAJUzvXsnGSpxhgLV9W4R-hrvuT32Dfz_4EQqRUZHSpGxJ1gOmkH33dyP6_a0aQhyDe6KYNEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=1a5ed6e5-eedf-42d9-82cc-ee0abd2788f4&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '49e7c5ab-9f74-4bfa-b280-f34680340e00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ArI5RibDgbNBgi3guWFhBVkaUecJAQAAANtjudwOAAAA; expires=Sat, 11-Nov-2023 03:49:48 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'Content-Length', + '1337' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708258695009246/blob169708258706602844') + .reply(200, "", [ + 'Content-Length', + '5', + 'Content-Type', + 'application/octet-stream', + 'Content-MD5', + 'ixqZU8RhEpaoJ6v4xHgE1w==', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAD647D4F1A6"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a287b9-f01e-0036-52bf-fc1e51000000', + 'x-ms-client-request-id', + '69dd2cbe-1c95-4632-81e2-7a042529a81d', + 'x-ms-version', + '2023-08-03', + 'x-ms-version-id', + '2023-10-12T03:49:48.0007078Z', + 'x-ms-is-current-version', + 'true', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 03:49:48 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:47 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708258695009246') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a2880d-f01e-0036-22bf-fc1e51000000', + 'x-ms-client-request-id', + '787f0d33-0c6a-4831-bb61-0b284f99a525', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:48 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_default_audience_should_work.js b/sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_default_audience_should_work.js new file mode 100644 index 000000000000..a2febe8af210 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/blockblobclient_nodejs_only/recording_default_audience_should_work.js @@ -0,0 +1,241 @@ +let nock = require('nock'); + +module.exports.hash = "3442d192c2bc4d26b635f626037e7e57"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708258601603689","blob":"blob169708258612600949"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708258601603689') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:46 GMT', + 'ETag', + '"0x8DBCAD647343995"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a283bd-f01e-0036-80bf-fc1e51000000', + 'x-ms-client-request-id', + '66f8f6ef-3d34-41a0-ab5a-f8ec4d44b549', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:46 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708258601603689/blob169708258612600949', "Hello") + .reply(201, "", [ + 'Content-Length', + '0', + 'Content-MD5', + 'ixqZU8RhEpaoJ6v4xHgE1w==', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:47 GMT', + 'ETag', + '"0x8DBCAD64745E5CD"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28414-f01e-0036-54bf-fc1e51000000', + 'x-ms-client-request-id', + '516ff999-b2ab-444f-bd8f-89b9fa12d192', + 'x-ms-version', + '2023-08-03', + 'x-ms-content-crc64', + '7YooR2vuA24=', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-version-id', + '2023-10-12T03:49:47.0632397Z', + 'Date', + 'Thu, 12 Oct 2023 03:49:46 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6718ab0f-fe99-408d-b5a0-9d816e031100', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-ra5GTphRoWTv_UJSTft0gw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AlI5ziEbluBIgcDTxK9ktC8; expires=Sat, 11-Nov-2023 03:49:47 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPE0h-enfUKSiRywFwDEc1wAkC4nt4JJfnqt32pXHUAGbBTluQTmGWw-UMeNlHeoH3KWxX6JFl_fSmUGFUqWGVBrPvnl8-HcmUuIEW7maz99wxCB2s1473jsUl-J-6wS_jfw_awy7oxEWul9c1jP2whRF61y_OXzKuaL2fnsM7HVIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:46 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'ff6bc074-d15d-45fb-8470-4a9578eb1d00', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-mzPL2qvEu5ML-xEsIfkWig' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AhiowNNGRYRJnLuLKJ8gWqg; expires=Sat, 11-Nov-2023 03:49:47 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPzODk1n4vYxWdVcyYHNEZF8x0y0O93dsUMb8rcCaLNedxV3gM3TFGCOS7yK_PVYMuWCtdwP1jQ46qpZ6XwHNEBjRJgHiHBXbiGvgAb1c7KWraCVjebPI7s8sDPEF0u1AF8wusOTfmFT8jCGBFx1ldktu6VatLHF12vrSLV-AmZVcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:47 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=b43d0c2b-7dfb-493b-8d3e-51d9ed31d6c8&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6718ab0f-fe99-408d-b5a0-9d8176031100', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-5KizBHbQ1Mc8x_eIUwYgyA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvqOW1H2E_1EkTIWJ2vgECo; expires=Sat, 11-Nov-2023 03:49:47 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:47 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708258601603689/blob169708258612600949') + .reply(200, "", [ + 'Content-Length', + '5', + 'Content-Type', + 'application/octet-stream', + 'Content-MD5', + 'ixqZU8RhEpaoJ6v4xHgE1w==', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:47 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAD64745E5CD"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a2855a-f01e-0036-06bf-fc1e51000000', + 'x-ms-client-request-id', + 'ae377f4c-eec4-4101-ad5b-7be8ffd4bc47', + 'x-ms-version', + '2023-08-03', + 'x-ms-version-id', + '2023-10-12T03:49:47.0632397Z', + 'x-ms-is-current-version', + 'true', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 03:49:47 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,Content-MD5,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:47 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708258601603689') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a285a2-f01e-0036-4bbf-fc1e51000000', + 'x-ms-client-request-id', + '9f01b8e0-14c2-45ab-a556-91d77ad6a1a5', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:47 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_bearer_token_challenge_should_work.js b/sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..73f7923490e8 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_bearer_token_challenge_should_work.js @@ -0,0 +1,424 @@ +let nock = require('nock'); + +module.exports.hash = "7e7f96e40512c33e8a410a61c3bbc8b6"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708259167909896"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708259167909896') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:52 GMT', + 'ETag', + '"0x8DBCAD64A94255B"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29340-f01e-0036-74bf-fc1e51000000', + 'x-ms-client-request-id', + 'bd567659-d6de-4de2-8d5d-63e219984418', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:51 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '478fe5d4-c66b-4434-a25e-cf09676a0200', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-DAV0D9zhm36fgoHC7r5Kgg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AqdnzNIZXJNMgKm7rh_I-Ag; expires=Sat, 11-Nov-2023 03:49:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPfypeTBD6nw9u0wuIGTnrayxbC6YT9oJqzZfS7W_t9fW-2qkbAghEeCE9YBhD5qrwuyD0CvSs1goD01YpFSzrMmn2l25O5syLx4BJUjWT17iHJ7o-CkoH0HXVwDQwxKE7Y23oyhZFSt4CaSXBaBHtXop2zdWHErrivgoOmTTQNMogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:52 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '49e7c5ab-9f74-4bfa-b280-f346c6340e00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvecjO-dC_xKjMzVfMo8zYM; expires=Sat, 11-Nov-2023 03:49:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP5vg6Eq2uSv9QgC5lEfyFRsLBMb6b_AfB7LNtXMrnMcjJYHnHDSRZhvslW0friPy3eVWHTENFVlmXisqWphnpjHntoij71PMF9ULQ_utwl0S-RlCITxprswy76caBlDPViAKml1LBXv5FSmKMkx2_l5p24QAIJxA2JZeBkZ7_6xAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:52 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=0eee4afe-a11e-4e73-a365-6a3d0555a5d4&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-268816cb0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AnT3DmiZ6kBBjFSHhqlyfI0; expires=Sat, 11-Nov-2023 03:49:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:52 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/container169708259167909896') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:58a294aa-f01e-0036-4abf-fc1e51000000\nTime:2023-10-12T03:49:53.0959381ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a294aa-f01e-0036-4abf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:52 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/container169708259167909896') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:58a294f7-f01e-0036-0fbf-fc1e51000000\nTime:2023-10-12T03:49:53.1988803ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a294f7-f01e-0036-0fbf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:52 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'ff6bc074-d15d-45fb-8470-4a95caeb1d00', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-UOMEF2IlOcrhRDaIvLbBTg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AraKvft66S1LpSZFQ6U8CQ4; expires=Sat, 11-Nov-2023 03:49:53 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP4hWI1BVNxofxpinPonjgldrQ7UO_j1dqONtkQwAimAb_lFJ40u6AsiAYJBfUAgyGu08w-Pc8Pa1PAYfksflTBJxbREfA_pE4w0-oBSZyytnqsAdAhqgXduzgaiuJ2smSm8rR5qLDhtS0KhkbQOPe4EzE8HWzDQaYFwXmBXMrVHsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:53 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'c5ecb3cd-12c6-4dd9-9a71-b6afe45a8500', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-X-JhfRDFCm48xrjfG3DCAg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ArouoCN23WNErAuYdFHURJs; expires=Sat, 11-Nov-2023 03:49:53 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP2uqz9LfKLw31xPfT99ug8DwwVXzJlQOBeWThvSkgD-umXVaXKjXYSRRwqh18aOtpX-1-NIHUXihqmiZ87WMiMm7NGgAv2kg1cS6OxMXXDe-SYaEw7ShjN2fcUe0zrrJ3iwk6kIIKbFvf3hqH0vr21_tibsyHL9UhvdM2MCFHEA4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:53 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=331326a8-e427-4276-acbe-910571e022b9&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '49e7c5ab-9f74-4bfa-b280-f346d1340e00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Auq8mn7rprRGtI9Z45SlsuI; expires=Sat, 11-Nov-2023 03:49:53 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:53 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/container169708259167909896') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:58a29651-f01e-0036-4abf-fc1e51000000\nTime:2023-10-12T03:49:53.6826053ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29651-f01e-0036-4abf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:53 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=6e4ea3b9-4325-4e97-98e1-d801624ce937&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-26882acb0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aio-Ea4LO2BNiUoGlK-H7yo; expires=Sat, 11-Nov-2023 03:49:53 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:53 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/container169708259167909896') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:52 GMT', + 'ETag', + '"0x8DBCAD64A94255B"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29710-f01e-0036-7ebf-fc1e51000000', + 'x-ms-client-request-id', + '618999ca-38cb-46e3-9d82-b240e0f8aad7', + 'x-ms-version', + '2023-08-03', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-immutable-storage-with-versioning-enabled', + 'false', + 'x-ms-default-encryption-scope', + '$account-encryption-key', + 'x-ms-deny-encryption-scope-override', + 'false', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-immutable-storage-with-versioning-enabled,x-ms-default-encryption-scope,x-ms-deny-encryption-scope-override,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:53 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708259167909896') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a2974e-f01e-0036-37bf-fc1e51000000', + 'x-ms-client-request-id', + '43fbb197-e3b9-4982-a339-cec08ec3be66', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:53 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_customized_audience_should_work.js b/sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_customized_audience_should_work.js new file mode 100644 index 000000000000..7da75a6c9148 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_customized_audience_should_work.js @@ -0,0 +1,197 @@ +let nock = require('nock'); + +module.exports.hash = "992f95f8755be72aff08ce0ca6572472"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708259094503618"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708259094503618') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:51 GMT', + 'ETag', + '"0x8DBCAD64A245CC9"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29085-f01e-0036-48bf-fc1e51000000', + 'x-ms-client-request-id', + '09b1dc53-87e3-4d86-b13d-8705f9ceb4a4', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:51 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0dfe5555-fda6-416e-9aea-d3a4a7e71e00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AtecTonrtABLlKxRSFK-ruU; expires=Sat, 11-Nov-2023 03:49:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPZKYCnyWO7fxZbJxXtLuFpFRsLdLIfHNiF5jLlhYFkqIxaWAM8gUROtGlzy7B8iQdpE4vW8tl_3eZfAlJFjo6Ou6MJNMq_DTWWXtdBE7RmtsXrIznWo7x38lDc34qwy-e6lht_wFPu2wl2WLKJZiM-JERvG3Pqq07ho5T4Mlh3EIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:51 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'f99dcba1-b28d-4c1a-8718-e2fb63191600', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AhL_VAVHTuxIokmq9-ZHiOo; expires=Sat, 11-Nov-2023 03:49:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP5izaJGtE8rYTcaS92pH4FVz55W0a4WnN7NXdJ7FkbxBUf5gGlMnR0rn4Vxt5J36GNrLIrHWNcNNVFmFUppb5zl0yFEQAg6l7zadvx29rdHDYm8px0Ty2Jhu0Cfhh5MQchZ8vo2x22eA3zkRi8fIdq4Lt1HRDgzLp_aA01B9W28wgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:51 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=839f53cd-f87a-43eb-ae4a-682c2f34e7e6&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-26880dcb0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ArFWFQByJnFKtEWaNDxUn2w; expires=Sat, 11-Nov-2023 03:49:52 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:52 GMT', + 'Content-Length', + '1337' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/container169708259094503618') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:51 GMT', + 'ETag', + '"0x8DBCAD64A245CC9"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a2925c-f01e-0036-1ebf-fc1e51000000', + 'x-ms-client-request-id', + '66fc003a-116d-437e-84b2-43d05fc9c006', + 'x-ms-version', + '2023-08-03', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-immutable-storage-with-versioning-enabled', + 'false', + 'x-ms-default-encryption-scope', + '$account-encryption-key', + 'x-ms-deny-encryption-scope-override', + 'false', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-immutable-storage-with-versioning-enabled,x-ms-default-encryption-scope,x-ms-deny-encryption-scope-override,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:51 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708259094503618') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a292c7-f01e-0036-80bf-fc1e51000000', + 'x-ms-client-request-id', + 'fb764369-b84d-4cfc-a5ea-5ebad61330bd', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:51 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_default_audience_should_work.js b/sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_default_audience_should_work.js new file mode 100644 index 000000000000..6089e01e9aa4 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/containerclient_nodejs_only/recording_default_audience_should_work.js @@ -0,0 +1,199 @@ +let nock = require('nock'); + +module.exports.hash = "f5f84c68b3bddf3cc7e0c63d92058b35"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708259014901102"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708259014901102') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:51 GMT', + 'ETag', + '"0x8DBCAD649AAD1A0"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28e9c-f01e-0036-75bf-fc1e51000000', + 'x-ms-client-request-id', + 'fce5a47a-d40d-4a61-836d-c6a905c6ef23', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:50 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-2688f9ca0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AibLKqkgs65Muh0VbpR8xfA; expires=Sat, 11-Nov-2023 03:49:51 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPmkf4_6f2uE5xGxHPBGOiFH7WZ8qgGd_RMLQ-a_ms5QmwoWK7d6fx3r3GE61iSj53YDaCeZ5SChkvyO_fz84LJftMgTOqJwJRsAbJ1FCh0TcShQ1MegJJGxJuJc2netO5CzcHEH_uYTh2h9nts_ZlFBRvHLGDBjGM-43ULgRR7dUgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:50 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0dfe5555-fda6-416e-9aea-d3a4a2e71e00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgHC3Hfar5lGo2BJZ9lxQEI; expires=Sat, 11-Nov-2023 03:49:51 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPTGEPx4MyfQ9082COi5efja3ZBM425YPwRaz39LcTQST6ga8CjO7IHN0QZXDG4gHS5qFqYllbvUfAtRujUNKBo6_R_5DJDB6zbEXg46KRpezPOza1Y45n_GGtqpwz5lYWUhyCjdE-BvmQljWLG9sl_ozEGos_6M-VyubPGqk2dQkgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:51 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=132cc307-a583-4037-8dba-d06c6028a834&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-206468130600', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-cEDBeEMrre6FtlM_WHXJtg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AjE_wpifX4FIuopG08Mbqxo; expires=Sat, 11-Nov-2023 03:49:51 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:51 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/container169708259014901102') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:51 GMT', + 'ETag', + '"0x8DBCAD649AAD1A0"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a28fce-f01e-0036-16bf-fc1e51000000', + 'x-ms-client-request-id', + 'b5990f82-c17f-40d6-8e81-6786ac8d2659', + 'x-ms-version', + '2023-08-03', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-immutable-storage-with-versioning-enabled', + 'false', + 'x-ms-default-encryption-scope', + '$account-encryption-key', + 'x-ms-deny-encryption-scope-override', + 'false', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-immutable-storage-with-versioning-enabled,x-ms-default-encryption-scope,x-ms-deny-encryption-scope-override,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:51 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708259014901102') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29036-f01e-0036-7bbf-fc1e51000000', + 'x-ms-client-request-id', + '604b48a4-8bd2-4001-a466-5e6743b3aa69', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:51 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js b/sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..f93ee85b4d91 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_bearer_token_challenge_should_work.js @@ -0,0 +1,449 @@ +let nock = require('nock'); + +module.exports.hash = "3bda1889bc5642768b4dfba8c91376ee"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708259489702170","blob":"blob169708259500804451"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708259489702170') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'ETag', + '"0x8DBCAD64C7F5A77"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29b25-f01e-0036-06bf-fc1e51000000', + 'x-ms-client-request-id', + '080971ed-d3d6-438b-9914-5391d3d3f6d9', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:55 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708259489702170/blob169708259500804451') + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'ETag', + '"0x8DBCAD64C910672"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29b55-f01e-0036-31bf-fc1e51000000', + 'x-ms-client-request-id', + '82726524-e420-463d-b98b-5fcf7424db26', + 'x-ms-version', + '2023-08-03', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-version-id', + '2023-10-12T03:49:55.9442034Z', + 'Date', + 'Thu, 12 Oct 2023 03:49:55 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '49e7c5ab-9f74-4bfa-b280-f346f6340e00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AsEIC8XJq7JMjZRsK3-7bWM; expires=Sat, 11-Nov-2023 03:49:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPxq3QdseCK9fsVdHCuCw6L7c4A3ewg52w61qYZyUbLjNgz5uZFeNYfkUsikTPWHtGo7ISADRmnQcX6Ng_RlHFANLyZSqRtiYcLioSoADC4XR6GpoSpLoM5QNMsqUpSfZ-GORBOsZZQC1ZmGAKwXmprITfi0PWskwY5cWDSWWzuEogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'ff6bc074-d15d-45fb-8470-4a95e5eb1d00', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-mgMf1IFlKTuFnZ7TvPE41A' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApGtDI1JJrtJlf8GmqU3iQg; expires=Sat, 11-Nov-2023 03:49:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPrvLccDFlp_s36P2m51YD5rgIies5R-oGpt14ogk4DLLMDQO2q3noQ6DN2GvhHsMCjDFuU3EO66xRBHkJ505awYaDLPV9ONkuZF9CREGZPtSDJ_3YpuYgBjzVvChN7PxMlTuUm5hoTvS-AG0g08lSV_6lmpVeepkdKu-E1sXP_ckgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=f01e69f7-32e6-4d55-810d-20dbca1c38d2&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '593924ce-c021-4ad7-9112-05c121071900', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AhHV_dyQr35Epsocvd66ac4; expires=Sat, 11-Nov-2023 03:49:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:56 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708259489702170/blob169708259500804451') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29bdf-f01e-0036-28bf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:55 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708259489702170/blob169708259500804451') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29c0d-f01e-0036-51bf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:55 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'ff6bc074-d15d-45fb-8470-4a95f0eb1d00', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-u1G5LzgyEqJevkW9K8uroA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ao2MRvVSt9VIibJmVqfaVCk; expires=Sat, 11-Nov-2023 03:49:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPXzIJXIssTCx14chZBy6pd8knWixpiZs_V3O0Mh4IQ1lFccYn032WhShXJonlv2gWM5h-Oox-yaeEYnADq3wp1kUYHtefZlq0RgXf65qARgP1Pkf18oEWZJYmURfy0PBNfVD6BDyWP572agv5g5_7XnCjjqBWT4kPltYKtJpyjecgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:56 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fa698571-3a4d-43ac-8b45-cc952f637700', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-lY-wz2r-f7G2OhfB0pTr4g' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvaOwNmZYm1ClO7sXIOfaeA; expires=Sat, 11-Nov-2023 03:49:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPlvhxPpYPVy98U6puD-qWgQEPE5KL0y47j_-chH2-lYiya3Px8wCsFb7g6nUHpuSeIaf-AcK_KvR_wEkNZQ4lu7099xMNnz5eN9PKRFybR1j4OXZW0DsP4N_Jh7yVsCMXPH8PvOzoKl2uNMZ8-6oP3Aa0dGAkHv5_fBEkl-CGVSQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:56 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=9d7526f1-f269-483c-8f86-8c441f190530&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-2064e9130600', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-yPoxqhpATwI_4kJYozlENg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Agon1mNUz25FkwxgUGjV4rs; expires=Sat, 11-Nov-2023 03:49:56 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:56 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708259489702170/blob169708259500804451') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29ca3-f01e-0036-5abf-fc1e51000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 03:49:56 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=97c43986-ce76-4f0d-a76f-70fbdfca47d9&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'c5ecb3cd-12c6-4dd9-9a71-b6af3e5b8500', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-lrQBefgwYJH1DxjsCWD1Ag' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AixeR7ro1rBIr3cBg1P3haA; expires=Sat, 11-Nov-2023 03:49:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:56 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708259489702170/blob169708259500804451') + .reply(200, "", [ + 'Content-Length', + '1024', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAD64C910672"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29cd4-f01e-0036-05bf-fc1e51000000', + 'x-ms-client-request-id', + '73fca27e-53e7-4747-81d9-a9f6746a05c5', + 'x-ms-version', + '2023-08-03', + 'x-ms-version-id', + '2023-10-12T03:49:55.9442034Z', + 'x-ms-is-current-version', + 'true', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'PageBlob', + 'x-ms-blob-sequence-number', + '0', + 'x-ms-server-encrypted', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-blob-sequence-number,x-ms-server-encrypted,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:56 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708259489702170') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29cee-f01e-0036-1abf-fc1e51000000', + 'x-ms-client-request-id', + '1d33198d-db5c-45d5-b576-41d2d5425a6f', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:56 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_customized_audience_should_work.js b/sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_customized_audience_should_work.js new file mode 100644 index 000000000000..cfa7b357250c --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_customized_audience_should_work.js @@ -0,0 +1,229 @@ +let nock = require('nock'); + +module.exports.hash = "25e59b4604d155bd986c417a9168ab08"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708259413807677","blob":"blob169708259424707153"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708259413807677') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'ETag', + '"0x8DBCAD64C0B4CC2"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29933-f01e-0036-73bf-fc1e51000000', + 'x-ms-client-request-id', + 'f05f0661-fc25-4d0c-8bdd-6e5b748569d8', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:54 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708259413807677/blob169708259424707153') + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'ETag', + '"0x8DBCAD64C1CAAA8"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29992-f01e-0036-2bbf-fc1e51000000', + 'x-ms-client-request-id', + 'ab72e2b8-5c42-4205-adf1-204c6beff24f', + 'x-ms-version', + '2023-08-03', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-version-id', + '2023-10-12T03:49:55.1816360Z', + 'Date', + 'Thu, 12 Oct 2023 03:49:54 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '49e7c5ab-9f74-4bfa-b280-f346ea340e00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AiJQViKLvBhLkONGMqrRzzg; expires=Sat, 11-Nov-2023 03:49:55 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPq9n_yO-jOIDeZmyuApNuExMfQ4bo58Cunv1XgjP7JXHLMO7Y_IJhXTxeJmpwNs4p5Yh37wL3XsbZUXDPKeUCAQx6FQyDG9KIFtwrFzQmdEhZw_-IyqvBd-H1u348NybIilh21ACLTKfmVZSiPH8OisERhSC2LesEGJvUctTIOn4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:54 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '3d4fca17-ef71-46b2-bac4-ab0099252d00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-brcU0TyDDofxuWOElSYKcg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AqLYgqKHswZJtFiuWkwVQzI; expires=Sat, 11-Nov-2023 03:49:55 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP4uUkuWKucu0qDhLudcMorwPRH1xEPIgKHKNZJ0CaKVthrqbNEVZFQGg7LQkw1jVo3X5y7DggmZ3-6QXGiodT7EA7gnb9BQDKCG3p-q4WlmJZ9eVV4tNnQ3kATQ4PLCSQAmRsKr1svwbuyrmDlVFTKunqj798O0yN6ox2GISaojAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=4794b82e-33b2-4b6c-aee8-30ce95ff06b3&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'f99dcba1-b28d-4c1a-8718-e2fb82191600', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AqIjcxMNDmBAutb_dLJwPg4; expires=Sat, 11-Nov-2023 03:49:55 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'Content-Length', + '1337' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708259413807677/blob169708259424707153') + .reply(200, "", [ + 'Content-Length', + '1024', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAD64C1CAAA8"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29ace-f01e-0036-40bf-fc1e51000000', + 'x-ms-client-request-id', + 'b258936e-2ea5-43f1-ba49-5ff8ba984f95', + 'x-ms-version', + '2023-08-03', + 'x-ms-version-id', + '2023-10-12T03:49:55.1816360Z', + 'x-ms-is-current-version', + 'true', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 03:49:55 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'PageBlob', + 'x-ms-blob-sequence-number', + '0', + 'x-ms-server-encrypted', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-blob-sequence-number,x-ms-server-encrypted,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:54 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708259413807677') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29ae9-f01e-0036-5bbf-fc1e51000000', + 'x-ms-client-request-id', + 'a7773403-8968-40be-b088-ec0401cc74c0', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:55 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_default_audience_should_work.js b/sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_default_audience_should_work.js new file mode 100644 index 000000000000..e87cd5f5742e --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/pageblobclient_nodejs_only/recording_default_audience_should_work.js @@ -0,0 +1,229 @@ +let nock = require('nock'); + +module.exports.hash = "cca5509ebf66eb9a14a1c6a0eb57d8bf"; + +module.exports.testInfo = {"uniqueName":{"container":"container169708259325209868","blob":"blob169708259336206091"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708259325209868') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:54 GMT', + 'ETag', + '"0x8DBCAD64B8455F7"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a297a4-f01e-0036-02bf-fc1e51000000', + 'x-ms-client-request-id', + 'db06d2fd-498b-4cbc-87d3-0760013ed807', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:53 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container169708259325209868/blob169708259336206091') + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:54 GMT', + 'ETag', + '"0x8DBCAD64B95B3EC"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a297f5-f01e-0036-4abf-fc1e51000000', + 'x-ms-client-request-id', + 'c0621476-0309-4b2b-9496-3c6906dea849', + 'x-ms-version', + '2023-08-03', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-version-id', + '2023-10-12T03:49:54.2971372Z', + 'Date', + 'Thu, 12 Oct 2023 03:49:53 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-268837cb0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AuK3sebAsU9PgygSGOR55sI; expires=Sat, 11-Nov-2023 03:49:54 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPu01qfk5uLnnpMd-OgDV9vTG065g2k-j0t3EzrIui66DdKq-E_jCV_8ZkSGU-QWFGDLZRqoFpSJ9cs2KZCqHljDt_XG9UMYVfJRU0BIQ2yj8gI-Dl_EJn_P3J6vHDJgJK-JjI4z-Q-G80kvzFHFpdL4O6z2KCmlXPH_8ooP4MRi0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:54 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '651cc055-a598-4249-88c7-268838cb0f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Akk0mDKOFIZFq_PQ5QsQpkk; expires=Sat, 11-Nov-2023 03:49:54 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPtSpCOC3Orr8nh8AFCuC6r2nlD8lGE9EHcxLRDFpm44h_lHKNUo9K2vOTRPRpe5UtHCVfqLXggDoGN8xUxLWIqKM8Dw3piS3wjoCBLDc1lDBEHex3HEKE6Krm-kCWPNF3rPwFVDmZHiyvnbbMvGDs13vKP-MDVwv4967vaeoWQy8gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:54 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=e6431e53-c1ff-4eba-b5de-b7df5ee2ad93&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-2064a9130600', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-rlzgszdQgTTYxnxtzzmjWw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Avw9SEp_BT5MpEOigIImnJA; expires=Sat, 11-Nov-2023 03:49:54 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 03:49:54 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/container169708259325209868/blob169708259336206091') + .reply(200, "", [ + 'Content-Length', + '1024', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 03:49:54 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAD64B95B3EC"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a298e1-f01e-0036-27bf-fc1e51000000', + 'x-ms-client-request-id', + 'bd04ff58-a37f-42cb-86e6-6e61fb0055b9', + 'x-ms-version', + '2023-08-03', + 'x-ms-version-id', + '2023-10-12T03:49:54.2971372Z', + 'x-ms-is-current-version', + 'true', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 03:49:54 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'PageBlob', + 'x-ms-blob-sequence-number', + '0', + 'x-ms-server-encrypted', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-version-id,x-ms-is-current-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-blob-sequence-number,x-ms-server-encrypted,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 03:49:54 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container169708259325209868') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '58a29905-f01e-0036-49bf-fc1e51000000', + 'x-ms-client-request-id', + '472838a8-8fb2-404b-8861-fe9ca300c6c2', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 03:49:54 GMT' +]); diff --git a/sdk/storage/storage-blob/review/storage-blob.api.md b/sdk/storage/storage-blob/review/storage-blob.api.md index efc1668d4911..5b3fd92e7f54 100644 --- a/sdk/storage/storage-blob/review/storage-blob.api.md +++ b/sdk/storage/storage-blob/review/storage-blob.api.md @@ -2295,6 +2295,9 @@ export interface GeoReplication { // @public export type GeoReplicationStatusType = "live" | "bootstrap" | "unavailable"; +// @public (undocumented) +export function getBlobServiceAccountAudience(storageAccountName: string): string; + // @public export interface HttpAuthorization { scheme: string; diff --git a/sdk/storage/storage-blob/src/Pipeline.ts b/sdk/storage/storage-blob/src/Pipeline.ts index f9906aa9a010..0e1ebb412e0c 100644 --- a/sdk/storage/storage-blob/src/Pipeline.ts +++ b/sdk/storage/storage-blob/src/Pipeline.ts @@ -187,6 +187,7 @@ export interface StoragePipelineOptions { httpClient?: IHttpClient; /** * The audience used to retrieve an AAD token. + * By default, audience 'https://storage.azure.com/.default' will be used. */ audience?: string | string[]; } diff --git a/sdk/storage/storage-blob/src/generated/src/models/parameters.ts b/sdk/storage/storage-blob/src/generated/src/models/parameters.ts index b6e19658a164..aac97afef23b 100644 --- a/sdk/storage/storage-blob/src/generated/src/models/parameters.ts +++ b/sdk/storage/storage-blob/src/generated/src/models/parameters.ts @@ -103,7 +103,7 @@ export const timeoutInSeconds: OperationQueryParameter = { export const version: OperationParameter = { parameterPath: "version", mapper: { - defaultValue: "2023-08-03", + defaultValue: "2023-11-03", isConstant: true, serializedName: "x-ms-version", type: { diff --git a/sdk/storage/storage-blob/src/generated/src/storageClientContext.ts b/sdk/storage/storage-blob/src/generated/src/storageClientContext.ts index 7e35a821f617..11bbba4993e5 100644 --- a/sdk/storage/storage-blob/src/generated/src/storageClientContext.ts +++ b/sdk/storage/storage-blob/src/generated/src/storageClientContext.ts @@ -47,6 +47,6 @@ export class StorageClientContext extends coreHttp.ServiceClient { this.url = url; // Assigning values to Constant parameters - this.version = options.version || "2023-08-03"; + this.version = options.version || "2023-11-03"; } } diff --git a/sdk/storage/storage-blob/src/index.ts b/sdk/storage/storage-blob/src/index.ts index 33ac3e213454..18a138b1b80f 100644 --- a/sdk/storage/storage-blob/src/index.ts +++ b/sdk/storage/storage-blob/src/index.ts @@ -38,6 +38,7 @@ export { HttpAuthorization, StorageBlobAudience, PollerLikeWithCancellation, + getBlobServiceAccountAudience, } from "./models"; export * from "./Pipeline"; export * from "./policies/AnonymousCredentialPolicy"; diff --git a/sdk/storage/storage-blob/src/models.ts b/sdk/storage/storage-blob/src/models.ts index adb427a752a4..f448071f70b7 100644 --- a/sdk/storage/storage-blob/src/models.ts +++ b/sdk/storage/storage-blob/src/models.ts @@ -332,6 +332,10 @@ export enum StorageBlobAudience { DiskComputeOAuthScopes = "https://disk.compute.azure.com/.default", } +export function getBlobServiceAccountAudience(storageAccountName: string): string { + return `https://${storageAccountName}.blob.core.windows.net/.default`; +} + /** * Abstract representation of a poller, intended to expose just the minimal API that the user needs to work with. */ diff --git a/sdk/storage/storage-blob/src/utils/constants.ts b/sdk/storage/storage-blob/src/utils/constants.ts index f83ec747e9bf..442565d83735 100644 --- a/sdk/storage/storage-blob/src/utils/constants.ts +++ b/sdk/storage/storage-blob/src/utils/constants.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. export const SDK_VERSION: string = "12.16.1"; -export const SERVICE_VERSION: string = "2023-08-03"; +export const SERVICE_VERSION: string = "2023-11-03"; export const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES: number = 256 * 1024 * 1024; // 256MB export const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES: number = 4000 * 1024 * 1024; // 4000MB diff --git a/sdk/storage/storage-blob/swagger/README.md b/sdk/storage/storage-blob/swagger/README.md index 0771138e9408..3c4057b81159 100644 --- a/sdk/storage/storage-blob/swagger/README.md +++ b/sdk/storage/storage-blob/swagger/README.md @@ -1463,13 +1463,13 @@ directive: ]; ``` -### Update service version from "2021-12-02" to "2023-08-03" +### Update service version from "2021-12-02" to "2023-11-03" ```yaml directive: - from: swagger-document where: $.parameters.ApiVersionParameter - transform: $.enum = [ "2023-08-03" ]; + transform: $.enum = [ "2023-11-03" ]; ``` ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorage%2Fstorage-blob%2Fswagger%2FREADME.png) diff --git a/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts b/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts index 1383d32c24ed..27aa95578118 100644 --- a/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/appendblobclient.spec.ts @@ -19,12 +19,15 @@ import { recorderEnvSetup, getTokenBSUWithDefaultCredential, getStorageAccessTokenWithDefaultCredential, + SimpleTokenCredential, } from "../utils"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; import { record, Recorder } from "@azure-tools/test-recorder"; import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; import { Context } from "mocha"; +import { DefaultAzureCredential } from "@azure/identity"; +import { getBlobServiceAccountAudience } from "../../src/models"; describe("AppendBlobClient Node.js only", () => { let containerName: string; @@ -84,6 +87,58 @@ describe("AppendBlobClient Node.js only", () => { assertClientUsesTokenCredential(newClient); }); + it("Default audience should work", async () => { + await appendBlobClient.create(); + const appendBlobClientWithOAuthToken = new AppendBlobClient( + appendBlobClient.url, + new DefaultAzureCredential() + ); + const exist = await appendBlobClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("Customized audience should work", async () => { + await appendBlobClient.create(); + const appendBlobClientWithOAuthToken = new AppendBlobClient( + appendBlobClient.url, + new DefaultAzureCredential(), + { + audience: [getBlobServiceAccountAudience(blobServiceClient.accountName)], + } + ); + const exist = await appendBlobClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("Bearer token challenge should work", async () => { + await appendBlobClient.create(); + + // To validate that bad audience should fail. + const authToken = await new DefaultAzureCredential().getToken( + "https://badaudience.blob.core.windows.net/.default" + ); + const appendBlobClientWithPlainOAuthToken = new AppendBlobClient( + appendBlobClient.url, + new SimpleTokenCredential(authToken.token) + ); + + try { + await appendBlobClientWithPlainOAuthToken.exists(); + assert.fail("Should fail with 401"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 401); + } + const appendBlobClientWithOAuthToken = new AppendBlobClient( + appendBlobClient.url, + new DefaultAzureCredential(), + { + audience: ["https://badaudience.blob.core.windows.net/.default"], + } + ); + const exist = await appendBlobClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + it("can be created with a url and a pipeline", async () => { const factories = (appendBlobClient as any).pipeline.factories; const credential = factories[factories.length - 1] as StorageSharedKeyCredential; diff --git a/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts b/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts index b1795a761679..c820b610009c 100644 --- a/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blobserviceclient.spec.ts @@ -3,10 +3,21 @@ import { assert } from "chai"; -import { BlobServiceClient, newPipeline, StorageSharedKeyCredential } from "../../src"; -import { getBSU, getConnectionStringFromEnvironment, recorderEnvSetup } from "../utils"; +import { + BlobServiceClient, + getBlobServiceAccountAudience, + newPipeline, + StorageSharedKeyCredential, +} from "../../src"; +import { + getBSU, + getConnectionStringFromEnvironment, + recorderEnvSetup, + SimpleTokenCredential, +} from "../utils"; import { record, Recorder } from "@azure-tools/test-recorder"; import { Context } from "mocha"; +import { DefaultAzureCredential } from "@azure/identity"; describe("BlobServiceClient Node.js only", () => { let recorder: Recorder; @@ -19,6 +30,55 @@ describe("BlobServiceClient Node.js only", () => { await recorder.stop(); }); + it("Default audience should work", async () => { + const serviceClient = getBSU(); + const blobServiceClientWithOAuthToken = new BlobServiceClient( + serviceClient.url, + new DefaultAzureCredential() + ); + await blobServiceClientWithOAuthToken.getProperties(); + }); + + it("Customized audience should work", async () => { + const serviceClient = getBSU(); + const blobServiceClientWithOAuthToken = new BlobServiceClient( + serviceClient.url, + new DefaultAzureCredential(), + { + audience: [getBlobServiceAccountAudience(serviceClient.accountName)], + } + ); + await blobServiceClientWithOAuthToken.getProperties(); + }); + + it("Bearer token challenge should work", async () => { + const serviceClient = getBSU(); + + // To validate that bad audience should fail. + const authToken = await new DefaultAzureCredential().getToken( + "https://badaudience.blob.core.windows.net/.default" + ); + const blobServiceClientWithPlainOAuthToken = new BlobServiceClient( + serviceClient.url, + new SimpleTokenCredential(authToken.token) + ); + + try { + await blobServiceClientWithPlainOAuthToken.getProperties(); + assert.fail("Should fail with 401"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 401); + } + const blobServiceClientWithOAuthToken = new BlobServiceClient( + serviceClient.url, + new DefaultAzureCredential(), + { + audience: ["https://badaudience.blob.core.windows.net/.default"], + } + ); + await blobServiceClientWithOAuthToken.getProperties(); + }); + it("can be created with a url and a credential", async () => { const serviceClient = getBSU(); const factories = (serviceClient as any).pipeline.factories; diff --git a/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts b/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts index 1a2c452d2150..6c1977859642 100644 --- a/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blockblobclient.spec.ts @@ -5,6 +5,7 @@ import { assert } from "chai"; import * as zlib from "zlib"; import { + SimpleTokenCredential, base64encode, bodyToString, genearteRandomUint8Array, @@ -23,6 +24,7 @@ import { BlobServiceClient, generateBlobSASQueryParameters, BlobSASPermissions, + getBlobServiceAccountAudience, } from "../../src"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; @@ -31,6 +33,7 @@ import { streamToBuffer3 } from "../../src/utils/utils.node"; import * as crypto from "crypto"; import { BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES } from "../../src/utils/constants"; import { Context } from "mocha"; +import { DefaultAzureCredential } from "@azure/identity"; describe("BlockBlobClient Node.js only", () => { let containerName: string; @@ -59,6 +62,59 @@ describe("BlockBlobClient Node.js only", () => { } }); + it("Default audience should work", async () => { + await blockBlobClient.upload("Hello", 5); + const blockBlobClientWithOAuthToken = new BlockBlobClient( + blockBlobClient.url, + new DefaultAzureCredential() + ); + const exist = await blockBlobClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("Customized audience should work", async () => { + await blockBlobClient.upload("Hello", 5); + const blockBlobClientWithOAuthToken = new BlockBlobClient( + blockBlobClient.url, + new DefaultAzureCredential(), + { + audience: [getBlobServiceAccountAudience(blobServiceClient.accountName)], + } + ); + const exist = await blockBlobClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("Bearer token challenge should work", async () => { + await blockBlobClient.upload("Hello", 5); + + // Validate that bad audience should fail first. + const authToken = await new DefaultAzureCredential().getToken( + "https://badaudience.blob.core.windows.net/.default" + ); + const blockBlobClientWithPlainOAuthToken = new BlockBlobClient( + blockBlobClient.url, + new SimpleTokenCredential(authToken.token) + ); + + try { + await blockBlobClientWithPlainOAuthToken.exists(); + assert.fail("Should fail with 401"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 401); + } + + const blockBlobClientWithOAuthToken = new BlockBlobClient( + blockBlobClient.url, + new DefaultAzureCredential(), + { + audience: ["https://badaudience.blob.core.windows.net/.default"], + } + ); + const exist = await blockBlobClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + it("upload with Readable stream body and default parameters", async () => { const body: string = recorder.getUniqueName("randomstring"); const bodyBuffer = Buffer.from(body); diff --git a/sdk/storage/storage-blob/test/node/containerclient.spec.ts b/sdk/storage/storage-blob/test/node/containerclient.spec.ts index e424df3e4c47..06ecf1d15dc0 100644 --- a/sdk/storage/storage-blob/test/node/containerclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/containerclient.spec.ts @@ -3,8 +3,13 @@ import { assert } from "chai"; -import { getBSU, getConnectionStringFromEnvironment, recorderEnvSetup } from "../utils"; -import { PublicAccessType } from "../../src"; +import { + SimpleTokenCredential, + getBSU, + getConnectionStringFromEnvironment, + recorderEnvSetup, +} from "../utils"; +import { PublicAccessType, getBlobServiceAccountAudience } from "../../src"; import { ContainerClient, newPipeline, @@ -16,6 +21,7 @@ import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; import { record, Recorder } from "@azure-tools/test-recorder"; import { Context } from "mocha"; +import { DefaultAzureCredential } from "@azure/identity"; describe("ContainerClient Node.js only", () => { let containerName: string; @@ -36,6 +42,53 @@ describe("ContainerClient Node.js only", () => { await recorder.stop(); }); + it("Default audience should work", async () => { + const containerClientWithOAuthToken = new ContainerClient( + containerClient.url, + new DefaultAzureCredential() + ); + const exists = await containerClientWithOAuthToken.exists(); + assert.strictEqual(true, exists); + }); + + it("Customized audience should work", async () => { + const containerClientWithOAuthToken = new ContainerClient( + containerClient.url, + new DefaultAzureCredential(), + { + audience: [getBlobServiceAccountAudience(blobServiceClient.accountName)], + } + ); + const exists = await containerClientWithOAuthToken.exists(); + assert.strictEqual(true, exists); + }); + + it("Bearer token challenge should work", async () => { + // Validate that bad audience should fail first. + const authToken = await new DefaultAzureCredential().getToken( + "https://badaudience.blob.core.windows.net/.default" + ); + const containerClientWithPlainOAuthToken = new ContainerClient( + containerClient.url, + new SimpleTokenCredential(authToken.token) + ); + + try { + await containerClientWithPlainOAuthToken.exists(); + assert.fail("Should fail with 401"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 401); + } + const containerClientWithOAuthToken = new ContainerClient( + containerClient.url, + new DefaultAzureCredential(), + { + audience: ["https://badaudience.blob.core.windows.net/.default"], + } + ); + await containerClientWithOAuthToken.getProperties(); + }); + it("getAccessPolicy", async () => { const result = await containerClient.getAccessPolicy(); assert.ok(result.etag!.length > 0); diff --git a/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts b/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts index 768b0e258caa..2c6c1865160e 100644 --- a/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/pageblobclient.spec.ts @@ -10,6 +10,7 @@ import { recorderEnvSetup, getTokenBSUWithDefaultCredential, getStorageAccessTokenWithDefaultCredential, + SimpleTokenCredential, } from "../utils"; import { newPipeline, @@ -21,6 +22,7 @@ import { BlobSASPermissions, BlobServiceClient, StorageBlobAudience, + getBlobServiceAccountAudience, } from "../../src"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; @@ -55,6 +57,58 @@ describe("PageBlobClient Node.js only", () => { await recorder.stop(); }); + it("Default audience should work", async () => { + await pageBlobClient.create(1024); + const pageBlobClientWithOAuthToken = new PageBlobClient( + pageBlobClient.url, + new DefaultAzureCredential() + ); + const exist = await pageBlobClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("Customized audience should work", async () => { + await pageBlobClient.create(1024); + const pageBlobClientWithOAuthToken = new PageBlobClient( + pageBlobClient.url, + new DefaultAzureCredential(), + { + audience: [getBlobServiceAccountAudience(blobServiceClient.accountName)], + } + ); + const exist = await pageBlobClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("Bearer token challenge should work", async () => { + await pageBlobClient.create(1024); + + // To validate that bad audience should fail. + const authToken = await new DefaultAzureCredential().getToken( + "https://badaudience.blob.core.windows.net/.default" + ); + const pageBlobClientWithPlainOAuthToken = new PageBlobClient( + pageBlobClient.url, + new SimpleTokenCredential(authToken.token) + ); + + try { + await pageBlobClientWithPlainOAuthToken.exists(); + assert.fail("Should fail with 401"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 401); + } + const blockBlobClientWithOAuthToken = new PageBlobClient( + pageBlobClient.url, + new DefaultAzureCredential(), + { + audience: ["https://badaudience.blob.core.windows.net/.default"], + } + ); + const exist = await blockBlobClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + it("fetch a blob for disk with challenge Bearer token", async function (this: Context): Promise { if (isLiveMode()) { this.skip(); diff --git a/sdk/storage/storage-file-datalake/CHANGELOG.md b/sdk/storage/storage-file-datalake/CHANGELOG.md index 65091db57287..b9b55d29d651 100644 --- a/sdk/storage/storage-file-datalake/CHANGELOG.md +++ b/sdk/storage/storage-file-datalake/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 12.15.1 (Unreleased) + +### Features Added + +- Added support for service version 2023-11-03. +- Added support for indicating audience in StoragePipelineOptions. + ## 12.15.0 (2023-09-14) ### Features Added diff --git a/sdk/storage/storage-file-datalake/package.json b/sdk/storage/storage-file-datalake/package.json index deeddc58f6e5..db21fd5d3127 100644 --- a/sdk/storage/storage-file-datalake/package.json +++ b/sdk/storage/storage-file-datalake/package.json @@ -1,6 +1,6 @@ { "name": "@azure/storage-file-datalake", - "version": "12.15.0", + "version": "12.15.1", "description": "Microsoft Azure Storage SDK for JavaScript - DataLake", "sdk-type": "client", "main": "./dist/index.js", diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_bearer_token_challenge_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..971be89847ab --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_bearer_token_challenge_should_work.js @@ -0,0 +1,426 @@ +let nock = require('nock'); + +module.exports.hash = "55a8405cbee173aaadd10e30926dba26"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709289657305090"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709289657305090') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:41:37 GMT', + 'ETag', + '"0x8DBCAEE48CFE0D8"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd1473b8f-501e-0029-1ed7-fcd98f000000', + 'x-ms-client-request-id', + 'd5fbed0b-a5d6-43f6-bfc0-f370456fb84d', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:41:37 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '56c89bbc-c232-4e91-b43d-07699aa03700', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-1TdWTlYhDkCBLjNlgUDdaQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AmMbSi7fy0ZLgftyqK_u030; expires=Sat, 11-Nov-2023 06:41:37 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPr6B4mpuQvl9yvZcBK1iKS8dVsdSh8XJARQ4PE7PDiNSGjt5XhoLkwaAriF_wB8aFXqXG4Yg5eu6DOWifmXXBxRU7Mt7mOSGQJEZ7mlblLUoO_nBPehmaYSS4uuylwMcVnWQ-kEhHp7F0z9Ad9IsfGFIGUY1V4E37RGNnNk6RSzcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:37 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabb188b1c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvOnm0T4Kb1NhH2LUglaBhc; expires=Sat, 11-Nov-2023 06:41:37 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP8utll9ocYW25JkTG6MIFWQTO6DtBLzXiNZ3bmFvDKPwECDXU_2pBgJHTWd9Ys0pSh2WMhhiNHzsdnS-7ad_fzm9DiUxn45AUWmqnOzAawuJlftZUgegHfj-MpFfUq97qGnGQ3jn-QvUnbJfeYResiXUL68tH91n1SsUp0TT-Tw0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:37 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=bf502096-9170-4ecf-8322-573c4ad5eba1&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fa698571-3a4d-43ac-8b45-cc9579277b00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-kzReHIBvoHBBnLCZZQL61g' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=At-HNS7Bqx9IqgugZHq-tXKt-wbLAQAAACGMudwOAAAA; expires=Sat, 11-Nov-2023 06:41:38 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:37 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709289657305090') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:d1473c72-501e-0029-73d7-fcd98f000000\nTime:2023-10-12T06:41:38.3493001ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd1473c72-501e-0029-73d7-fcd98f000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:41:38 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709289657305090') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:d1473c8f-501e-0029-0fd7-fcd98f000000\nTime:2023-10-12T06:41:38.4502437ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd1473c8f-501e-0029-0fd7-fcd98f000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:41:38 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fa698571-3a4d-43ac-8b45-cc9587277b00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-Er7Q2IS1eD5_IGp_YjXkMg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Av3pAFuQlp9Cm0RrGY_jeV8; expires=Sat, 11-Nov-2023 06:41:38 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP0Xo9-XyKq7HS3QOp3T1Q3j2cyYP0Jy9hvalnhHDjw0EhNEM7V0OSCOg31_nRAUGUdoATnB2VlwcVJ8IBqFaSqoOgGQgYoF6JCZw0oAYmlTZtohB73eKF5zH4TN-W2wwyAGUmyVHZDNL3gNs6oBQM-jg5AI-He6IOLVvfwRKLBv4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:38 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6718ab0f-fe99-408d-b5a0-9d813e7d1300', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-HoBHgPRf6ekshfJpuBH5cg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AnBsuOSmbQhKq0ecd5-VjkY; expires=Sat, 11-Nov-2023 06:41:38 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPfzB31WC60pZazVX9Ai7mXAHXyXgAeCIuLkqUON0I7q34zdouMgYgS2wheqGxmJNGSfzSuLkxPQEBNrQzyX6JnZFdt325LbcxPZ0xF1p99YUx-Nx12iJa2HE03Moxk-VCx9WadCZ4SkdqIfzHTImVP6_L3einNDi4petJtWdb7GcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:38 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=8329db5e-2c81-4cf5-93f2-30980d01fcd8&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '7b45ceda-a09c-48a7-9b6a-672c621c1400', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AhkZSFVckG1NjBp_vwCUFIoQpWstAQAAACKMudwOAAAA; expires=Sat, 11-Nov-2023 06:41:39 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:38 GMT', + 'Content-Length', + '1338' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709289657305090') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:d1473d6f-501e-0029-5fd7-fcd98f000000\nTime:2023-10-12T06:41:39.2088162ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd1473d6f-501e-0029-5fd7-fcd98f000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:41:38 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=cf74c4ba-f2a7-4074-a47a-d21237bbe1e8&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabb318b1c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApAIZEz2p_lDovwW6-fSvsHeeSdeAQAAACOMudwOAAAA; expires=Sat, 11-Nov-2023 06:41:39 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:38 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709289657305090') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:41:37 GMT', + 'ETag', + '"0x8DBCAEE48CFE0D8"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd1473e2c-501e-0029-12d7-fcd98f000000', + 'x-ms-client-request-id', + 'db6aea3d-8656-4eb4-bb6e-90fe3016df12', + 'x-ms-version', + '2023-08-03', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-immutable-storage-with-versioning-enabled', + 'false', + 'x-ms-default-encryption-scope', + '$account-encryption-key', + 'x-ms-deny-encryption-scope-override', + 'false', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-immutable-storage-with-versioning-enabled,x-ms-default-encryption-scope,x-ms-deny-encryption-scope-override,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:41:39 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709289657305090') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd1473e6f-501e-0029-51d7-fcd98f000000', + 'x-ms-client-request-id', + '0cc6dcb8-c2d0-4c2b-89c9-16a4a5d3e626', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:41:39 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_customized_audience_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_customized_audience_should_work.js new file mode 100644 index 000000000000..84e104e27f58 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_customized_audience_should_work.js @@ -0,0 +1,264 @@ +let nock = require('nock'); + +module.exports.hash = "8b8ed27b45343a43c7f0444603c03c3e"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709289515407036"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709289515407036') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:41:36 GMT', + 'ETag', + '"0x8DBCAEE47F72C47"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd14739f6-501e-0029-28d7-fcd98f000000', + 'x-ms-client-request-id', + '368473c6-a584-42e3-ac63-79a0f21d0787', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:41:35 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-20640e650a00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-9nBPaL7Fc98O_f_Ucn3StA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aj7tUS-hok9Ns52KUJRfndI; expires=Sat, 11-Nov-2023 06:41:36 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPpIl383mvKx90euxysubxBhTGYKBF6wB3aksfvoOKtyTxCn10JnAjiGtLuUU0LcHHaNxCxyY3aL__bcDM9f9Qemqv6goMiFeWObA_TqD6fSYnVV4UC5Ogc_wJWuXiDeQFtYB6b1HBcdONI2z2u6vXC0Wb8U_E4Gn3osmL2L_DE3IgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:35 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabbf78a1c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ajm-rxjheNVMi6pGr6czGJE; expires=Sat, 11-Nov-2023 06:41:36 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPwxZN40aa4iX0AUM9saMjZiXG38Ch7QuIoH2GVQLUVrM3Dd-dNBYuD0R-ZfWuDXtTggGxBJeIJhFoKHzWxAhtyFejJKhdcfFe2vZQFX8DKkanz4G5WWJMtp2wUIANEt9FfUbuqsc0KyblLIcgJGQtfK95sAw0-xSOJ_M-Taax2ssgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:35 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=7bf99d48-0cea-4dc8-8853-1e53d521a93a&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-1933dc131500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-RwErj84L3Q-hklQR_vPk7w' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvROUUwXtY1NkAT5a9RzLmNK9m_2AQAAAB-MudwOAAAA; expires=Sat, 11-Nov-2023 06:41:36 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:36 GMT', + 'Content-Length', + '1342' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709289515407036') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:d1473abc-501e-0029-5bd7-fcd98f000000\nTime:2023-10-12T06:41:36.9171074ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd1473abc-501e-0029-5bd7-fcd98f000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:41:36 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=fd6d5e41-f918-4d98-b6ac-e9595f966aeb&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6718ab0f-fe99-408d-b5a0-9d811f7d1300', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-WAji_VPdfGCSYBqNN0hOyA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AhJJHUOiB7dAnvTKFBmz8KreeSdeAQAAACCMudwOAAAA; expires=Sat, 11-Nov-2023 06:41:37 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:36 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709289515407036') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:41:36 GMT', + 'ETag', + '"0x8DBCAEE47F72C47"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd1473b3e-501e-0029-54d7-fcd98f000000', + 'x-ms-client-request-id', + '785bdbfd-907c-4c14-8caa-c87d582c16d3', + 'x-ms-version', + '2023-08-03', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-immutable-storage-with-versioning-enabled', + 'false', + 'x-ms-default-encryption-scope', + '$account-encryption-key', + 'x-ms-deny-encryption-scope-override', + 'false', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-immutable-storage-with-versioning-enabled,x-ms-default-encryption-scope,x-ms-deny-encryption-scope-override,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:41:37 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709289515407036') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd1473b5b-501e-0029-6dd7-fcd98f000000', + 'x-ms-client-request-id', + 'efabca80-d880-4c45-aee5-4936629bd3b6', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:41:37 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_default_audience_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_default_audience_should_work.js new file mode 100644 index 000000000000..e83ab4b716fc --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefileclient_default_audience_should_work.js @@ -0,0 +1,199 @@ +let nock = require('nock'); + +module.exports.hash = "a4aa281bc0fe496edead07b1cb30dc99"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709289303905824"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709289303905824') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:41:34 GMT', + 'ETag', + '"0x8DBCAEE4705EA2F"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd147375c-501e-0029-5fd7-fcd98f000000', + 'x-ms-client-request-id', + 'efeb5f18-a1fd-44d1-932f-0dbab1bc003f', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:41:34 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6718ab0f-fe99-408d-b5a0-9d81fb7c1300', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-3GmgS5jAcwxGZW3ls8pkQA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApKp84ocQbtMkl8CFv8DSxM; expires=Sat, 11-Nov-2023 06:41:35 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPyg61sFYC93e-GRtbaOs8HsvB3d4C7cRkcXsWW1KRwU_tjmxzY9pZjoTWEMOn-3RxJNmnT9_K0T2cdUz26u3X2VJR64ivC34E-GoRuK96Bgi11z0Yi06arNkMvEPHPmNSFsasDziBJPwVt98XV0uMyGvoHeV7okFanHgqFPDXzAkgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:34 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'f99dcba1-b28d-4c1a-8718-e2fb676b1800', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgCE_snsKrhMt-DviR15q-w; expires=Sat, 11-Nov-2023 06:41:35 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPPLAuR0WjlK2V0cYt6MI0DR8I-U5sG7wUedwrHx9RqHLyEo_xuam6PSDaxl9uBdJoskgQfHr4mE-DFzvOCAeHOIAWqgNAqabKgnDK_XFWKFJu2lPuFUAqp3_rOdPNcRhiUasg0rm4K65BTnCt_QkPMBmyp3CoSjZPIwxAdrCyxpsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:34 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=a8fd9ab5-b806-47de-a44e-e85d0e983b95&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'f99dcba1-b28d-4c1a-8718-e2fb6d6b1800', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgpJRCoby9NDlVRG1si8iMveeSdeAQAAAB-MudwOAAAA; expires=Sat, 11-Nov-2023 06:41:35 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:41:35 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709289303905824') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:41:34 GMT', + 'ETag', + '"0x8DBCAEE4705EA2F"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd1473991-501e-0029-4ed7-fcd98f000000', + 'x-ms-client-request-id', + '095635fb-d19e-4106-a206-88937873b7e9', + 'x-ms-version', + '2023-08-03', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-immutable-storage-with-versioning-enabled', + 'false', + 'x-ms-default-encryption-scope', + '$account-encryption-key', + 'x-ms-deny-encryption-scope-override', + 'false', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-immutable-storage-with-versioning-enabled,x-ms-default-encryption-scope,x-ms-deny-encryption-scope-override,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:41:35 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709289303905824') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd14739c1-501e-0029-79d7-fcd98f000000', + 'x-ms-client-request-id', + 'efad6c0e-9c23-44f5-9b50-e0cf07c90fd0', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:41:35 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_bearer_token_challenge_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..4e9929eeb53a --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_bearer_token_challenge_should_work.js @@ -0,0 +1,430 @@ +let nock = require('nock'); + +module.exports.hash = "55a8405cbee173aaadd10e30926dba26"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709394992508586"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709394992508586') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:10 GMT', + 'ETag', + '"0x8DBCAF0BCA97312"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0240d-301e-004d-0bd9-fc2817000000', + 'x-ms-client-request-id', + 'df64ebbd-0bfe-4d2b-84e9-cb9e4a3213ed', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:10 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '593924ce-c021-4ad7-9112-05c185831b00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AoLUDZ4Jt0ZHkdkTfB6zdxI; expires=Sat, 11-Nov-2023 06:59:11 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPLobiJmehXLaTu65Knq-VDBQZmmMglUe89FO3vrg6WQrSb_FyaCL68l8ZuLpSMCHCyKFQXPtqADl91RvLiKOzXvkH1F4SsWZ79WK7UHO2N_4nwdXSmt6se40NW1kVmHGr7klXdB0bh-XkrWmbaXcD49KJ2OJFVAYfj3es1Cwo5F4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:10 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-19336f641500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-XY6fCryu0uMpl25FytZvvw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ai1ncDUGlK9JniT3LvEVnGo; expires=Sat, 11-Nov-2023 06:59:11 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPqb13mee1e7ksBWuqTBG3kS3fpSEIDDuZCTGWzOuhgOL0f8aRjm9OUhY__Y5hwJZ3uJ84Rkykc6M1zMAGh9iph2JoAGEQd_9BPjQClJD3_5nZHN-NFk9edAGn-YRgTGbEWNyCWcHUWFIUdpQo1dA2DtN0B56plmd3bxlcoSpsdtwgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:10 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=4183c7e6-66be-4e88-8c87-f74f6521d698&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-193371641500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-m9smP9mAQunx48j9UkkGbA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AtElSOYFeoFHvY3lORb6h4St-wbLAQAAAD6QudwOAAAA; expires=Sat, 11-Nov-2023 06:59:11 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:10 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709394992508586') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:43f02504-301e-004d-71d9-fc2817000000\nTime:2023-10-12T06:59:11.6366569ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02504-301e-004d-71d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:11 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709394992508586') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:43f0251c-301e-004d-08d9-fc2817000000\nTime:2023-10-12T06:59:11.7356020ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0251c-301e-004d-08d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:11 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '56c89bbc-c232-4e91-b43d-0769aec33700', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-3sLY4zyoizZaNE1HDosmpA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AkmRsxl3hBZEl-bJDXEgQPM; expires=Sat, 11-Nov-2023 06:59:11 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPqJ9UbT3rDHx0EfSuUSn5LECsM7017x93zwKI-j-Zp-t5pP93qU2oKQh0FfcIcjJMZBAVJKakW2m1RSISuhpKMG6BOkiNi8Xhuw_oantWR-GTL3cOLbOpVB1fO7nLJ1LTjOCYtyg_5TWBUJxa-lK48lvvtAI8gT46sevu3pkisqAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:11 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-19337c641500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-eT6oVvk-1GxpJzMn8WjTAQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AhdTzWKne7BOl754-WCBBEw; expires=Sat, 11-Nov-2023 06:59:12 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPFMTvQ1RCOWSO2GH3AyXvX4FUTDXY0Bj1N8uvboU0By7IcXHhpIv-Q9GI2Cqv6SOnwweeTs0zQM_X4ANf_bVWl6ZDlckX51SOChl51-9A-zvQU90wbijW_QxNP5aodjEvlBk5-7p38VwRDssKtNnuDNn7k1rBtmgFglriqA3FJ1MgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:11 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=911dddee-a3a5-4f3f-95c1-767b63a1c115&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fb5a9bd3-750d-4e22-8224-1086e0212300', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-0U9DGamXEfGWXjOFWAf3xg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aoga1joo3pNHj4OmHHpSX-0QpWstAQAAAD-QudwOAAAA; expires=Sat, 11-Nov-2023 06:59:12 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:11 GMT', + 'Content-Length', + '1338' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709394992508586') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:43f025f5-301e-004d-51d9-fc2817000000\nTime:2023-10-12T06:59:12.4611925ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f025f5-301e-004d-51d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:12 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=bbd20d2e-d327-4f3e-bddf-aaee24725d55&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '56c89bbc-c232-4e91-b43d-0769b4c33700', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-ERwfiDdx0BDtCPiL7xpoKw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AnidOp4YGItPsm4ohx6KozY; expires=Sat, 11-Nov-2023 06:59:12 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:11 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709394992508586') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:10 GMT', + 'ETag', + '"0x8DBCAF0BCA97312"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02637-301e-004d-10d9-fc2817000000', + 'x-ms-client-request-id', + '276ca5b2-b012-4f39-bdf9-3ae2198af30e', + 'x-ms-version', + '2023-08-03', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-immutable-storage-with-versioning-enabled', + 'false', + 'x-ms-default-encryption-scope', + '$account-encryption-key', + 'x-ms-deny-encryption-scope-override', + 'false', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-immutable-storage-with-versioning-enabled,x-ms-default-encryption-scope,x-ms-deny-encryption-scope-override,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:12 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709394992508586') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0264d-301e-004d-26d9-fc2817000000', + 'x-ms-client-request-id', + 'c4395b8e-87e9-4e50-afb3-018024c58c6f', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:12 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_customized_audience_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_customized_audience_should_work.js new file mode 100644 index 000000000000..b11b15b8978a --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_customized_audience_should_work.js @@ -0,0 +1,262 @@ +let nock = require('nock'); + +module.exports.hash = "8b8ed27b45343a43c7f0444603c03c3e"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709394874500665"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709394874500665') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:09 GMT', + 'ETag', + '"0x8DBCAF0BBF55847"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02231-301e-004d-6ad9-fc2817000000', + 'x-ms-client-request-id', + 'e4c31747-c0be-4eaf-8a8c-0d5a7f0151e2', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:09 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-206489de0a00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-GJgif8WTedVCn4QPoOdV8A' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AoTbBG58TYZOgqpo9T5BwLc; expires=Sat, 11-Nov-2023 06:59:09 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPjw5miaLjKnG4nGLkfuv8VEKsJo6wOE_NSR_jB9_61HqjSkGTruIbi_AlXf6xUKz6JgaS2d0o0v3ju5xbIyGl8VytfPLu-42sgtrJPkdszNWNQBda_lz66qW011oe8IUbyPxEP1exhrt7lAHIsKZRdgwA1u4pBfyvXIWR5Qi6QAcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:09 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '7b45ceda-a09c-48a7-9b6a-672c0d631400', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AjE5nl9n9IRHkEcO2j6Y5AI; expires=Sat, 11-Nov-2023 06:59:09 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPi97dHdnbuBZipgv6mZS3xQeSjmyTnBAW3_SWkMNHkXi8ru_yjttiWPF86MRcwdnWTwhNTJMHbGieVaB2UIqrq-sjFK0wIGJ5hdeJ-hyfwoedTEfkzWuFIh2t5H_fUA3_jcINDZ9EZbiQre44-dKQfSagU7s0w-HJknsJPTp_3c8gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:09 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=61810b03-a295-40d6-92d5-2695dedcc45f&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-206494de0a00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-YmPvX7xk6_WlCu1kG08xGg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvJj7ujjtn5FvXMG4mEE32BK9m_2AQAAAD2QudwOAAAA; expires=Sat, 11-Nov-2023 06:59:10 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:09 GMT', + 'Content-Length', + '1342' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709394874500665') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:43f0234c-301e-004d-5cd9-fc2817000000\nTime:2023-10-12T06:59:10.3893612ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0234c-301e-004d-5cd9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:10 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=ae77bb99-d7df-4acb-b61e-2eacf4fde4d9&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabbd4cf1c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AsFqt68S-EdPsOh6TZGR1i_eeSdeAQAAAD6QudwOAAAA; expires=Sat, 11-Nov-2023 06:59:10 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:09 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709394874500665') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:09 GMT', + 'ETag', + '"0x8DBCAF0BBF55847"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f023c3-301e-004d-46d9-fc2817000000', + 'x-ms-client-request-id', + 'fdd5b423-1a23-4f63-a305-913a6173452f', + 'x-ms-version', + '2023-08-03', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-immutable-storage-with-versioning-enabled', + 'false', + 'x-ms-default-encryption-scope', + '$account-encryption-key', + 'x-ms-deny-encryption-scope-override', + 'false', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-immutable-storage-with-versioning-enabled,x-ms-default-encryption-scope,x-ms-deny-encryption-scope-override,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:10 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709394874500665') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f023ec-301e-004d-6bd9-fc2817000000', + 'x-ms-client-request-id', + '0509a756-931c-4b23-8dc6-032adc699c54', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:10 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_default_audience_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_default_audience_should_work.js new file mode 100644 index 000000000000..bc263b6532fa --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakefilesystemclient_nodejs_only/recording_datalakefilesystemclient_default_audience_should_work.js @@ -0,0 +1,203 @@ +let nock = require('nock'); + +module.exports.hash = "a4aa281bc0fe496edead07b1cb30dc99"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709394696205072"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709394696205072') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:08 GMT', + 'ETag', + '"0x8DBCAF0BB3B4AE7"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f020a7-301e-004d-04d9-fc2817000000', + 'x-ms-client-request-id', + '885a1f6a-ea61-453a-a0a7-29ce850f36ba', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:08 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-206473de0a00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-0-cEgOYKHbrhCBiIzmu7mQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AqQJYShmDKZFo4AJkKR1pKM; expires=Sat, 11-Nov-2023 06:59:08 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPz60WhXRt2Eyzn-zTTw2aKOH2AffvTjaHC0rR64qnNF71ymH7Wy8KD075cGzub3QG4GSIEnmkWYeJL_pp0N9h5-W4ZQv0lR1OECOIwv5qapnGp3yvVVDwEbdzv_g5EjSaF-yd7VWWMnguyisPvHWEH5JZ2b2Ih64SXe2ve7um0jQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:08 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-19334c641500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-4rH4lfGumaU0FrucDJIlRA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ag-PTQXESgpDnTdIz1J2YTU; expires=Sat, 11-Nov-2023 06:59:09 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPa48BtsNovRuZvygg1OqV9iqY3eXl6veFEwTJtRn00vLTUYXYa2WcAShGt-Wf-Qf1QoO0BXe8mLvtmyBhOQoZ42gHPt6xOxa5HsQZH8IWgbDAVzL3kwJiNS_wOE_dWB4pVxJkYQS2qMJ-PIAdU9K93Xe3RWrMuRmJitkv2oI_LFIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:08 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=52643b62-5769-4f50-81e1-fc7f602b0fe0&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '56c89bbc-c232-4e91-b43d-07699ac33700', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-n0m6ZHDmwZGMbgy2fw8qKw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AsdbcKN0bJVBrfvCtHnjL8veeSdeAQAAADyQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:09 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:08 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem169709394696205072') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:08 GMT', + 'ETag', + '"0x8DBCAF0BB3B4AE7"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f021ba-301e-004d-07d9-fc2817000000', + 'x-ms-client-request-id', + '54f2f777-e340-420d-8f64-b817bb58e788', + 'x-ms-version', + '2023-08-03', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-immutable-storage-with-versioning-enabled', + 'false', + 'x-ms-default-encryption-scope', + '$account-encryption-key', + 'x-ms-deny-encryption-scope-override', + 'false', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-immutable-storage-with-versioning-enabled,x-ms-default-encryption-scope,x-ms-deny-encryption-scope-override,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:09 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709394696205072') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f021f1-301e-004d-3dd9-fc2817000000', + 'x-ms-client-request-id', + '500cd37d-3d41-4510-b0e3-3e43fd432acf', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:09 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_bearer_token_challenge_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..8bf43492a4ec --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_bearer_token_challenge_should_work.js @@ -0,0 +1,520 @@ +let nock = require('nock'); + +module.exports.hash = "28ed5f05bef3bb25e811a321a52b4e01"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709396065906469","file":"file169709396077500011","directory":"directory169709396112400594"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709396065906469') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:21 GMT', + 'ETag', + '"0x8DBCAF0C30F03B1"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f03295-301e-004d-21d9-fc2817000000', + 'x-ms-client-request-id', + '88cd6cd3-62b1-4190-9c9c-b7b75931a0d9', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:21 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709396065906469/file169709396077500011') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:21 GMT', + 'ETag', + '"0x8DBCAF0C321FB6E"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2061-001f-0046-17d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + '7cee67c5-d1fd-4a3a-8c75-5c1d0eff8fb1', + 'Date', + 'Thu, 12 Oct 2023 06:59:20 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709396065906469/file169709396077500011', "Hello World") + .query(true) + .reply(202, "", [ + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2066-001f-0046-1cd9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'c19423bd-c050-4046-8084-79a7747ff77f', + 'Date', + 'Thu, 12 Oct 2023 06:59:21 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709396065906469/file169709396077500011') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:22 GMT', + 'ETag', + '"0x8DBCAF0C344D5C5"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + 'aa5c206d-001f-0046-21d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'c131aa4a-059f-4e82-a7ad-14613ff0b493', + 'Date', + 'Thu, 12 Oct 2023 06:59:21 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709396065906469/directory169709396112400594') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:22 GMT', + 'ETag', + '"0x8DBCAF0C3558CC1"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2070-001f-0046-24d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + '0833943b-e1e9-4e78-91e4-563a14e253d4', + 'Date', + 'Thu, 12 Oct 2023 06:59:21 GMT', + 'Content-Length', + '0' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-19331a651500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-TjvWC-BJYjPe6uMQmEPZ_w' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApI1HygVXERCjKaxBskCDMY; expires=Sat, 11-Nov-2023 06:59:22 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPjRCvm0f_V39AmykQ5ECAD6-fTeif8bI2BZ1bYrEXeXXrRN-MT9tnLkqMosOCFC6lBCkpXaB-IJPjovgV2vZ0Z6dLuP8qGdgTvMFcZRyg90KMMJB7IT8KAI2h8j5N-ll0hczozd4LP4KZpt0_h2_oRVFUYkhLqJFynmGlUy1M3y4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:21 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-19331e651500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-WAmO_a7suRoNdBA166plpw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Am_3ze556YlOr0t3Z9ifFOQ; expires=Sat, 11-Nov-2023 06:59:22 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPBNwA3bfpc8CBjOWUzFltqUxioJltqe9kBqznXRRKistZQ21OCPEcwNdXYSquQRdDVhp3fKYQQb4-ry_hdWAlD_WAWbHGd02VdrE-3u1x2isaim436ME7SwHZyPZxWIkylWm9begCMCwVyorihwg6h7d_oEv8PqjLCg02vjGjZUsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:21 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=98337156-6cdd-4dcf-a886-38d91bb763e9&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'de7adffb-85c8-417d-b518-d414bc3d4900', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AilX57ys9vpPjBQwPWMZfWet-wbLAQAAAEmQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:22 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:21 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709396065906469/file169709396077500011') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f034a8-301e-004d-19d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:22 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709396065906469/file169709396077500011') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f034e4-301e-004d-50d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:22 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6718ab0f-fe99-408d-b5a0-9d8163ca1300', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-AYMM4dSw62Ps5mqACa3HsA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AsZ713BL_4VAqHjUzAVOWuM; expires=Sat, 11-Nov-2023 06:59:23 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPLyO8SciFTY0svH8ExB7QqfzyDenp2ik_3IYgP6cfKnSrsBLwZ1f3A2i_vYkJ_-JUrUf1IZemwIS7Y-TRnavsVtbRL00oAqXEe3GfPo8hAO69iv4FLDtyJqoYTRhMp45lrdsLCxJXFnDoTx9NVDxpzu4PPHJ7dbuWKFZQK-8ouzMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:22 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'de7adffb-85c8-417d-b518-d414c63d4900', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApgVNdtzK6dAlpP4NJRSaas; expires=Sat, 11-Nov-2023 06:59:23 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPjligOREZ6-0OLJrKZ5_tCftAwNZT8HY_ydwt5HmYNH9wXQ1YwvVSc-LTeUlCeXQ9WtZfpgCowkFBtmWDAFhUfK6b5hcHq7Dn-h3ItisSdYN70XijnYHFg7M1tm_ijul24_8PyrX6UPEPzLIGaCpDerr-WkSGCJiPimJxCOzqgJEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:22 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=beab5cc3-cded-463d-8538-282e27f6ae80&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fb5a9bd3-750d-4e22-8224-108615232300', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-y9yiz1Ss_YuQ6oSzI_nAFQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvV17ulSMlxLuaYatEGjjvY; expires=Sat, 11-Nov-2023 06:59:23 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:22 GMT', + 'Content-Length', + '1338' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709396065906469/file169709396077500011') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f035a0-301e-004d-7ed9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:23 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=c609a6b8-52fc-4fa8-9ac0-4869ce59061a&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabbe1d01c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AsftpmQpDIFFsPb8k5oWT-g; expires=Sat, 11-Nov-2023 06:59:23 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:22 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709396065906469/file169709396077500011') + .reply(200, "", [ + 'Content-Length', + '11', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:22 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAF0C344D5C5"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f035d7-301e-004d-34d9-fc2817000000', + 'x-ms-client-request-id', + 'de350e84-1b9e-4bf6-a072-ff5c9a245b3f', + 'x-ms-version', + '2023-08-03', + 'x-ms-resource-type', + 'file', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 06:59:21 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'x-ms-owner', + '$superuser', + 'x-ms-group', + '$superuser', + 'x-ms-permissions', + 'rw-r-----', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-resource-type,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-owner,x-ms-group,x-ms-permissions,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:23 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709396065906469') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f03603-301e-004d-5fd9-fc2817000000', + 'x-ms-client-request-id', + 'af32de4b-f5f3-49b7-8798-03cf778dce42', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:23 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_customized_audience_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_customized_audience_should_work.js new file mode 100644 index 000000000000..0574f1dd3c74 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_customized_audience_should_work.js @@ -0,0 +1,362 @@ +let nock = require('nock'); + +module.exports.hash = "75826ef9ae3a758d46a2bd99b6fa72d5"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709395908703720","file":"file169709395920705642","directory":"directory169709395955406117"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395908703720') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:20 GMT', + 'ETag', + '"0x8DBCAF0C21F4814"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f03066-301e-004d-0bd9-fc2817000000', + 'x-ms-client-request-id', + 'd137edd0-98e3-4082-9de3-5a30470d2f60', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:19 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395908703720/file169709395920705642') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:20 GMT', + 'ETag', + '"0x8DBCAF0C232B999"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2044-001f-0046-7ad9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'c88b7fcd-632f-445a-986a-9579f1de373d', + 'Date', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709395908703720/file169709395920705642', "Hello World") + .query(true) + .reply(202, "", [ + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2046-001f-0046-7cd9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + '22917e73-ef70-4c7d-9d8e-4ba1b200e786', + 'Date', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709395908703720/file169709395920705642') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:20 GMT', + 'ETag', + '"0x8DBCAF0C255EB7F"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + 'aa5c2048-001f-0046-7ed9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + '04cac407-d358-4de1-8ad4-e35b494ae680', + 'Date', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395908703720/directory169709395955406117') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:20 GMT', + 'ETag', + '"0x8DBCAF0C2669564"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c204b-001f-0046-01d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'b7534630-0377-460c-87f0-ab59e593cfa8', + 'Date', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'Content-Length', + '0' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'a07d7f73-576f-4d8c-85da-73f6a6690f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-bIKk9hFddHc8vWX_nw9X3w' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgiG5-kcaEJPm8_AW9T7Hd0; expires=Sat, 11-Nov-2023 06:59:20 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPI2eE8y4Eg7JIZktpEBpqzmEtsDGyHRlbmL-DI-ZmBW6tURPHbG76X_jV4oL5McLz17lZBzPM4gvmllSZbHXpGdICq6S_JEMVwb61fx0-e0S0AAIIgij5OW9WzaMNH_AxXHpF0HjEJP4HMgiFQsWSwxl1RdsyJIPtxui6wXTjsrQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-20649cdf0a00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-I_CTxSqFIq4c9sFXQLWm1w' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AnHHb_a1CaNEhIgSqgrcJ3A; expires=Sat, 11-Nov-2023 06:59:20 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP655v-1gnoQO_W4Gs7sQjkVKTs6-40Ppdns2Vh3OMla6aYCmkwcq6IyoUNuLCkgue6B6FU8ELB_7DUBLp8D2Q1HBbm6HLrBa5nQXO--0Ox7F5UTT7xa-9OKW4pdSZy-EHmYnTgULA8yyax1FOT_5a1NVG-lbObhbNlbV798bgalkgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=33ed8eac-61ed-453a-b777-24ac2f02981d&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabbadd01c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AqI_ZiqhYflLoBvgIjAdlQBK9m_2AQAAAEiQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:21 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:20 GMT', + 'Content-Length', + '1342' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709395908703720/file169709395920705642') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f031f3-301e-004d-06d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:21 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=7da471ae-bb77-484a-b2bb-abe6647e4570&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabbb6d01c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AoYZ9uG1--1JsPqgpgtjXoc; expires=Sat, 11-Nov-2023 06:59:21 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:20 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709395908703720/file169709395920705642') + .reply(200, "", [ + 'Content-Length', + '11', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:20 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAF0C255EB7F"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f03233-301e-004d-43d9-fc2817000000', + 'x-ms-client-request-id', + '6599f72a-af48-4482-8be4-24237d939207', + 'x-ms-version', + '2023-08-03', + 'x-ms-resource-type', + 'file', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 06:59:20 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'x-ms-owner', + '$superuser', + 'x-ms-group', + '$superuser', + 'x-ms-permissions', + 'rw-r-----', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-resource-type,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-owner,x-ms-group,x-ms-permissions,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:21 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709395908703720') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0325f-301e-004d-6ed9-fc2817000000', + 'x-ms-client-request-id', + 'a8e36b7d-9d9a-4fdc-884c-7c18971cdaec', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:21 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_default_audience_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_default_audience_should_work.js new file mode 100644 index 000000000000..17ad27e7fabb --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakedirectoryclient_default_audience_should_work.js @@ -0,0 +1,306 @@ +let nock = require('nock'); + +module.exports.hash = "6890d0d44d37f3f904b3feb60a7c360a"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709395791407708","file":"file169709395803101245","directory":"directory169709395837803018"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395791407708') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:18 GMT', + 'ETag', + '"0x8DBCAF0C16C6598"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02ee3-301e-004d-23d9-fc2817000000', + 'x-ms-client-request-id', + 'ad076b68-a71a-4f4e-8065-77e7b5a93034', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:18 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395791407708/file169709395803101245') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'ETag', + '"0x8DBCAF0C17F75DF"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2035-001f-0046-6bd9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'fb41f116-22b0-4e4a-9b33-39f34a0e366e', + 'Date', + 'Thu, 12 Oct 2023 06:59:18 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709395791407708/file169709395803101245', "Hello World") + .query(true) + .reply(202, "", [ + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2037-001f-0046-6dd9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + '025f4315-18b7-4d58-a7a4-fcb4a0004e9e', + 'Date', + 'Thu, 12 Oct 2023 06:59:18 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709395791407708/file169709395803101245') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'ETag', + '"0x8DBCAF0C1A2A542"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + 'aa5c203a-001f-0046-70d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'c0aefdda-c724-4354-998f-092cd6f0ef06', + 'Date', + 'Thu, 12 Oct 2023 06:59:18 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395791407708/directory169709395837803018') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'ETag', + '"0x8DBCAF0C1B38FE6"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c203b-001f-0046-71d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + '928f9003-a98d-4e82-ab45-f9145fc2d249', + 'Date', + 'Thu, 12 Oct 2023 06:59:18 GMT', + 'Content-Length', + '0' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabb82d01c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AlfhRDyPnnBKjnKdTZeG5Ds; expires=Sat, 11-Nov-2023 06:59:19 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP8lbVHxt7eFq45zv95-oeGem00vNgjV0zxkZktjru6C3vCeumyDySYMcEQ5CCfPFs8J6oF87ekfnRQOMrICXRXrzMh44ndOkLn645-d3lX5v7JNjhpVMOdsJdT98f9g3bQVCeYkQtyWercEkutrdAS15924QClO2hu_5zzx89oSogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:18 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6718ab0f-fe99-408d-b5a0-9d8113ca1300', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-6lmRL4-5Ho2o500VlZg2jQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AjX3t9lM3FVKtEMQ6UNirjU; expires=Sat, 11-Nov-2023 06:59:19 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPgTrOu61IKbAlf-hApeVuUaOkUf5Mvt2X7MnqwnqHtsinVd3LTaRG-vk0usINZXlFLWzKXnOIUw0RvIQTbcwIodiqylbSOFM8RCxO65QOVyKeHOt1yY6set2U8-9hVmkSZXguVpdDDKWDBw2iltiK_mW-w-0LsnGBDj4gtLl_lhYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:18 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=1acf8f60-6254-4946-a279-22bb87692a7b&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fb5a9bd3-750d-4e22-8224-1086b1222300', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-iFon4sS-Vcc_tLHcDy0gtw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aju-EIOGcjBEoq73iOmwo9o; expires=Sat, 11-Nov-2023 06:59:19 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:18 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709395791407708/directory169709395837803018') + .reply(200, "", [ + 'Content-Length', + '0', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAF0C1B38FE6"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f03003-301e-004d-31d9-fc2817000000', + 'x-ms-client-request-id', + '057830ff-9e6d-42ce-8acf-6333f60b0973', + 'x-ms-version', + '2023-08-03', + 'x-ms-resource-type', + 'directory', + 'x-ms-meta-hdi_isfolder', + 'true', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 06:59:19 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'x-ms-owner', + '$superuser', + 'x-ms-group', + '$superuser', + 'x-ms-permissions', + 'rwxr-x---', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-resource-type,x-ms-meta-hdi_isfolder,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-owner,x-ms-group,x-ms-permissions,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:19 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709395791407708') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0303d-301e-004d-67d9-fc2817000000', + 'x-ms-client-request-id', + '5c474972-ce7d-4791-8c0f-37353b2aff4d', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:19 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_bearer_token_challenge_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..8aa047823604 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_bearer_token_challenge_should_work.js @@ -0,0 +1,492 @@ +let nock = require('nock'); + +module.exports.hash = "e63dd83dc42cfc7d2760f68e06162e24"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709395521906240","file":"file169709395533604146"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395521906240') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:16 GMT', + 'ETag', + '"0x8DBCAF0BFD11976"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02ac8-301e-004d-56d9-fc2817000000', + 'x-ms-client-request-id', + '7850b2a0-b133-4277-b4fe-d39fae0f556f', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:16 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395521906240/file169709395533604146') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:16 GMT', + 'ETag', + '"0x8DBCAF0BFE5D883"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2026-001f-0046-5fd9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'a7960fbb-7b37-4faf-9818-20518daf2de8', + 'Date', + 'Thu, 12 Oct 2023 06:59:15 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709395521906240/file169709395533604146', "Hello World") + .query(true) + .reply(202, "", [ + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2028-001f-0046-61d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + '02b20e12-d26f-4be0-8215-fb05e201458c', + 'Date', + 'Thu, 12 Oct 2023 06:59:15 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709395521906240/file169709395533604146') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:16 GMT', + 'ETag', + '"0x8DBCAF0C00923E7"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + 'aa5c2029-001f-0046-62d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'e27c759a-edac-40b4-9fae-6bd2bb7a8684', + 'Date', + 'Thu, 12 Oct 2023 06:59:15 GMT', + 'Content-Length', + '0' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0dfe5555-fda6-416e-9aea-d3a407712100', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ant8w4AegtlFugP94XqEc2Y; expires=Sat, 11-Nov-2023 06:59:16 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP6NzhDO4XbSjILkmwndy54yzVxHuHy02SjiV8ntELKuFsEdAGXq5uMsXoz-zFbZvqjjC87nsElShq4SBG3__4gB-y2OpaX2JSaed5recqAh9RChwiAuoEvoArzYrL-KiCQiveUDjCfJB6GTxeERsRTAaiKXuDb8RR-SwuH5bNvMggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:15 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0dfe5555-fda6-416e-9aea-d3a40a712100', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AlOqncz1THhBnIBBE_MODNE; expires=Sat, 11-Nov-2023 06:59:16 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPX27D4ESvY7GqvKcIs9BaUEvolG6kKyAq8dsoaJRgWW7PSUL6FZDM_YeSge_VjQ8HYa_FXdwuluovETULO-HViX3Ye4EfLET8N1EsQNqixtp87Oe2rqsyd9Jd08QNWRrbnNgoV0oZ1fj59uyEngE14dTLTcITn8BWLz-ujBwcDcwgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:15 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=32173545-6ba4-4a72-943a-86f9ad341acb&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabb56d01c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ao1Wg7_weppNuJbjnqGFAtet-wbLAQAAAESQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:17 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:16 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709395521906240/file169709395533604146') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02c51-301e-004d-49d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:16 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709395521906240/file169709395533604146') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02c79-301e-004d-69d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:17 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-206440df0a00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-Vghh3FlPokg-HStQriINmA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AniHabztLtFGhOPD0URMRq4; expires=Sat, 11-Nov-2023 06:59:17 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPtdHzijgNiNDGD1oTd514_WGZDUUJ3gw5ZVKjn1c81U4c1CXCR2Xb0G44G01FQW3PLADLu9lGtFldALMe0kc4Sr8ki6IaWsvwKalg5H5sgyjyW6fzNGP8_LTaziUjXovFvoizHvwyrFQlE7DaqVPN76scLMFBuXAnX6wg4io3a10gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:16 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0dfe5555-fda6-416e-9aea-d3a41c712100', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvJ7aUDTbldDhpdde18SZSc; expires=Sat, 11-Nov-2023 06:59:17 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPVAaKnn_sYMpiSKsGCvBMQZZ59pA5QevT0FFE-HwQCgAszK8XJ2dJxzoJs8X_EeAFfmJLY_zlsYNedP4cq2KCut8GSOY2jz03od6LGXb9gcYcT-naAAhV0ZJxjarKKJMmR90Fx63tvj6zTYiN8yg3sV_RejeICznwsLdvh3KR9jkgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:16 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=c52017bb-6d12-4e63-839e-cf9a626803fa&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabb61d01c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ah5d73rDwd9JvKXZyVPYntYQpWstAQAAAEWQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:17 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:16 GMT', + 'Content-Length', + '1338' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709395521906240/file169709395533604146') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02d7b-301e-004d-59d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:17 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=458f4190-513b-4674-9ae5-2c0902f57332&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'a07d7f73-576f-4d8c-85da-73f68b690f00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-FdsXArABXa3cfrTrQ-AvnQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AsUrxsvk9-pEq08Qqp-9N33eeSdeAQAAAEWQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:18 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:17 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709395521906240/file169709395533604146') + .reply(200, "", [ + 'Content-Length', + '11', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:16 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAF0C00923E7"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02e95-301e-004d-67d9-fc2817000000', + 'x-ms-client-request-id', + '5356c309-d00f-4da6-a422-c99a15110985', + 'x-ms-version', + '2023-08-03', + 'x-ms-resource-type', + 'file', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 06:59:16 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'x-ms-owner', + '$superuser', + 'x-ms-group', + '$superuser', + 'x-ms-permissions', + 'rw-r-----', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-resource-type,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-owner,x-ms-group,x-ms-permissions,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:18 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709395521906240') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02ec7-301e-004d-07d9-fc2817000000', + 'x-ms-client-request-id', + 'b7e462eb-70c6-47fc-850c-0a85b213462a', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:18 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_customized_audience_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_customized_audience_should_work.js new file mode 100644 index 000000000000..999a28f6a853 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_customized_audience_should_work.js @@ -0,0 +1,340 @@ +let nock = require('nock'); + +module.exports.hash = "a18e5dbadcf8f745206c88f5a96f462c"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709395362309963","file":"file169709395374003824"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395362309963') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'ETag', + '"0x8DBCAF0BEDD8DCE"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f028c4-301e-004d-73d9-fc2817000000', + 'x-ms-client-request-id', + '0c335e5b-d081-4f84-bb04-13e890ca2288', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:14 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395362309963/file169709395374003824') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'ETag', + '"0x8DBCAF0BEF1B04C"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c201b-001f-0046-55d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'dfb8311f-9577-4b89-be23-cd5ac61cfa26', + 'Date', + 'Thu, 12 Oct 2023 06:59:13 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709395362309963/file169709395374003824', "Hello World") + .query(true) + .reply(202, "", [ + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c201c-001f-0046-56d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + '2da3c17e-1337-46d0-80bb-26a2a87bf84f', + 'Date', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709395362309963/file169709395374003824') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'ETag', + '"0x8DBCAF0BF14EB8E"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + 'aa5c201e-001f-0046-58d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'c0ff4aa6-af54-4150-922f-c50f324ef6f4', + 'Date', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'Content-Length', + '0' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fb5a9bd3-750d-4e22-8224-10863c222300', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-KD7pNszEQwWVbWur4gUn-Q' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AthAS42-QnlEoCe1wL5BvwU; expires=Sat, 11-Nov-2023 06:59:15 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP_KpTFcI6Fw9XqFBksFAHt6F-sqD4owHR9cpOuj59-0veAO7Joe3O47VqsZWlB0nYO1cH84Mxnq-HbO0UxojphDRcv8rqbVaQM_3UPiXHzKC-FMPQY0t12Dlqkj5h9brVgxnVkdBWfhP_CvZoGgwxNIkUiv20bPtRSOgSo8kymQ0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '7b45ceda-a09c-48a7-9b6a-672c49631400', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Apew7ILBOo9HqBQw7_Tsgvc; expires=Sat, 11-Nov-2023 06:59:15 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPEGV2QQ-ffjmSx5cxXoELO5Poj73OoyBEzamUjwIteadSabnKq2AkEU3VCch7II3iD4qMnt-IFQsfPIGRrw4pucZ54zBjunJBVvs1YtVcKgJKDGvr8mdS2_dC_Xtcm7NKWFMn-JW--9Hnd5zJqYaEjt1QcUoricnk1gM4x1Ewfr0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=a73e93dd-a99b-4955-a2f6-eea26191e7a5&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-1933af641500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-kd9RKafGnblCaXbp0FGvvg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgFMeUIodBJFh7aRCiDnnrZK9m_2AQAAAEKQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:15 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'Content-Length', + '1342' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709395362309963/file169709395374003824') + .reply(401, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02a03-301e-004d-1ad9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:15 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=07a578cb-75b6-45e4-b85a-57c9fe038690&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-1933ba641500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-pnGt9PnV6pHMJUnFKPvc2Q' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aju_EOQRyeRLtyghnDItKmreeSdeAQAAAEKQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:15 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709395362309963/file169709395374003824') + .reply(200, "", [ + 'Content-Length', + '11', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAF0BF14EB8E"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02a73-301e-004d-04d9-fc2817000000', + 'x-ms-client-request-id', + 'dee9419e-2808-4763-97ac-73763d6ea376', + 'x-ms-version', + '2023-08-03', + 'x-ms-resource-type', + 'file', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 06:59:14 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'x-ms-owner', + '$superuser', + 'x-ms-group', + '$superuser', + 'x-ms-permissions', + 'rw-r-----', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-resource-type,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-owner,x-ms-group,x-ms-permissions,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:15 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709395362309963') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f02a93-301e-004d-23d9-fc2817000000', + 'x-ms-client-request-id', + '372e79df-91ec-42fb-a622-65051a5deeec', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:15 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_default_audience_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_default_audience_should_work.js new file mode 100644 index 000000000000..e3c3a8b0e3dc --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient_nodejs_only/recording_datalakefileclient_default_audience_should_work.js @@ -0,0 +1,280 @@ +let nock = require('nock'); + +module.exports.hash = "72030e7e4209dd325c14c56434cfa6e9"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem169709395197305704","file":"file169709395209101630"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395197305704') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:12 GMT', + 'ETag', + '"0x8DBCAF0BDE1ECFC"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0267c-301e-004d-51d9-fc2817000000', + 'x-ms-client-request-id', + '0a2e7133-f4a9-47d5-8f62-bfc4947798de', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:12 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem169709395197305704/file169709395209101630') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:13 GMT', + 'ETag', + '"0x8DBCAF0BE3D445A"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2004-001f-0046-3fd9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'f7fd99ff-98bb-40aa-aa29-314cc08430b4', + 'Date', + 'Thu, 12 Oct 2023 06:59:12 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709395197305704/file169709395209101630', "Hello World") + .query(true) + .reply(202, "", [ + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'aa5c2011-001f-0046-4cd9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + 'dc2367d8-8b6d-4a88-884a-101ab512bf4a', + 'Date', + 'Thu, 12 Oct 2023 06:59:12 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem169709395197305704/file169709395209101630') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:13 GMT', + 'ETag', + '"0x8DBCAF0BE618087"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + 'aa5c2016-001f-0046-51d9-fcd37c000000', + 'x-ms-version', + '2023-08-03', + 'x-ms-client-request-id', + '695de7cf-820d-4f42-855e-14cb4044469d', + 'Date', + 'Thu, 12 Oct 2023 06:59:13 GMT', + 'Content-Length', + '0' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-2064edde0a00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-IXraZ2HjLUeP8Gw2HWKfcg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Agfv1kZawmpIuNTO_9Hd5f8; expires=Sat, 11-Nov-2023 06:59:13 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPs7LoTxpTNxja6RQm6OXH2cMubb0EVkaoL74sqKhhi-AMUl983jfeRqpZhd3ZXVneTPsRwQBL6_xrqRbcPle_hDXrU5lNOY25mpopnCuZ_MUDVurABnZaEEj0KMglfXLN07jZEIUV1DtZ6PrbwmeVMkfIUQvzzCM8qbil1VNo7s0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:13 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0dfe5555-fda6-416e-9aea-d3a4c6702100', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aj-sQeBhyRNLuGkDtSVvoyI; expires=Sat, 11-Nov-2023 06:59:14 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPuVpvC8ndVLp6yH0wc_D-WdBDC5lgkuTZJ_sMctg2JUF31_iiKCR0pKoVOa02fvR9PCGvZyyCkjBzH8eQh3Xx5aCAia-_wbvv4u9c-HePdWZS8h87MBwEaO24T3_lzNXmSvXRjKPvLR_CHbtvDJn8y5j9O4XWhjf93Qj-o4NPuWMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:13 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=5ebf6984-1cff-4437-8abc-1a483ab6b7ae&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fb5a9bd3-750d-4e22-8224-108623222300', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-n9N0YAfS4A0hkhdPcUu5SA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AnPfWxUJbb9FrZyh6PxlIcjeeSdeAQAAAEGQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:14 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:13 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem169709395197305704/file169709395209101630') + .reply(200, "", [ + 'Content-Length', + '11', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Thu, 12 Oct 2023 06:59:13 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8DBCAF0BE618087"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0284d-301e-004d-05d9-fc2817000000', + 'x-ms-client-request-id', + 'aa18e27f-f8fe-4fd8-8f5e-3c1330be1071', + 'x-ms-version', + '2023-08-03', + 'x-ms-resource-type', + 'file', + 'x-ms-creation-time', + 'Thu, 12 Oct 2023 06:59:13 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'x-ms-owner', + '$superuser', + 'x-ms-group', + '$superuser', + 'x-ms-permissions', + 'rw-r-----', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-resource-type,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,x-ms-owner,x-ms-group,x-ms-permissions,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:14 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem169709395197305704') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0288b-301e-004d-3dd9-fc2817000000', + 'x-ms-client-request-id', + '1110ae0d-3e3c-4934-8ec7-901510bdbf18', + 'x-ms-version', + '2023-08-03', + 'Date', + 'Thu, 12 Oct 2023 06:59:14 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_bearer_token_challenge_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..a5ecdb49a973 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_bearer_token_challenge_should_work.js @@ -0,0 +1,366 @@ +let nock = require('nock'); + +module.exports.hash = "87624a74700478a752d66879ac3e7c2b"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0dfe5555-fda6-416e-9aea-d3a4ce712100', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AicL-nl5RyRPutgdCkm1NLQ; expires=Sat, 11-Nov-2023 06:59:25 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPQGGytUWXI9Samqgbqb1D62jRm7p_eiTmSoy4nbPBMzUQr42Lguq1hGBqjNiBgJtaUHJapE20AsrIMpMN6GD6P_ZTUaqASs91UHIowZkZZjr12Dq--WKwCGRFhe2b8LfoZcKByoZnQbsNTxashStAGgi4YXAKmgDLfFufP6Kj2zUgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:24 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-193364651500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-sf2QVpBPOLn5ntTqWZscng' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AmanTEBJvE1FhNGeMLRarlM; expires=Sat, 11-Nov-2023 06:59:25 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPp_baSAlbskJ_C1WCIY6MKhPA2IxgcctNWfeiksszcjAgUJfzqwYOsxXeK30Y72T68mwCo44mvWLDRmqsgtjydCbgPXgsKpyb1bEo7caxgkhp52Qg_rcJUmn6ODJ1rE3HM48L-cLLZ4zZsztL381w3bjB9wdjHSNgfrPUmcPU6sUgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:24 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=6b7b5a29-7a26-4ac6-9263-c1b34e8d656a&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-206435e00a00', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-V1vUJUZbEpw5myA391VAdQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AjZlpudlwFBIo1-cixGRHECt-wbLAQAAAE2QudwOAAAA; expires=Sat, 11-Nov-2023 06:59:25 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:24 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:43f03955-301e-004d-06d9-fc2817000000\nTime:2023-10-12T06:59:25.8806219ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f03955-301e-004d-06d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:25 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:43f0396e-301e-004d-1fd9-fc2817000000\nTime:2023-10-12T06:59:25.9785671ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0396e-301e-004d-1fd9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:25 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabb0fd11c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ar2nvY-wW_xOq9SujGslBDs; expires=Sat, 11-Nov-2023 06:59:26 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPr0woZ32Nbyrba9Q3vyn27kHfsryn3Y-VHB0j7oAdwiMGbwqx_um8cVAHq1_EDaBI_CLyPosBns97ncct8f47x2hsDCAWfd95VCm67t_s3xC7J2JgF8f1a2tXzL93TKlsaelyY94U-vZuIRO55dqk6Y0B6bHGe7PLyS-rI94Up1MgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:25 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'de7adffb-85c8-417d-b518-d414f63d4900', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApXm8VKfOgBBgsgpwlEkb88; expires=Sat, 11-Nov-2023 06:59:26 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPAHltxM5bIkBUBdulXQvwsNqxPA987HPpQvF757-8HxmPbWxsnNkOMD7PKEYxTnIxArf5nSGiXmzLW4SmiU5ccUdTuR-XD6XptVTPIyL88E2Vms9DonZuWzXy1EflVBp4OHtrs0rt0NIxsRj5egZweVIHIATY8LRGIv3bnOiS0A8gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:25 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=cd3577cb-1d0c-4e9b-b469-611246635322&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabb15d11c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aln4xx0gwRBLnHnH5VoZVkg; expires=Sat, 11-Nov-2023 06:59:26 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:25 GMT', + 'Content-Length', + '1338' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:43f03a0e-301e-004d-38d9-fc2817000000\nTime:2023-10-12T06:59:26.3793407ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f03a0e-301e-004d-38d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:26 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=3a408939-e824-48ed-b66f-5e805f78f46e&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabb1cd11c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AnfN6sCP5WNDrsbF9TxBCfI; expires=Sat, 11-Nov-2023 06:59:26 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:25 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(200, "1.0falsefalsefalsefalse1.0truetruetrue71.0falsefalseDELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH***86400true7falsefalse", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f03a60-301e-004d-08d9-fc2817000000', + 'x-ms-client-request-id', + '3f6b0529-3ca6-4bd8-8d22-1d49ead27eb3', + 'x-ms-version', + '2023-08-03', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:26 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_customized_audience_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_customized_audience_should_work.js new file mode 100644 index 000000000000..ef48eb1308c1 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_customized_audience_should_work.js @@ -0,0 +1,208 @@ +let nock = require('nock'); + +module.exports.hash = "bac7983f92e64da234920b69a9fae86f"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabbf2d01c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Amt9Srf8sU1JqKzDDcfsBtQ; expires=Sat, 11-Nov-2023 06:59:24 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPbx98-RhO3j-1VSljbeM-WflphKkesTu1uxjqiHKaDxfPr7RpSqqpbc4b35ITFlDgkS72JKUiiDmpwD4SZVyAZJCV_8piWPTdwRve_Irn6l6yKbAYici-Das8gQvtiX0N8RLQ2S4UqnAeoarVX9hjiH6upiTS35tYSLD1LCltiycgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:23 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '896146af-198a-4045-99ee-19334f651500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-ECKNrzK1TSgLvtc_JfqgTw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Apohn1TlVRpKgW0aFiAVSK4; expires=Sat, 11-Nov-2023 06:59:24 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPXpjXyaSV6cI-xY-kzVz082rnh5o_kH-kuMG3Fs8eN2c2kMKgP4tevWIONEzW3H1TZodpFGNVz_c1XwrhwbRgkxx4X6m-ORN-EnA4DSebYZy_p-Dx813vT1mCJZHXEGe6LtxpDQYYnS1MW5aoUwBdWdpSZg7SrutodGbbwR5Lk9MgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:23 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=b84de8b7-35ba-4720-811d-0f7199a608a3&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6718ab0f-fe99-408d-b5a0-9d8188ca1300', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-Ql3N-ZIoq-w5Ey6_S8W1jQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgDHfgw6Qi5LsOVzPDZxiuRK9m_2AQAAAEuQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:24 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:23 GMT', + 'Content-Length', + '1342' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:43f03820-301e-004d-60d9-fc2817000000\nTime:2023-10-12T06:59:24.9761319ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f03820-301e-004d-60d9-fc2817000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,WWW-Authenticate,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Thu, 12 Oct 2023 06:59:24 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=32d4446f-7432-40d8-8034-736bc77b4fdc&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6718ab0f-fe99-408d-b5a0-9d8194ca1300', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-5eS1g3zpv2qsbNP6IMpb2w' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ar_f83YdF2lKpUxewkbxKIY; expires=Sat, 11-Nov-2023 06:59:25 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:24 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(200, "1.0falsefalsefalsefalse1.0truetruetrue71.0falsefalseDELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH***86400true7falsefalse", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f0388e-301e-004d-4cd9-fc2817000000', + 'x-ms-client-request-id', + '41befb02-9ab4-4cc7-9ff6-dbc60b81714a', + 'x-ms-version', + '2023-08-03', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:25 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_default_audience_should_work.js b/sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_default_audience_should_work.js new file mode 100644 index 000000000000..badbf74e6bef --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakeserviceclient/recording_datalakeserviceclient_default_audience_should_work.js @@ -0,0 +1,143 @@ +let nock = require('nock'); + +module.exports.hash = "915c063aafdf23a8825d6f0ca43aa7ae"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '0dfe5555-fda6-416e-9aea-d3a4a7712100', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvFsPqNkMMxPhIk3N1a8bSU; expires=Sat, 11-Nov-2023 06:59:23 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPlWnYqBimThehkjkvsCvhBdfW-23gM_Gj2rPkDoizHqhRdYHg0ybReGMuve1kQ5PBxvK6I-_XJVOHXDRuwgGfc2eP_fWh6vDF0LPhfFfpwZLMIDyFF_Cw7MlQ4hOn_7-CGy33cbIWHXZ11GOG5jh4eIPFa-iUNi2uZ52y45SJaTIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:22 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabbedd01c00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApQdsA-i9O1IlP8GAkyHM7A; expires=Sat, 11-Nov-2023 06:59:23 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPf6lhe078c9Q39LqsQNL80NDCpdyw_QqbgUOgyrNGaQIuHrKdtRtbycVvLkYmAJh-aaKcXnGodyVtGUOCWMBvJOlrAuYc5MOv1CnT1oZCLTVVMeF7khv5SEyJovqiagJ4UCIkSjYfItxA6q82dcBOUeXyN2Qcq2qtMTTSq4qUsGsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:23 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=6d29c8dd-ab43-4608-9daf-94d75de836f4&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6718ab0f-fe99-408d-b5a0-9d817cca1300', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-lFfmljO2-fxlCzahb0KiRg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aj38f8R-uw5Lm1NY96AAtJveeSdeAQAAAEuQudwOAAAA; expires=Sat, 11-Nov-2023 06:59:24 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Thu, 12 Oct 2023 06:59:23 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(200, "1.0falsefalsefalsefalse1.0truetruetrue71.0falsefalseDELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH***86400true7falsefalse", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '43f03712-301e-004d-5ed9-fc2817000000', + 'x-ms-client-request-id', + '90613506-f313-44ad-ba4b-e82b750f8a50', + 'x-ms-version', + '2023-08-03', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Thu, 12 Oct 2023 06:59:24 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md b/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md index 370eb47c6df8..f6f73bdbff62 100644 --- a/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md +++ b/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md @@ -1130,6 +1130,9 @@ export function generateDataLakeSASQueryParameters(dataLakeSASSignatureValues: D // @public export function generateDataLakeSASQueryParameters(dataLakeSASSignatureValues: DataLakeSASSignatureValues, userDelegationKey: UserDelegationKey, accountName: string): SASQueryParameters; +// @public (undocumented) +export function getDataLakeServiceAccountAudience(storageAccountName: string): string; + export { HttpHeaders } export { HttpOperationResponse } @@ -2110,11 +2113,17 @@ export class StorageBrowserPolicyFactory implements RequestPolicyFactory { create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageBrowserPolicy; } +// @public +export enum StorageDataLakeAudience { + StorageOAuthScopes = "https://storage.azure.com/.default" +} + // @public (undocumented) export const StorageOAuthScopes: string | string[]; // @public export interface StoragePipelineOptions { + audience?: string; httpClient?: IHttpClient; keepAliveOptions?: KeepAliveOptions; proxyOptions?: ProxyOptions; diff --git a/sdk/storage/storage-file-datalake/src/Pipeline.ts b/sdk/storage/storage-file-datalake/src/Pipeline.ts index 7d9e27db6ebe..b5c52ddc1166 100644 --- a/sdk/storage/storage-file-datalake/src/Pipeline.ts +++ b/sdk/storage/storage-file-datalake/src/Pipeline.ts @@ -3,7 +3,6 @@ import { BaseRequestPolicy, - bearerTokenAuthenticationPolicy, deserializationPolicy, disableResponseDecompressionPolicy, generateClientRequestIdPolicy, @@ -40,6 +39,7 @@ import { StorageOAuthScopes, } from "./utils/constants"; import { getCachedDefaultHttpClient } from "./utils/cache"; +import { storageBearerTokenChallengeAuthenticationPolicy } from "./policies/StorageBearerTokenChallengeAuthenticationPolicy"; // Export following interfaces and types for customers who want to implement their // own RequestPolicy or HTTPClient @@ -140,6 +140,11 @@ export interface StoragePipelineOptions { * Configures the HTTP client to send requests and receive responses. */ httpClient?: IHttpClient; + /** + * The audience used to retrieve an AAD token. + * By default, audience 'https://storage.azure.com/.default' will be used. + */ + audience?: string; } /** @@ -184,7 +189,10 @@ export function newPipeline( factories.push( isTokenCredential(credential) ? attachCredential( - bearerTokenAuthenticationPolicy(credential, StorageOAuthScopes), + storageBearerTokenChallengeAuthenticationPolicy( + credential, + pipelineOptions.audience ?? StorageOAuthScopes + ), credential ) : credential diff --git a/sdk/storage/storage-file-datalake/src/generated/src/models/parameters.ts b/sdk/storage/storage-file-datalake/src/generated/src/models/parameters.ts index 6dd0bcc83a6e..61b655bc016e 100644 --- a/sdk/storage/storage-file-datalake/src/generated/src/models/parameters.ts +++ b/sdk/storage/storage-file-datalake/src/generated/src/models/parameters.ts @@ -114,7 +114,7 @@ export const timeout: OperationQueryParameter = { export const version: OperationParameter = { parameterPath: "version", mapper: { - defaultValue: "2023-08-03", + defaultValue: "2023-11-03", isConstant: true, serializedName: "x-ms-version", type: { diff --git a/sdk/storage/storage-file-datalake/src/generated/src/storageClientContext.ts b/sdk/storage/storage-file-datalake/src/generated/src/storageClientContext.ts index b588baddd562..bb61e7fc2907 100644 --- a/sdk/storage/storage-file-datalake/src/generated/src/storageClientContext.ts +++ b/sdk/storage/storage-file-datalake/src/generated/src/storageClientContext.ts @@ -10,7 +10,7 @@ import * as coreHttp from "@azure/core-http"; import { StorageClientOptionalParams } from "./models"; const packageName = "azure-storage-datalake"; -const packageVersion = "12.15.0"; +const packageVersion = "12.15.1"; export class StorageClientContext extends coreHttp.ServiceClient { url: string; @@ -49,7 +49,7 @@ export class StorageClientContext extends coreHttp.ServiceClient { this.url = url; // Assigning values to Constant parameters - this.version = options.version || "2023-08-03"; + this.version = options.version || "2023-11-03"; this.resource = options.resource || "filesystem"; } } diff --git a/sdk/storage/storage-file-datalake/src/models.ts b/sdk/storage/storage-file-datalake/src/models.ts index 203a5bb742ef..852759b15b1b 100644 --- a/sdk/storage/storage-file-datalake/src/models.ts +++ b/sdk/storage/storage-file-datalake/src/models.ts @@ -1603,6 +1603,20 @@ export declare interface FileSystemEncryptionScope { preventEncryptionScopeOverride?: boolean; } +/** + * Defines the known cloud audiences for Storage. + */ +export enum StorageDataLakeAudience { + /** + * The OAuth scope to use to retrieve an AAD token for Azure Storage. + */ + StorageOAuthScopes = "https://storage.azure.com/.default", +} + +export function getDataLakeServiceAccountAudience(storageAccountName: string): string { + return `https://${storageAccountName}.dfs.core.windows.net/.default`; +} + /** *********************************************************/ /** DataLakeLeaseClient option and response related models */ /** *********************************************************/ diff --git a/sdk/storage/storage-file-datalake/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.ts b/sdk/storage/storage-file-datalake/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.ts new file mode 100644 index 000000000000..02f76e39f984 --- /dev/null +++ b/sdk/storage/storage-file-datalake/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.ts @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AccessToken, GetTokenOptions, TokenCredential, URLBuilder } from "@azure/core-http"; +import { + BaseRequestPolicy, + RequestPolicy, + RequestPolicyFactory, + RequestPolicyOptions, +} from "@azure/core-http"; +import { HttpOperationResponse } from "@azure/core-http"; +import { WebResourceLike } from "@azure/core-http"; +import { delay } from "@azure/core-http"; + +/** + * A set of constants used internally when processing requests. + */ +const Constants = { + DefaultScope: "/.default", + /** + * Defines constants for use with HTTP headers. + */ + HeaderConstants: { + /** + * The Authorization header. + */ + AUTHORIZATION: "authorization", + }, +}; + +// #region Access Token Cycler + +/** + * A function that gets a promise of an access token and allows providing + * options. + * + * @param options - the options to pass to the underlying token provider + */ +type AccessTokenGetter = (options: GetTokenOptions) => Promise; + +interface TokenCyclerOptions { + /** + * The window of time before token expiration during which the token will be + * considered unusable due to risk of the token expiring before sending the + * request. + * + * This will only become meaningful if the refresh fails for over + * (refreshWindow - forcedRefreshWindow) milliseconds. + */ + forcedRefreshWindowInMs: number; + /** + * Interval in milliseconds to retry failed token refreshes. + */ + retryIntervalInMs: number; + /** + * The window of time before token expiration during which + * we will attempt to refresh the token. + */ + refreshWindowInMs: number; +} + +// Default options for the cycler if none are provided +const DEFAULT_CYCLER_OPTIONS: TokenCyclerOptions = { + forcedRefreshWindowInMs: 1000, // Force waiting for a refresh 1s before the token expires + retryIntervalInMs: 3000, // Allow refresh attempts every 3s + refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry +}; + +/** + * Converts an an unreliable access token getter (which may resolve with null) + * into an AccessTokenGetter by retrying the unreliable getter in a regular + * interval. + * + * @param getAccessToken - a function that produces a promise of an access + * token that may fail by returning null + * @param retryIntervalInMs - the time (in milliseconds) to wait between retry + * attempts + * @param timeoutInMs - the timestamp after which the refresh attempt will fail, + * throwing an exception + * @returns - a promise that, if it resolves, will resolve with an access token + */ +async function beginRefresh( + getAccessToken: () => Promise, + retryIntervalInMs: number, + timeoutInMs: number +): Promise { + // This wrapper handles exceptions gracefully as long as we haven't exceeded + // the timeout. + async function tryGetAccessToken(): Promise { + if (Date.now() < timeoutInMs) { + try { + return await getAccessToken(); + } catch { + return null; + } + } else { + const finalToken = await getAccessToken(); + + // Timeout is up, so throw if it's still null + if (finalToken === null) { + throw new Error("Failed to refresh access token."); + } + + return finalToken; + } + } + + let token: AccessToken | null = await tryGetAccessToken(); + + while (token === null) { + await delay(retryIntervalInMs); + + token = await tryGetAccessToken(); + } + + return token; +} + +/** + * Creates a token cycler from a credential, scopes, and optional settings. + * + * A token cycler represents a way to reliably retrieve a valid access token + * from a TokenCredential. It will handle initializing the token, refreshing it + * when it nears expiration, and synchronizes refresh attempts to avoid + * concurrency hazards. + * + * @param credential - the underlying TokenCredential that provides the access + * token + * @param scopes - the scopes to request authorization for + * @param tokenCyclerOptions - optionally override default settings for the cycler + * + * @returns - a function that reliably produces a valid access token + */ +function createTokenCycler( + credential: TokenCredential, + scopes: string | string[], + tokenCyclerOptions?: Partial +): AccessTokenGetter { + let refreshWorker: Promise | null = null; + let token: AccessToken | null = null; + + const options = { + ...DEFAULT_CYCLER_OPTIONS, + ...tokenCyclerOptions, + }; + + /** + * This little holder defines several predicates that we use to construct + * the rules of refreshing the token. + */ + const cycler = { + /** + * Produces true if a refresh job is currently in progress. + */ + get isRefreshing(): boolean { + return refreshWorker !== null; + }, + /** + * Produces true if the cycler SHOULD refresh (we are within the refresh + * window and not already refreshing) + */ + get shouldRefresh(): boolean { + return ( + !cycler.isRefreshing && + (token?.expiresOnTimestamp ?? 0) - options.refreshWindowInMs < Date.now() + ); + }, + /** + * Produces true if the cycler MUST refresh (null or nearly-expired + * token). + */ + get mustRefresh(): boolean { + return ( + token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now() + ); + }, + }; + + /** + * Starts a refresh job or returns the existing job if one is already + * running. + */ + function refresh(getTokenOptions: GetTokenOptions): Promise { + if (!cycler.isRefreshing) { + // We bind `scopes` here to avoid passing it around a lot + const tryGetAccessToken = (): Promise => + credential.getToken(scopes, getTokenOptions); + + // Take advantage of promise chaining to insert an assignment to `token` + // before the refresh can be considered done. + refreshWorker = beginRefresh( + tryGetAccessToken, + options.retryIntervalInMs, + // If we don't have a token, then we should timeout immediately + token?.expiresOnTimestamp ?? Date.now() + ) + .then((_token) => { + refreshWorker = null; + token = _token; + return token; + }) + .catch((reason) => { + // We also should reset the refresher if we enter a failed state. All + // existing awaiters will throw, but subsequent requests will start a + // new retry chain. + refreshWorker = null; + token = null; + throw reason; + }); + } + + return refreshWorker as Promise; + } + + return async (tokenOptions: GetTokenOptions): Promise => { + // + // Simple rules: + // - If we MUST refresh, then return the refresh task, blocking + // the pipeline until a token is available. + // - If we SHOULD refresh, then run refresh but don't return it + // (we can still use the cached token). + // - Return the token, since it's fine if we didn't return in + // step 1. + // + + if (cycler.mustRefresh) return refresh(tokenOptions); + + if (cycler.shouldRefresh) { + refresh(tokenOptions); + } + + return token as AccessToken; + }; +} +/** + * We will retrieve the challenge only if the response status code was 401, + * and if the response contained the header "WWW-Authenticate" with a non-empty value. + */ +function getChallenge(response: HttpOperationResponse): string | undefined { + const challenge = response.headers.get("WWW-Authenticate"); + if (response.status === 401 && challenge) { + return challenge; + } + return; +} + +/** + * Challenge structure + */ +interface Challenge { + authorization_uri: string; + resource_id: string; +} + +/** + * Converts: `Bearer a="b" c="d"`. + * Into: `[ { a: 'b', c: 'd' }]`. + * + * @internal + */ +function parseChallenge(challenge: string): any { + const bearerChallenge = challenge.slice("Bearer ".length); + const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x) => x); + const keyValuePairs = challengeParts.map((keyValue) => + (([key, value]) => ({ [key]: value }))(keyValue.trim().split("=")) + ); + // Key-value pairs to plain object: + return keyValuePairs.reduce((a, b) => ({ ...a, ...b }), {}); +} + +// #endregion + +/** + * Creates a new factory for a RequestPolicy that applies a bearer token to + * the requests' `Authorization` headers. + * + * @param credential - The TokenCredential implementation that can supply the bearer token. + * @param scopes - The scopes for which the bearer token applies. + */ + +export function storageBearerTokenChallengeAuthenticationPolicy( + credential: TokenCredential, + scopes: string | string[] +): RequestPolicyFactory { + // This simple function encapsulates the entire process of reliably retrieving the token + let getToken = createTokenCycler(credential, scopes); + + class StorageBearerTokenChallengeAuthenticationPolicy extends BaseRequestPolicy { + public constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions) { + super(nextPolicy, options); + } + + public async sendRequest(webResource: WebResourceLike): Promise { + if (!webResource.url.toLowerCase().startsWith("https://")) { + throw new Error( + "Bearer token authentication is not permitted for non-TLS protected (non-https) URLs." + ); + } + + const getTokenInternal = getToken; + const token = ( + await getTokenInternal({ + abortSignal: webResource.abortSignal, + tracingOptions: { + tracingContext: webResource.tracingContext, + }, + }) + ).token; + webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${token}`); + + const response = await this._nextPolicy.sendRequest(webResource); + + if (response?.status === 401) { + const challenge = getChallenge(response); + if (challenge) { + const challengeInfo: Challenge = parseChallenge(challenge); + const challengeScopes = challengeInfo.resource_id + Constants.DefaultScope; + const parsedAuthUri = URLBuilder.parse(challengeInfo.authorization_uri); + const pathSegments = parsedAuthUri.getPath()!.split("/"); + const tenantId = pathSegments[1]; + const getTokenForChallenge = createTokenCycler(credential, challengeScopes); + + const tokenForChallenge = ( + await getTokenForChallenge({ + abortSignal: webResource.abortSignal, + tracingOptions: { + tracingContext: webResource.tracingContext, + }, + tenantId: tenantId, + }) + ).token; + + getToken = getTokenForChallenge; + webResource.headers.set( + Constants.HeaderConstants.AUTHORIZATION, + `Bearer ${tokenForChallenge}` + ); + return this._nextPolicy.sendRequest(webResource); + } + } + + return response; + } + } + + return { + create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions) => { + return new StorageBearerTokenChallengeAuthenticationPolicy(nextPolicy, options); + }, + }; +} diff --git a/sdk/storage/storage-file-datalake/src/utils/constants.ts b/sdk/storage/storage-file-datalake/src/utils/constants.ts index 9b89d6f67462..bb2fe9f0c248 100644 --- a/sdk/storage/storage-file-datalake/src/utils/constants.ts +++ b/sdk/storage/storage-file-datalake/src/utils/constants.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export const SDK_VERSION: string = "12.15.0"; -export const SERVICE_VERSION: string = "2023-08-03"; +export const SDK_VERSION: string = "12.15.1"; +export const SERVICE_VERSION: string = "2023-11-03"; export const KB: number = 1024; export const MB: number = KB * 1024; diff --git a/sdk/storage/storage-file-datalake/swagger/README.md b/sdk/storage/storage-file-datalake/swagger/README.md index 1e0957ceeca6..9dcad1e69b04 100644 --- a/sdk/storage/storage-file-datalake/swagger/README.md +++ b/sdk/storage/storage-file-datalake/swagger/README.md @@ -20,7 +20,7 @@ disable-async-iterators: true add-credentials: false use-extension: "@autorest/typescript": "6.0.0-dev.20210223.1" -package-version: 12.15.0 +package-version: 12.15.1 ``` ## Customizations for Track 2 Generator @@ -347,11 +347,11 @@ directive: ]; ``` -### Update service version from "2023-05-03" to "2023-08-03" +### Update service version from "2023-05-03" to "2023-11-03" ```yaml directive: - from: swagger-document where: $.parameters.ApiVersionParameter - transform: $.enum = [ "2023-08-03" ]; + transform: $.enum = [ "2023-11-03" ]; ``` diff --git a/sdk/storage/storage-file-datalake/test/node/filesystemclient.spec.ts b/sdk/storage/storage-file-datalake/test/node/filesystemclient.spec.ts index ebe6fd02aedb..a60b4fc76a4b 100644 --- a/sdk/storage/storage-file-datalake/test/node/filesystemclient.spec.ts +++ b/sdk/storage/storage-file-datalake/test/node/filesystemclient.spec.ts @@ -8,22 +8,25 @@ import { Context } from "mocha"; import { DataLakeFileSystemClient, + DataLakeServiceClient, FileSystemSASPermissions, newPipeline, StorageSharedKeyCredential, } from "../../src"; -import { PublicAccessType } from "../../src/models"; -import { getDataLakeServiceClient, recorderEnvSetup } from "../utils"; +import { getDataLakeServiceAccountAudience, PublicAccessType } from "../../src/models"; +import { getDataLakeServiceClient, recorderEnvSetup, SimpleTokenCredential } from "../utils"; import { assertClientUsesTokenCredential } from "../utils/assert"; +import { DefaultAzureCredential } from "@azure/identity"; describe("DataLakeFileSystemClient Node.js only", () => { let fileSystemName: string; let fileSystemClient: DataLakeFileSystemClient; + let serviceClient: DataLakeServiceClient; let recorder: Recorder; beforeEach(async function (this: Context) { recorder = record(this, recorderEnvSetup); - const serviceClient = getDataLakeServiceClient(); + serviceClient = getDataLakeServiceClient(); fileSystemName = recorder.getUniqueName("filesystem"); fileSystemClient = serviceClient.getFileSystemClient(fileSystemName); await fileSystemClient.createIfNotExists(); @@ -34,6 +37,51 @@ describe("DataLakeFileSystemClient Node.js only", () => { await recorder.stop(); }); + it("DataLakeFileSystemClient default audience should work", async () => { + const fileSystemClientWithOAuthToken = new DataLakeFileSystemClient( + fileSystemClient.url, + new DefaultAzureCredential() + ); + const exist = await fileSystemClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("DataLakeFileSystemClient customized audience should work", async () => { + const fileSystemClientWithOAuthToken = new DataLakeFileSystemClient( + fileSystemClient.url, + new DefaultAzureCredential(), + { audience: getDataLakeServiceAccountAudience(serviceClient.accountName) } + ); + const exist = await fileSystemClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("DataLakeFileSystemClient bearer token challenge should work", async () => { + // Validate that bad audience should fail first. + const authToken = await new DefaultAzureCredential().getToken( + "https://badaudience.blob.core.windows.net/.default" + ); + const fileSystemClientWithPlainOAuthToken = new DataLakeFileSystemClient( + fileSystemClient.url, + new SimpleTokenCredential(authToken.token) + ); + + try { + await fileSystemClientWithPlainOAuthToken.exists(); + assert.fail("Should fail with 401"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 401); + } + + const fileSystemClientWithOAuthToken = new DataLakeFileSystemClient( + fileSystemClient.url, + new DefaultAzureCredential(), + { audience: "https://badaudience.dfs.core.windows.net/.default" } + ); + const exist = await fileSystemClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + it("getAccessPolicy", async () => { const result = await fileSystemClient.getAccessPolicy(); assert.ok(result.etag!.length > 0); diff --git a/sdk/storage/storage-file-datalake/test/node/pathclient.spec.ts b/sdk/storage/storage-file-datalake/test/node/pathclient.spec.ts index 1b80789be164..646ac299d864 100644 --- a/sdk/storage/storage-file-datalake/test/node/pathclient.spec.ts +++ b/sdk/storage/storage-file-datalake/test/node/pathclient.spec.ts @@ -12,8 +12,10 @@ import { AccessControlChanges, DataLakeFileClient, DataLakeFileSystemClient, + DataLakePathClient, DataLakeSASPermissions, DataLakeServiceClient, + getDataLakeServiceAccountAudience, PathAccessControlItem, PathPermissions, } from "../../src"; @@ -24,8 +26,10 @@ import { recorderEnvSetup, getDataLakeFileSystemClientWithSASCredential, getDataLakeServiceClientWithDefaultCredential, + SimpleTokenCredential, } from "../utils"; import { Test_CPK_INFO } from "../utils/fakeTestSecrets"; +import { DefaultAzureCredential } from "@azure/identity"; describe("DataLakePathClient Node.js only", () => { let fileSystemName: string; @@ -926,6 +930,108 @@ describe("DataLakePathClient Node.js only", () => { }); assert.deepStrictEqual(await bodyToString(response), csvContent); }); + + it("DataLakeFileClient default audience should work", async () => { + const fileClientWithOAuthToken = new DataLakeFileClient( + fileClient.url, + new DefaultAzureCredential() + ); + const exist = await fileClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("DataLakeFileClient customized audience should work", async () => { + const fileClientWithOAuthToken = new DataLakeFileClient( + fileClient.url, + new DefaultAzureCredential(), + { audience: getDataLakeServiceAccountAudience(serviceClient.accountName) } + ); + const exist = await fileClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("DataLakeFileClient bearer token challenge should work", async () => { + // Validate that bad audience should fail first. + const authToken = await new DefaultAzureCredential().getToken( + "https://badaudience.blob.core.windows.net/.default" + ); + const fileClientWithPlainOAuthToken = new DataLakeFileClient( + fileClient.url, + new SimpleTokenCredential(authToken.token) + ); + + try { + await fileClientWithPlainOAuthToken.exists(); + assert.fail("Should fail with 401"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 401); + } + + const fileClientWithOAuthToken = new DataLakeFileClient( + fileClient.url, + new DefaultAzureCredential(), + { audience: "https://badaudience.dfs.core.windows.net/.default" } + ); + const exist = await fileClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("DataLakeDirectoryClient default audience should work", async () => { + const directoryName = recorder.getUniqueName("directory"); + const directoryClient = fileSystemClient.getDirectoryClient(directoryName); + await directoryClient.createIfNotExists(); + + const directoryClientWithOAuthToken = new DataLakePathClient( + directoryClient.url, + new DefaultAzureCredential() + ).toDirectoryClient(); + const exist = await directoryClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("DataLakeDirectoryClient customized audience should work", async () => { + const directoryName = recorder.getUniqueName("directory"); + const directoryClient = fileSystemClient.getDirectoryClient(directoryName); + await directoryClient.createIfNotExists(); + + const directoryClientWithOAuthToken = new DataLakePathClient( + fileClient.url, + new DefaultAzureCredential(), + { audience: getDataLakeServiceAccountAudience(serviceClient.accountName) } + ).toDirectoryClient(); + const exist = await directoryClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("DataLakeDirectoryClient bearer token challenge should work", async () => { + const directoryName = recorder.getUniqueName("directory"); + const directoryClient = fileSystemClient.getDirectoryClient(directoryName); + await directoryClient.createIfNotExists(); + + // Validate that bad audience should fail first. + const authToken = await new DefaultAzureCredential().getToken( + "https://badaudience.blob.core.windows.net/.default" + ); + const directoryClientWithPlainOAuthToken = new DataLakePathClient( + fileClient.url, + new SimpleTokenCredential(authToken.token) + ).toDirectoryClient(); + + try { + await directoryClientWithPlainOAuthToken.exists(); + assert.fail("Should fail with 401"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 401); + } + + const directoryClientWithOAuthToken = new DataLakePathClient( + fileClient.url, + new DefaultAzureCredential(), + { audience: "https://badaudience.dfs.core.windows.net/.default" } + ).toDirectoryClient(); + const exist = await directoryClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); }); describe("DataLakePathClient setAccessControlRecursive Node.js only", () => { diff --git a/sdk/storage/storage-file-datalake/test/node/serviceclient.spec.ts b/sdk/storage/storage-file-datalake/test/node/serviceclient.spec.ts index 3af3ebb086c2..37dbf21a2f4b 100644 --- a/sdk/storage/storage-file-datalake/test/node/serviceclient.spec.ts +++ b/sdk/storage/storage-file-datalake/test/node/serviceclient.spec.ts @@ -5,8 +5,14 @@ import { record, Recorder } from "@azure-tools/test-recorder"; import { assert } from "chai"; import { Context } from "mocha"; -import { DataLakeServiceClient } from "../../src"; -import { recorderEnvSetup, getConnectionStringFromEnvironment } from "../utils"; +import { DataLakeServiceClient, getDataLakeServiceAccountAudience } from "../../src"; +import { + recorderEnvSetup, + getConnectionStringFromEnvironment, + getDataLakeServiceClient, + SimpleTokenCredential, +} from "../utils"; +import { DefaultAzureCredential } from "@azure/identity"; describe("DataLakeServiceClient", () => { let recorder: Recorder; @@ -19,6 +25,52 @@ describe("DataLakeServiceClient", () => { await recorder.stop(); }); + it("DataLakeServiceClient default audience should work", async () => { + const serviceClient = getDataLakeServiceClient(); + const datalakeServiceClientWithOAuthToken = new DataLakeServiceClient( + serviceClient.url, + new DefaultAzureCredential() + ); + await datalakeServiceClientWithOAuthToken.getProperties(); + }); + + it("DataLakeServiceClient customized audience should work", async () => { + const serviceClient = getDataLakeServiceClient(); + const datalakeServiceClientWithOAuthToken = new DataLakeServiceClient( + serviceClient.url, + new DefaultAzureCredential(), + { audience: getDataLakeServiceAccountAudience(serviceClient.accountName) } + ); + await datalakeServiceClientWithOAuthToken.getProperties(); + }); + + it("DataLakeServiceClient bearer token challenge should work", async () => { + const serviceClient = getDataLakeServiceClient(); + + // Validate that bad audience should fail first. + const authToken = await new DefaultAzureCredential().getToken( + "https://badaudience.blob.core.windows.net/.default" + ); + const datalakeServiceClientWithPlainOAuthToken = new DataLakeServiceClient( + serviceClient.url, + new SimpleTokenCredential(authToken.token) + ); + + try { + await datalakeServiceClientWithPlainOAuthToken.getProperties(); + assert.fail("Should fail with 401"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 401); + } + + const datalakeServiceClientWithOAuthToken = new DataLakeServiceClient( + serviceClient.url, + new DefaultAzureCredential(), + { audience: "https://badaudience.dfs.core.windows.net/.default" } + ); + await datalakeServiceClientWithOAuthToken.getProperties(); + }); + it("can be created from AccountConnString", async () => { const newClient = DataLakeServiceClient.fromConnectionString( getConnectionStringFromEnvironment(), diff --git a/sdk/storage/storage-file-datalake/test/utils/assert.ts b/sdk/storage/storage-file-datalake/test/utils/assert.ts index 666009af6a59..290f9882062a 100644 --- a/sdk/storage/storage-file-datalake/test/utils/assert.ts +++ b/sdk/storage/storage-file-datalake/test/utils/assert.ts @@ -7,5 +7,8 @@ import { StorageClient } from "../../src/StorageClient"; export function assertClientUsesTokenCredential(client: StorageClient): void { const factories = (client as any).pipeline.factories; const authPolicy = factories[factories.length - 1].create(); - assert.strictEqual(authPolicy.constructor.name, "BearerTokenAuthenticationPolicy"); + assert.strictEqual( + authPolicy.constructor.name, + "StorageBearerTokenChallengeAuthenticationPolicy" + ); } diff --git a/sdk/storage/storage-file-share/CHANGELOG.md b/sdk/storage/storage-file-share/CHANGELOG.md index 48091ee1e553..5dea11b45d12 100644 --- a/sdk/storage/storage-file-share/CHANGELOG.md +++ b/sdk/storage/storage-file-share/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 12.16.1 (Unreleased) + +### Features Added + +- Added support for service version 2023-11-03. +- Added support for indicating audience in StoragePipelineOptions. + ## 12.16.0 (2023-09-14) ### Features Added diff --git a/sdk/storage/storage-file-share/package.json b/sdk/storage/storage-file-share/package.json index f8aaaf2def9c..b8691af09af9 100644 --- a/sdk/storage/storage-file-share/package.json +++ b/sdk/storage/storage-file-share/package.json @@ -1,7 +1,7 @@ { "name": "@azure/storage-file-share", "sdk-type": "client", - "version": "12.16.0", + "version": "12.16.1", "description": "Microsoft Azure Storage SDK for JavaScript - File", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", diff --git a/sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_bad_audience_should_fail.js b/sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_bad_audience_should_fail.js new file mode 100644 index 000000000000..1db97bd04d06 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_bad_audience_should_fail.js @@ -0,0 +1,235 @@ +let nock = require('nock'); + +module.exports.hash = "74655b3f8b1bae923cf341c6d929a89c"; + +module.exports.testInfo = {"uniqueName":{"share":"share169717965394904813","dir":"dir169717965405809475"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965394904813') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:34 GMT', + 'ETag', + '"0x8DBCBB847B8AEAD"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826fe-a01a-003b-50a1-fdd685000000', + 'x-ms-client-request-id', + '565d19be-3dec-419f-91d9-da1074fb5fa7', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:33 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965394904813/dir169717965405809475') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:34 GMT', + 'ETag', + '"0x8DBCBB847C9FFE0"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82700-a01a-003b-51a1-fdd685000000', + 'x-ms-client-request-id', + 'a1d20be5-56d7-4946-a3c7-73c4329239b8', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:34.1898720Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:34.1898720Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:34.1898720Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:33 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-20649c112100', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-P_kdDfMEKtm_T9o2SGrkLA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Al7H9RKoUBxEgvVF060k-2c; expires=Sun, 12-Nov-2023 06:47:34 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP5NVTGdD4D4vT6phNUMQmrEmF30RxxaSBb7oNwD6RaJypdiRCqAfLqL4cQDfN0jno6qAsyXjGNFIJNqgvJ0KGodyoguQydFKWUXprhjhLssxhONeBilCcD2wwVnMKPPRTL-1mV6n9KNOd2YuABzakzeXiNoCgEWl8f33K1aAX_0EgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:34 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '593924ce-c021-4ad7-9112-05c1a48b2800', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AlPcylpBbNxNu75BbJNeS3Q; expires=Sun, 12-Nov-2023 06:47:34 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPFeJ8KACgcpEFy8yawGuHNpDK9qInGeEb0QO1mBOdtCjcrE8H3LzVmcLJU5T-rf6DjXbldvhbe2skDcitWISOM1XDvKrJXIITmnI_GIxAgJj7201dS9LJIbY_95Ho-STyTIhURiO1TPxKjEdX6cyMKqF3EVw3bv4huPgZACiykOggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:34 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=6e5035aa-f317-4abb-9a12-8f5b1a039b21&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '593924ce-c021-4ad7-9112-05c1a98b2800', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AsiWXpYUbKBElHaVxE6J1WDfAfuwAQAAAAXfutwOAAAA; expires=Sun, 12-Nov-2023 06:47:34 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:34 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share169717965394904813/dir169717965405809475') + .query(true) + .reply(403, "AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:ecc82702-a01a-003b-52a1-fdd685000000\nTime:2023-10-13T06:47:34.8829222ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '426', + 'Content-Type', + 'application/xml', + 'Vary', + 'Origin', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82702-a01a-003b-52a1-fdd685000000', + 'x-ms-error-code', + 'AuthenticationFailed', + 'Date', + 'Fri, 13 Oct 2023 06:47:34 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717965394904813/dir169717965405809475') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82703-a01a-003b-53a1-fdd685000000', + 'x-ms-client-request-id', + 'bc9a65ad-df48-453b-937b-f5b7f29e5188', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:34 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717965394904813') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82704-a01a-003b-54a1-fdd685000000', + 'x-ms-client-request-id', + 'e2bee01b-ede4-4192-b53f-ef3586dd8ef9', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:34 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_customized_audience_should_work.js b/sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_customized_audience_should_work.js new file mode 100644 index 000000000000..da07af896f29 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_customized_audience_should_work.js @@ -0,0 +1,259 @@ +let nock = require('nock'); + +module.exports.hash = "fd81147e344e6d035d3390711fb50fa1"; + +module.exports.testInfo = {"uniqueName":{"share":"share169717965274506416","dir":"dir169717965285305260"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965274506416') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:32 GMT', + 'ETag', + '"0x8DBCBB84700EB42"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826f1-a01a-003b-48a1-fdd685000000', + 'x-ms-client-request-id', + '54fd2522-aad7-4bf3-b5bf-d8f0a28fed3b', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:32 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965274506416/dir169717965285305260') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:32 GMT', + 'ETag', + '"0x8DBCBB84711C881"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826f3-a01a-003b-49a1-fdd685000000', + 'x-ms-client-request-id', + '7a37c7f4-e1a3-4c99-ae57-7804f9d6e7d3', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:32.9825921Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:32.9825921Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:32.9825921Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:32 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '52078f1a-9f5b-4a6e-bf4b-7f9ab19d3000', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-yiAaVMleWcy8wPTaBhnfng' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ai3TwY1eWjFPkcr5l0wdQBw; expires=Sun, 12-Nov-2023 06:47:33 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPSxATXSN5f1Y0wRFHhxKRjiRWUCa3OjwY1c11k-nYaKbvK07Win0P7ma-D3I1Chfi069oxaKmzqMAiN5SiG1XsT0toB8J0ypmXJ4It68jq0Kt5brH2IvyaPyNinq_ZA5__qYy3SlYRrOdSdCrivK98u5vmW-kI81zWxGeJGUHuOIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:32 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '52078f1a-9f5b-4a6e-bf4b-7f9ab59d3000', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-Y0nuoP1GbTNGJ3Nd1LrdTA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AtrWtEagrhNOokLU83V-UdE; expires=Sun, 12-Nov-2023 06:47:33 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPwDMFz4DLiypYveK3h2P0zfujCcYlcKcq9a6YaGoaGq673NCZJz1hE1Nc2NXWgdt2h1gYCC7HMERkD0vknErLHf2wpSeUWagtUzO3zGdvJDvG9ZcaWXOzxMafk0Et8XskqbRqovjpFZ4VzymIjtGRvObpeKCPxxu1RyZ0-IWVY4cgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:33 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=fd087088-6631-4587-a548-670ad61cb333&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '4441e1ad-16ea-43e6-9046-4d5d331d1500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-U7RHgtxQzB1JwCoQuCBdHg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AtB0h0U3ACZFmcFq9dqnioWZhkDTAQAAAAXfutwOAAAA; expires=Sun, 12-Nov-2023 06:47:33 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:33 GMT', + 'Content-Length', + '1337' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share169717965274506416/dir169717965285305260') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:32 GMT', + 'ETag', + '"0x8DBCBB84711C881"', + 'Vary', + 'Origin', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826fb-a01a-003b-4da1-fdd685000000', + 'x-ms-client-request-id', + '74a2d7bc-1725-4815-8452-fb1ec40fb490', + 'x-ms-version', + '2023-11-03', + 'x-ms-server-encrypted', + 'true', + 'x-ms-file-change-time', + '2023-10-13T06:47:32.9825921Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:32.9825921Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:32.9825921Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'Date', + 'Fri, 13 Oct 2023 06:47:33 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717965274506416/dir169717965285305260') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826fc-a01a-003b-4ea1-fdd685000000', + 'x-ms-client-request-id', + '952415cc-92a5-4be7-8715-8213060fa5f4', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:33 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717965274506416') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826fd-a01a-003b-4fa1-fdd685000000', + 'x-ms-client-request-id', + '9490e079-a87e-4572-b8e4-5331564fa9f5', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:33 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_default_audience_should_work.js b/sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_default_audience_should_work.js new file mode 100644 index 000000000000..b45462ec42f4 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/directoryclient_nodejs_only/recording_default_audience_should_work.js @@ -0,0 +1,257 @@ +let nock = require('nock'); + +module.exports.hash = "2d9da7d68093ea5d85a073f563f9c46b"; + +module.exports.testInfo = {"uniqueName":{"share":"share169717964938401215","dir":"dir169717965008303012"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717964938401215') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:30 GMT', + 'ETag', + '"0x8DBCBB8455686E1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826e2-a01a-003b-41a1-fdd685000000', + 'x-ms-client-request-id', + '238b6157-91bd-49be-85fe-f6fea88f1750', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:29 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717964938401215/dir169717965008303012') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:30 GMT', + 'ETag', + '"0x8DBCBB8456C963C"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826e5-a01a-003b-42a1-fdd685000000', + 'x-ms-client-request-id', + '4ef3da37-66db-48b1-9681-75850df8a16a', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:30.2222396Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:30.2222396Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:30.2222396Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:29 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '8507ac40-ed5a-4f82-b2f0-30018a040b00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AkzC0uUcSuhKgOTDhUEcvk4; expires=Sun, 12-Nov-2023 06:47:30 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPwR4F8CMq2i1Jn-bYD53YVps5EcvN0tpq_Tz_4mZt0humGKtTbSA0YkmMKBfhclIwHC-bSUDf8_2WJABc8i6YosydaI7UyYmLQH0MWNANZUNbhX0yoTUN8ywXr-b14OXVO3qaKtGP5FiyqOA7VWpf1wltWjfRAyQW0V_UMKjqWk4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:30 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '52078f1a-9f5b-4a6e-bf4b-7f9a909d3000', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-vKoIIHLj7BIKV3mzRHYyIw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgvW7w2yXW5OifoIzp_WTj0; expires=Sun, 12-Nov-2023 06:47:30 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPmhKySEMwxkWZPWW4F-hAtCrmMA0el4V6S1VwekNX5R9rQWRCiwOYMxjScOZhnLhI9Wst9a6CVh6Mkv4sz71qakb7_F2q5DdjYcNcrnNeR1xRKnFbz61jegjJiVu4g0plRO7vkyW_VgDp69OGp_QApsWqrpJRKEFlYc71r6hm4CkgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:30 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=fd55a648-2a74-4250-87fb-8c5229168767&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '4441e1ad-16ea-43e6-9046-4d5d181d1500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-0CE2lLDmfS9cDJX04HPvgw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgmHttd3AhhImr-_a7e1DQneeSdeAQAAAALfutwOAAAA; expires=Sun, 12-Nov-2023 06:47:31 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:31 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share169717964938401215/dir169717965008303012') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:30 GMT', + 'ETag', + '"0x8DBCBB8456C963C"', + 'Vary', + 'Origin', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826eb-a01a-003b-43a1-fdd685000000', + 'x-ms-client-request-id', + 'bf2a3d00-ee9c-4c25-a05f-010030c5a5df', + 'x-ms-version', + '2023-11-03', + 'x-ms-server-encrypted', + 'true', + 'x-ms-file-change-time', + '2023-10-13T06:47:30.2222396Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:30.2222396Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:30.2222396Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'Date', + 'Fri, 13 Oct 2023 06:47:32 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717964938401215/dir169717965008303012') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826ef-a01a-003b-46a1-fdd685000000', + 'x-ms-client-request-id', + 'f2657c00-4674-46a8-b245-2c5907bf8f88', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:32 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717964938401215') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc826f0-a01a-003b-47a1-fdd685000000', + 'x-ms-client-request-id', + '67acba37-e834-4035-883b-cace80c9f875', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:32 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_bad_audience_should_fail.js b/sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_bad_audience_should_fail.js new file mode 100644 index 000000000000..9d4216ba69cd --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_bad_audience_should_fail.js @@ -0,0 +1,253 @@ +let nock = require('nock'); + +module.exports.hash = "13b4e07523e093e6b8f8368c93bad84c"; + +module.exports.testInfo = {"uniqueName":{"share":"share169717965759500200","dir":"dir169717965770303146","file":"file169717965781203455"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965759500200') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:37 GMT', + 'ETag', + '"0x8DBCBB849E4DA3D"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82713-a01a-003b-5fa1-fdd685000000', + 'x-ms-client-request-id', + 'f87872fe-9438-4716-9cd4-da26c950fa9c', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:37 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965759500200/dir169717965770303146') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:37 GMT', + 'ETag', + '"0x8DBCBB849F600C4"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82715-a01a-003b-60a1-fdd685000000', + 'x-ms-client-request-id', + '6c43bd8b-5563-472d-8fa0-ddb6415201b0', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:37.8336964Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:37.8336964Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:37.8336964Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:37 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965759500200/dir169717965770303146/file169717965781203455') + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:37 GMT', + 'ETag', + '"0x8DBCBB84A06A009"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82716-a01a-003b-61a1-fdd685000000', + 'x-ms-client-request-id', + '3a9923ae-a43c-4bb5-8430-7d3301b9890c', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:37.9426313Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:37.9426313Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:37.9426313Z', + 'x-ms-file-permission-key', + '4614121289425226539*16764736045797335973', + 'x-ms-file-attributes', + 'Archive', + 'x-ms-file-id', + '11529285414812647424', + 'x-ms-file-parent-id', + '13835128424026341376', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:37 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '4441e1ad-16ea-43e6-9046-4d5d7a1d1500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-QckeHGt5aFPwe2i0gtgHZw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ArK2ZQOAgypPmfmoVgXUYFY; expires=Sun, 12-Nov-2023 06:47:38 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPnbpsbwwZNZ8U7IqOmDwRInRAmseglFToOCs7zvz6c98kWwUm-l8sTzGb0ssitjA9t_pFYTbZbziqfLojGdh8qhT88e_mLnwcSik1YzvMnElepm8_5rOQSJ_67rkQ6JlpPPOymRL7si72uRkIlhAw6itoMrEdWdCSLp3RurP8BTIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:37 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'e41ea307-61f5-46f8-b5e4-3f3bcb480700', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-lEniMJ9C6NhQaKwPoRCRXQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApxI6BIps5tEq-RR24XyGAE; expires=Sun, 12-Nov-2023 06:47:38 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPOpdRLnPcyZ9nTBaYN6WC-Zvkb2iVhQlGbbRMOhr1lOfrwO86ld91OwdYxzfsaL96lpGdlehw1VZpbIvBSWjFL4nWszyD8d9VRwo4c2UDibA2MUTfB9VqZdhh_FKaX17BNS-od2ARfO3jcvRdmXMQN6ng6ajn5sxquaqB7IB6mGAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:38 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=1c80c780-6d3d-4e4b-a9aa-29412c2448dc&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6919e70c-adbf-4d71-be62-de8560bf5b00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AnLAXFb4HI1BmLmVrCrrEwHfAfuwAQAAAArfutwOAAAA; expires=Sun, 12-Nov-2023 06:47:38 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:38 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .head('/share169717965759500200/dir169717965770303146/file169717965781203455') + .reply(403, "", [ + 'Transfer-Encoding', + 'chunked', + 'Vary', + 'Origin', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82719-a01a-003b-63a1-fdd685000000', + 'x-ms-error-code', + 'AuthenticationFailed', + 'Date', + 'Fri, 13 Oct 2023 06:47:38 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717965759500200') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8271c-a01a-003b-66a1-fdd685000000', + 'x-ms-client-request-id', + '9ca48392-06b4-4f3a-8c6d-8a93a8d47375', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:38 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_customized_audience_should_work.js b/sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_customized_audience_should_work.js new file mode 100644 index 000000000000..484fb676973b --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_customized_audience_should_work.js @@ -0,0 +1,283 @@ +let nock = require('nock'); + +module.exports.hash = "d09c14572973f21f4f7cd0ba08b20089"; + +module.exports.testInfo = {"uniqueName":{"share":"share169717965622407664","dir":"dir169717965633504456","file":"file169717965644404863"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965622407664') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:36 GMT', + 'ETag', + '"0x8DBCBB849139F24"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8270d-a01a-003b-5aa1-fdd685000000', + 'x-ms-client-request-id', + '7411f4d7-d624-4696-a302-b3fef4d2cb2c', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:36 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965622407664/dir169717965633504456') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:36 GMT', + 'ETag', + '"0x8DBCBB849253C1B"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8270f-a01a-003b-5ba1-fdd685000000', + 'x-ms-client-request-id', + '68f095dd-6401-4d94-9b85-4ca01667a212', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:36.4655131Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:36.4655131Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:36.4655131Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:36 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965622407664/dir169717965633504456/file169717965644404863') + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:36 GMT', + 'ETag', + '"0x8DBCBB84935DB67"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82710-a01a-003b-5ca1-fdd685000000', + 'x-ms-client-request-id', + '75a4defb-69ea-46ec-8131-83888af699ae', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:36.5744487Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:36.5744487Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:36.5744487Z', + 'x-ms-file-permission-key', + '4614121289425226539*16764736045797335973', + 'x-ms-file-attributes', + 'Archive', + 'x-ms-file-id', + '11529285414812647424', + 'x-ms-file-parent-id', + '13835128424026341376', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:36 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '4441e1ad-16ea-43e6-9046-4d5d641d1500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-smlmUvo0USMOLn2j8VP7DA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ag0pNepzHI5HlEsc6IILv34; expires=Sun, 12-Nov-2023 06:47:36 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPEVRz_3tLBVH91aMrCbLs6JZ6EU-hrbOvUwoGsFGbHMCqiAhPzL5CbIvU0G9PdlfWKnvvVythLxjoKpXgFLzkCN74FRezeEAyEknVGMMfxHZI_3xle4cv78_1S_HjuKq75-nRZ2Kc8hBMoiJaKr_Ckfih3RC44ZWyfXUaYG7P5TkgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:36 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-2064e7112100', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-r40EbYQ8MqQp8sP3_orQcg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ai2vdYv93KZOo0FcLBAgNJU; expires=Sun, 12-Nov-2023 06:47:36 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPbPoQzWuVLVAF1gbDAZTR8zjO6UwZOqIGmrauTeRwg6QJjFntcTg4L-vAkvGeZ7BOM6i3N5N_xoKou39mgsybGjnFMpuACJD6IRiN6gWWbtzptQgmCIzlxjQcBXvusw19CJ21Qnu_VdaLQXvLbIxPtihEDB7hs5Dl9dsXJa-ZhYIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:36 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=e2ef56fd-e19a-4e55-881b-36c3aadaeda3&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '3d94bd1f-86cc-4fb8-bbc6-c3cc18de2d00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AlMz6Vvi0RtCqPmw_l-hk6CZhkDTAQAAAAjfutwOAAAA; expires=Sun, 12-Nov-2023 06:47:37 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:37 GMT', + 'Content-Length', + '1337' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .head('/share169717965622407664/dir169717965633504456/file169717965644404863') + .reply(200, "", [ + 'Content-Length', + '1024', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:36 GMT', + 'ETag', + '"0x8DBCBB84935DB67"', + 'Vary', + 'Origin', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82711-a01a-003b-5da1-fdd685000000', + 'x-ms-client-request-id', + '6b80e635-9c76-48d6-9c81-2125b87a245a', + 'x-ms-version', + '2023-11-03', + 'x-ms-type', + 'File', + 'x-ms-server-encrypted', + 'true', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-file-change-time', + '2023-10-13T06:47:36.5744487Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:36.5744487Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:36.5744487Z', + 'x-ms-file-permission-key', + '4614121289425226539*16764736045797335973', + 'x-ms-file-attributes', + 'Archive', + 'x-ms-file-id', + '11529285414812647424', + 'x-ms-file-parent-id', + '13835128424026341376', + 'Date', + 'Fri, 13 Oct 2023 06:47:37 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717965622407664') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82712-a01a-003b-5ea1-fdd685000000', + 'x-ms-client-request-id', + '8b8bbd74-c525-4664-ac70-b8c44961f9c2', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:37 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_default_audience_should_work.js b/sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_default_audience_should_work.js new file mode 100644 index 000000000000..888fb80f152a --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/fileclient_nodejs_only/recording_default_audience_should_work.js @@ -0,0 +1,283 @@ +let nock = require('nock'); + +module.exports.hash = "ed864910be4f76a5d2ce8cb513e59521"; + +module.exports.testInfo = {"uniqueName":{"share":"share169717965509709543","dir":"dir169717965520801859","file":"file169717965531706926"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965509709543') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:35 GMT', + 'ETag', + '"0x8DBCBB84867C0D0"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82705-a01a-003b-55a1-fdd685000000', + 'x-ms-client-request-id', + '7d6314af-fae0-4d72-85e1-f67f9d88e35a', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:34 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965509709543/dir169717965520801859') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:35 GMT', + 'ETag', + '"0x8DBCBB848795EF0"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82707-a01a-003b-56a1-fdd685000000', + 'x-ms-client-request-id', + '81979fdb-f935-449c-bffa-63e4f0e7404f', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:35.3391856Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:35.3391856Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:35.3391856Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:35 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965509709543/dir169717965520801859/file169717965531706926') + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:35 GMT', + 'ETag', + '"0x8DBCBB84889FE39"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82708-a01a-003b-57a1-fdd685000000', + 'x-ms-client-request-id', + '24f8d9b4-1a7a-4372-ad64-29b4d01bdcdd', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:35.4481209Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:35.4481209Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:35.4481209Z', + 'x-ms-file-permission-key', + '4614121289425226539*16764736045797335973', + 'x-ms-file-attributes', + 'Archive', + 'x-ms-file-id', + '11529285414812647424', + 'x-ms-file-parent-id', + '13835128424026341376', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:35 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '52078f1a-9f5b-4a6e-bf4b-7f9adb9d3000', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-EvD0OFf3nN-57stNcMe8Nw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AjtPrnb5igFDu4XIsELAwL0; expires=Sun, 12-Nov-2023 06:47:35 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPu1akgJMbvUtmXJCa18kf49DywbqqPCgOgbqrihqOrbzwgv4Fgftid1NGcS04IhvsE-4KD6pePcB-w4WzYeYRdq6GJolDO5aQQv1RKY0M3kGT_jdCvM4o91TFqwYnuzAksh_E5fIuNjyC0DuPNiYNA_hdZRino_ICJ0TA44IjeP4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:35 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '8507ac40-ed5a-4f82-b2f0-3001c9040b00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AqCPuiE1VBZPq3oMi3SwwhI; expires=Sun, 12-Nov-2023 06:47:35 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPAdwHcVTmDzFCxDIWmzhrCO4JusOSV3I9i9Qil3RMBxPUoWJ3S18dzO0kuKpQv2522-UHM-W1adB4V7PiAlZpC3R7DgnTyF415q_0Sp7lSgn_HiVN0FnWqjODRp7b6C3ByGTn6GBFmwNoA_UxtfG2Trwxp09tLuiU2Zwd7qSzL50gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:35 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=2b7f7d03-4314-414b-9d99-f653d5ab9171&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '52078f1a-9f5b-4a6e-bf4b-7f9ae19d3000', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-h1Aegn3tQk95xzIyqHDdjQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AoEhJ_De63pMuKatSH28a8beeSdeAQAAAAffutwOAAAA; expires=Sun, 12-Nov-2023 06:47:35 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:35 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .head('/share169717965509709543/dir169717965520801859/file169717965531706926') + .reply(200, "", [ + 'Content-Length', + '1024', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:35 GMT', + 'ETag', + '"0x8DBCBB84889FE39"', + 'Vary', + 'Origin', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8270b-a01a-003b-58a1-fdd685000000', + 'x-ms-client-request-id', + '78dc4932-8a1a-448a-bfda-f32d05590c26', + 'x-ms-version', + '2023-11-03', + 'x-ms-type', + 'File', + 'x-ms-server-encrypted', + 'true', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-file-change-time', + '2023-10-13T06:47:35.4481209Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:35.4481209Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:35.4481209Z', + 'x-ms-file-permission-key', + '4614121289425226539*16764736045797335973', + 'x-ms-file-attributes', + 'Archive', + 'x-ms-file-id', + '11529285414812647424', + 'x-ms-file-parent-id', + '13835128424026341376', + 'Date', + 'Fri, 13 Oct 2023 06:47:35 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717965509709543') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8270c-a01a-003b-59a1-fdd685000000', + 'x-ms-client-request-id', + 'a521a2f7-e778-4d8f-a3ff-230965ab49b8', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:35 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_bad_audience_should_fail.js b/sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_bad_audience_should_fail.js new file mode 100644 index 000000000000..be47f68e469e --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_bad_audience_should_fail.js @@ -0,0 +1,221 @@ +let nock = require('nock'); + +module.exports.hash = "6b2360bf12be065bbb1b0eca7827c953"; + +module.exports.testInfo = {"uniqueName":{"share":"share169717966095504845","dir":"dir169717966106303870"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717966095504845') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:41 GMT', + 'ETag', + '"0x8DBCBB84BE58F5A"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8272c-a01a-003b-72a1-fdd685000000', + 'x-ms-client-request-id', + '25bbc038-fa6c-42b2-bfaf-7188a01b0403', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:40 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717966095504845/dir169717966106303870') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:41 GMT', + 'ETag', + '"0x8DBCBB84BF6D997"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8272e-a01a-003b-73a1-fdd685000000', + 'x-ms-client-request-id', + '10e04f61-cb71-4c53-bc1b-c4635848a584', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:41.1946903Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:41.1946903Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:41.1946903Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:40 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '52078f1a-9f5b-4a6e-bf4b-7f9a339e3000', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-L-poVILgxDv-C_yXuulMqA' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AuLNZIhU_3pMpCxpISkLGJA; expires=Sun, 12-Nov-2023 06:47:41 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP53M7teQzSkJPJq-aDWzpO-dmQMZ2D2Hg8jbBzIwEi9hYUDmhYxodIk7wzMpkuH2d6xuycdylT9rmDceRDLHee1kWjfwNT1GdcvN0wdZi7KNFG_Fk4XT7v7wCEOLiXoNFFpLBZFE6TgUxC9iVr4YK4CYEAPFoBRROC3vkG83WXP8gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:41 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '56c89bbc-c232-4e91-b43d-076953064000', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-xUhFSuGw9B67bd43-T9fdQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AlsrblRWnHxDrFkVKRIq5Kk; expires=Sun, 12-Nov-2023 06:47:41 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPH5_d16FHeR3od1xvONmvdwbOk3ulm9hrTF3YHhA9GAVxq4hZ0BmjsPcYAivDaEM3iLNmjUNjGYtwFiTuDQ_xTcVocwp4MsKcTISDhZHEOPdmVQSphV9l8vIvsyICgG_yL6UT56ul3FN81ImVs5j67Z6RQRwGWc3VLCvgE20AOrcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:41 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=4cae3158-bc2d-4f0c-bb13-0721416def40&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '52078f1a-9f5b-4a6e-bf4b-7f9a3a9e3000', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-NUqWJ_yboGKb5hq6kX2apg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AtzqcioCeYpOsuGCEARmZ9HfAfuwAQAAAAzfutwOAAAA; expires=Sun, 12-Nov-2023 06:47:41 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:41 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share169717966095504845') + .query(true) + .reply(403, "AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:d45090c8-601a-0069-03a1-fdaa6d000000\nTime:2023-10-13T06:47:52.7461812ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '426', + 'Content-Type', + 'application/xml', + 'Vary', + 'Origin', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd45090c8-601a-0069-03a1-fdaa6d000000', + 'x-ms-error-code', + 'AuthenticationFailed', + 'Date', + 'Fri, 13 Oct 2023 06:47:52 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717966095504845') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd45090ca-601a-0069-04a1-fdaa6d000000', + 'x-ms-client-request-id', + '2dd2d6d1-20df-4bb2-8bd7-c6942713cbb5', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:52 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_customized_audience_should_work.js b/sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_customized_audience_should_work.js new file mode 100644 index 000000000000..d70eab912c3a --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_customized_audience_should_work.js @@ -0,0 +1,219 @@ +let nock = require('nock'); + +module.exports.hash = "51e5e2273fd4dd265204055d5efdc494"; + +module.exports.testInfo = {"uniqueName":{"share":"share169717965985206827","dir":"dir169717965996101326"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965985206827') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:39 GMT', + 'ETag', + '"0x8DBCBB84B3D32FA"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82724-a01a-003b-6da1-fdd685000000', + 'x-ms-client-request-id', + 'c1842aa6-b4e6-494b-9bf4-bc20d912b075', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:39 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965985206827/dir169717965996101326') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:40 GMT', + 'ETag', + '"0x8DBCBB84B4EA55F"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82726-a01a-003b-6ea1-fdd685000000', + 'x-ms-client-request-id', + 'bce6d079-0b83-419f-b844-a28e2ca8dadd', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:40.0923487Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:40.0923487Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:40.0923487Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:39 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '111a28a4-b862-422c-b8dc-ca54a3d30200', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AjVIX_2JflRCmqSoeQNs3wY; expires=Sun, 12-Nov-2023 06:47:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPnseOsjHgIhQC4J7ZUTnjAuDzEfXspGsl_dzZ3r2SSitQDBFSnxBwhvTcVOQh0UVOqE7SipGWym-fa0b8_GzfqDT0dbalodHDbfiopYJ5TcSICKQ5A-vfzCITFiXFFZtb_jI_M2NuUtApMaoSFxJ3-0aRzzI6mx3bd7GgWMDaEwwgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:40 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-206454122100', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-oovcIQr-qbwcaVKdnB3dFQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AheTIqsqKmdOvQsxFgP8zjY; expires=Sun, 12-Nov-2023 06:47:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPlGgLutGCj0jcV_cqmdp12jFWIRPQolSnnz1qE9xAG0sB9wKVjnNm-dtPS36g8y990bfuYC2Ti8Pev-rG9KHPIkhrI_--lop0YHkdIrChlRnhwXsX1nHANYnHu0FoyQtbbX3emn1BK-W-dbrQippu7tJ0QokyMrzDZPSX15g3H7ggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:40 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=9ca012e4-b4c1-460f-958d-feac774ee585&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '52078f1a-9f5b-4a6e-bf4b-7f9a229e3000', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-0A1DC5rueZkvbqRFdKqh9g' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ak7MFmVwmONEtjVYj9M8mSOZhkDTAQAAAAvfutwOAAAA; expires=Sun, 12-Nov-2023 06:47:40 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:40 GMT', + 'Content-Length', + '1337' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share169717965985206827') + .query(true) + .reply(200, {"permission":"O:SYG:SYD:(A;OICI;FA;;;BA)(A;OICI;FA;;;SY)(A;;0x1200a9;;;BU)(A;OICIIO;GXGR;;;BU)(A;OICI;0x1301bf;;;AU)(A;;FA;;;SY)(A;OICIIO;GA;;;CO)"}, [ + 'Content-Length', + '149', + 'Vary', + 'Origin', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8272a-a01a-003b-70a1-fdd685000000', + 'x-ms-client-request-id', + 'cc79ed32-c3eb-4953-ac52-ff26704c87a2', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:40 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717965985206827') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8272b-a01a-003b-71a1-fdd685000000', + 'x-ms-client-request-id', + '8194819f-09bd-46c4-b246-3989f1152d79', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:40 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_default_audience_should_work.js b/sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_default_audience_should_work.js new file mode 100644 index 000000000000..b04d4c7969dd --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/shareclient_nodejs_only/recording_default_audience_should_work.js @@ -0,0 +1,217 @@ +let nock = require('nock'); + +module.exports.hash = "77cd6051642b84b6573ef87191601828"; + +module.exports.testInfo = {"uniqueName":{"share":"share169717965873903881","dir":"dir169717965884602455"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965873903881') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:38 GMT', + 'ETag', + '"0x8DBCBB84A93503B"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8271d-a01a-003b-67a1-fdd685000000', + 'x-ms-client-request-id', + 'facad95c-fdf5-44c6-80dc-b42a20177d87', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:38 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share169717965873903881/dir169717965884602455') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Fri, 13 Oct 2023 06:47:38 GMT', + 'ETag', + '"0x8DBCBB84AA4759E"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc8271f-a01a-003b-68a1-fdd685000000', + 'x-ms-client-request-id', + '5ae00bf9-ec82-42b7-b58c-8d20d95851ad', + 'x-ms-version', + '2023-11-03', + 'x-ms-file-change-time', + '2023-10-13T06:47:38.9770142Z', + 'x-ms-file-last-write-time', + '2023-10-13T06:47:38.9770142Z', + 'x-ms-file-creation-time', + '2023-10-13T06:47:38.9770142Z', + 'x-ms-file-permission-key', + '9255856626508002348*16764736045797335973', + 'x-ms-file-attributes', + 'Directory', + 'x-ms-file-id', + '13835128424026341376', + 'x-ms-file-parent-id', + '0', + 'x-ms-request-server-encrypted', + 'true', + 'Date', + 'Fri, 13 Oct 2023 06:47:38 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'e41ea307-61f5-46f8-b5e4-3f3bda480700', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-lUo9LoU_Cpo-YihUPULYBw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AgN4AATkRllChe5XJTIgtA0; expires=Sun, 12-Nov-2023 06:47:39 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPuWqKGHgyEFc2kFZ-dzIkkwQdRTHliSddPqRt4E6KyzTMNmfdcptTIT1_fahKCSLz-9Inasvmc7DnGUBhvece8s7LM6Mb5iIjCImrvA3ORFn7Apj7H5_-ez2y4Dmh-KNdcWxNguc8ryKJPZj20heolfaB_C6L1kvjGsz-QBATplQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:38 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '593924ce-c021-4ad7-9112-05c1068c2800', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aid0__UUpnpMpzJqSYg_uiY; expires=Sun, 12-Nov-2023 06:47:39 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPAQ4jSvR_vVDfnMZzahA0b037cpjruupF3MesgGt_zliQHnwKNKkI9wFe7VBrXKd_erx12DS_iK4eNYPl9hi6E0WIvsjc_odQS_qJBlnh6pp_6V8KZ2mXk9zfX3pSZm8YSf9hjSDG1B1y531zbOYeND9gBlZSOlj2m_1Mq6BDMTcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:39 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=ad3da3c8-cb51-428b-8504-cdc90f759522&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '35b18625-83f1-430d-9b82-aabb8dd82a00', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvavRGGssNZDmk8bgj_YNzLeeSdeAQAAAArfutwOAAAA; expires=Sun, 12-Nov-2023 06:47:39 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 06:47:39 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share169717965873903881') + .query(true) + .reply(200, {"permission":"O:SYG:SYD:(A;OICI;FA;;;BA)(A;OICI;FA;;;SY)(A;;0x1200a9;;;BU)(A;OICIIO;GXGR;;;BU)(A;OICI;0x1301bf;;;AU)(A;;FA;;;SY)(A;OICIIO;GA;;;CO)"}, [ + 'Content-Length', + '149', + 'Vary', + 'Origin', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82722-a01a-003b-6ba1-fdd685000000', + 'x-ms-client-request-id', + '707ca345-3d3b-443b-b11e-9cc3c5ee3375', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:39 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share169717965873903881') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'ecc82723-a01a-003b-6ca1-fdd685000000', + 'x-ms-client-request-id', + 'd28dab18-b0fa-4402-9db1-c451e7915dfe', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 06:47:39 GMT' +]); diff --git a/sdk/storage/storage-file-share/review/storage-file-share.api.md b/sdk/storage/storage-file-share/review/storage-file-share.api.md index 057024eebdf9..cf7522270784 100644 --- a/sdk/storage/storage-file-share/review/storage-file-share.api.md +++ b/sdk/storage/storage-file-share/review/storage-file-share.api.md @@ -1166,6 +1166,9 @@ export function generateAccountSASQueryParameters(accountSASSignatureValues: Acc // @public export function generateFileSASQueryParameters(fileSASSignatureValues: FileSASSignatureValues, sharedKeyCredential: StorageSharedKeyCredential): SASQueryParameters; +// @public (undocumented) +export function getFileServiceAccountAudience(storageAccountName: string): string; + // @public export interface HandleItem { // (undocumented) @@ -2148,8 +2151,14 @@ export class StorageBrowserPolicyFactory implements RequestPolicyFactory { create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageBrowserPolicy; } +// @public +export enum StorageFileAudience { + StorageOAuthScopes = "https://storage.azure.com/.default" +} + // @public export interface StoragePipelineOptions { + audience?: string; httpClient?: IHttpClient; keepAliveOptions?: KeepAliveOptions; proxyOptions?: ProxyOptions; diff --git a/sdk/storage/storage-file-share/src/Pipeline.ts b/sdk/storage/storage-file-share/src/Pipeline.ts index ad44f304d950..5d7577f66802 100644 --- a/sdk/storage/storage-file-share/src/Pipeline.ts +++ b/sdk/storage/storage-file-share/src/Pipeline.ts @@ -23,8 +23,8 @@ import { keepAlivePolicy, generateClientRequestIdPolicy, isTokenCredential, - bearerTokenAuthenticationPolicy, TokenCredential, + bearerTokenAuthenticationPolicy, } from "@azure/core-http"; import { logger } from "./log"; @@ -145,6 +145,11 @@ export interface StoragePipelineOptions { * Configures the HTTP client to send requests and receive responses. */ httpClient?: IHttpClient; + /** + * The audience used to retrieve an AAD token. + * By default, audience 'https://storage.azure.com/.default' will be used. + */ + audience?: string; } /** @@ -190,7 +195,10 @@ export function newPipeline( factories.push( isTokenCredential(credential) ? attachCredential( - bearerTokenAuthenticationPolicy(credential, StorageOAuthScopes), + bearerTokenAuthenticationPolicy( + credential, + pipelineOptions.audience ?? StorageOAuthScopes + ), credential ) : credential diff --git a/sdk/storage/storage-file-share/src/generated/src/models/parameters.ts b/sdk/storage/storage-file-share/src/generated/src/models/parameters.ts index 8bf05473e37a..c5bebae9aca7 100644 --- a/sdk/storage/storage-file-share/src/generated/src/models/parameters.ts +++ b/sdk/storage/storage-file-share/src/generated/src/models/parameters.ts @@ -100,7 +100,7 @@ export const timeoutInSeconds: OperationQueryParameter = { export const version: OperationParameter = { parameterPath: "version", mapper: { - defaultValue: "2023-08-03", + defaultValue: "2023-11-03", isConstant: true, serializedName: "x-ms-version", type: { diff --git a/sdk/storage/storage-file-share/src/generated/src/storageClientContext.ts b/sdk/storage/storage-file-share/src/generated/src/storageClientContext.ts index 937650f37e17..53837e5bcddb 100644 --- a/sdk/storage/storage-file-share/src/generated/src/storageClientContext.ts +++ b/sdk/storage/storage-file-share/src/generated/src/storageClientContext.ts @@ -10,7 +10,7 @@ import * as coreHttp from "@azure/core-http"; import { StorageClientOptionalParams } from "./models"; const packageName = "azure-storage-file-share"; -const packageVersion = "12.16.0"; +const packageVersion = "12.16.1"; export class StorageClientContext extends coreHttp.ServiceClient { url: string; @@ -48,7 +48,7 @@ export class StorageClientContext extends coreHttp.ServiceClient { this.url = url; // Assigning values to Constant parameters - this.version = options.version || "2023-08-03"; + this.version = options.version || "2023-11-03"; this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update"; } } diff --git a/sdk/storage/storage-file-share/src/index.ts b/sdk/storage/storage-file-share/src/index.ts index d4c9b81a4dee..b9b9d0fdf0ba 100644 --- a/sdk/storage/storage-file-share/src/index.ts +++ b/sdk/storage/storage-file-share/src/index.ts @@ -29,6 +29,8 @@ export { CloseHandlesInfo, ShareProtocols, HttpAuthorization, + StorageFileAudience, + getFileServiceAccountAudience, } from "./models"; export * from "./FileSystemAttributes"; export * from "./Pipeline"; diff --git a/sdk/storage/storage-file-share/src/models.ts b/sdk/storage/storage-file-share/src/models.ts index c3ae13f666db..75410723e59b 100644 --- a/sdk/storage/storage-file-share/src/models.ts +++ b/sdk/storage/storage-file-share/src/models.ts @@ -359,3 +359,17 @@ export interface HttpAuthorization { */ value: string; } + +/** + * Defines the known cloud audiences for Storage. + */ +export enum StorageFileAudience { + /** + * The OAuth scope to use to retrieve an AAD token for Azure Storage. + */ + StorageOAuthScopes = "https://storage.azure.com/.default", +} + +export function getFileServiceAccountAudience(storageAccountName: string): string { + return `https://${storageAccountName}.file.core.windows.net/.default`; +} diff --git a/sdk/storage/storage-file-share/src/utils/constants.ts b/sdk/storage/storage-file-share/src/utils/constants.ts index 397e86cc5a95..fdeb725c1d9d 100644 --- a/sdk/storage/storage-file-share/src/utils/constants.ts +++ b/sdk/storage/storage-file-share/src/utils/constants.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export const SDK_VERSION: string = "12.16.0"; -export const SERVICE_VERSION: string = "2023-08-03"; +export const SDK_VERSION: string = "12.16.1"; +export const SERVICE_VERSION: string = "2023-11-03"; export const FILE_MAX_SIZE_BYTES: number = 4 * 1024 * 1024 * 1024 * 1024; // 4TB export const FILE_RANGE_MAX_SIZE_BYTES: number = 4 * 1024 * 1024; // 4MB diff --git a/sdk/storage/storage-file-share/swagger/README.md b/sdk/storage/storage-file-share/swagger/README.md index c70aaf840172..ac9f12524634 100644 --- a/sdk/storage/storage-file-share/swagger/README.md +++ b/sdk/storage/storage-file-share/swagger/README.md @@ -20,7 +20,7 @@ disable-async-iterators: true add-credentials: false use-extension: "@autorest/typescript": "6.0.0-dev.20210218.1" -package-version: 12.16.0 +package-version: 12.16.1 ``` ## Customizations for Track 2 Generator @@ -891,13 +891,13 @@ directive: $["x-ms-parameter-location"] = "method"; ``` -### Update service version from "2023-01-03" to "2023-08-03" +### Update service version from "2023-01-03" to "2023-11-03" ```yaml directive: - from: swagger-document where: $.parameters.ApiVersionParameter - transform: $.enum = [ "2023-08-03" ]; + transform: $.enum = [ "2023-11-03" ]; ``` ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorage%2Fstorage-file-share%2Fswagger%2FREADME.png) diff --git a/sdk/storage/storage-file-share/test/node/directoryclient.spec.ts b/sdk/storage/storage-file-share/test/node/directoryclient.spec.ts index 1b1b545ccd36..83ec8175f793 100644 --- a/sdk/storage/storage-file-share/test/node/directoryclient.spec.ts +++ b/sdk/storage/storage-file-share/test/node/directoryclient.spec.ts @@ -2,15 +2,17 @@ // Licensed under the MIT license. import { assert } from "chai"; -import { getBSU, recorderEnvSetup } from "../utils"; +import { getAccountName, getBSU, recorderEnvSetup } from "../utils"; import { newPipeline, ShareDirectoryClient, StorageSharedKeyCredential, ShareClient, + getFileServiceAccountAudience, } from "../../src"; import { record, Recorder } from "@azure-tools/test-recorder"; import { Context } from "mocha"; +import { DefaultAzureCredential } from "@azure/identity"; describe("DirectoryClient Node.js only", () => { let shareName: string; @@ -38,6 +40,46 @@ describe("DirectoryClient Node.js only", () => { await recorder.stop(); }); + it("Default audience should work", async () => { + const dirClientWithOAuthToken = new ShareDirectoryClient( + dirClient.url, + new DefaultAzureCredential(), + { fileRequestIntent: "backup" } + ); + const exist = await dirClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("Customized audience should work", async () => { + const dirClientWithOAuthToken = new ShareDirectoryClient( + dirClient.url, + new DefaultAzureCredential(), + { + audience: getFileServiceAccountAudience(getAccountName()), + fileRequestIntent: "backup", + } + ); + const exist = await dirClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("Bad audience should fail", async () => { + const dirClientWithOAuthToken = new ShareDirectoryClient( + dirClient.url, + new DefaultAzureCredential(), + { + audience: "https://badaudience.file.core.windows.net/.default", + fileRequestIntent: "backup", + } + ); + try { + await dirClientWithOAuthToken.exists(); + assert.fail("Should fail with 403"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 403); + } + }); + it("can be created with a url and a credential", async () => { const factories = (dirClient as any).pipeline.factories; const credential = factories[factories.length - 1] as StorageSharedKeyCredential; diff --git a/sdk/storage/storage-file-share/test/node/fileclient.spec.ts b/sdk/storage/storage-file-share/test/node/fileclient.spec.ts index fa9934449eaa..77ec4f4e0a03 100644 --- a/sdk/storage/storage-file-share/test/node/fileclient.spec.ts +++ b/sdk/storage/storage-file-share/test/node/fileclient.spec.ts @@ -5,6 +5,7 @@ import { assert } from "chai"; import { Buffer } from "buffer"; import * as fs from "fs"; import { Context } from "mocha"; +import { DefaultAzureCredential } from "@azure/identity"; import * as path from "path"; import { Duplex } from "stream"; import * as zlib from "zlib"; @@ -14,6 +15,7 @@ import { isPlaybackMode, record, Recorder } from "@azure-tools/test-recorder"; import { FileSASPermissions, generateFileSASQueryParameters, + getFileServiceAccountAudience, newPipeline, ShareClient, ShareDirectoryClient, @@ -24,6 +26,7 @@ import { readStreamToLocalFileWithLogs } from "../../test/utils/testutils.node"; import { bodyToString, createRandomLocalFile, + getAccountName, getBlobServceClient, getBSU, getTokenCredential, @@ -64,6 +67,49 @@ describe("FileClient Node.js only", () => { } }); + it("Default audience should work", async () => { + await fileClient.create(1024); + const fileClientWithOAuthToken = new ShareFileClient( + fileClient.url, + new DefaultAzureCredential(), + { fileRequestIntent: "backup" } + ); + const exist = await fileClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("Customized audience should work", async () => { + await fileClient.create(1024); + const fileClientWithOAuthToken = new ShareFileClient( + fileClient.url, + new DefaultAzureCredential(), + { + audience: getFileServiceAccountAudience(getAccountName()), + fileRequestIntent: "backup", + } + ); + const exist = await fileClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("Bad audience should fail", async () => { + await fileClient.create(1024); + const fileClientWithOAuthToken = new ShareFileClient( + fileClient.url, + new DefaultAzureCredential(), + { + audience: "https://badaudience.file.core.windows.net/.default", + fileRequestIntent: "backup", + } + ); + try { + await fileClientWithOAuthToken.exists(); + assert.fail("Should fail with 403"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 403); + } + }); + it("uploadData - large Buffer as data", async () => { recorder.skip("node", "Temp File - recorder doesn't support saving the file"); await fileClient.create(257 * 1024 * 1024 * 1024); diff --git a/sdk/storage/storage-file-share/test/node/shareclient.spec.ts b/sdk/storage/storage-file-share/test/node/shareclient.spec.ts index b1696385a40b..c86a76d016d2 100644 --- a/sdk/storage/storage-file-share/test/node/shareclient.spec.ts +++ b/sdk/storage/storage-file-share/test/node/shareclient.spec.ts @@ -6,8 +6,20 @@ import { Context } from "mocha"; import { record, Recorder } from "@azure-tools/test-recorder"; -import { newPipeline, ShareClient, SignedIdentifier, StorageSharedKeyCredential } from "../../src"; -import { getBSU, getConnectionStringFromEnvironment, recorderEnvSetup } from "../utils"; +import { + getFileServiceAccountAudience, + newPipeline, + ShareClient, + SignedIdentifier, + StorageSharedKeyCredential, +} from "../../src"; +import { + getAccountName, + getBSU, + getConnectionStringFromEnvironment, + recorderEnvSetup, +} from "../utils"; +import { DefaultAzureCredential } from "@azure/identity"; describe("ShareClient Node.js only", () => { let shareName: string; @@ -28,6 +40,70 @@ describe("ShareClient Node.js only", () => { await recorder.stop(); }); + it("Default audience should work", async () => { + const directoryName = recorder.getUniqueName("dir"); + const directoryClient = shareClient.getDirectoryClient(directoryName); + + const cResp = await directoryClient.create(); + assert.ok(cResp.filePermissionKey); + + const shareClientWithOAuthToken = new ShareClient( + shareClient.url, + new DefaultAzureCredential(), + { fileRequestIntent: "backup" } + ); + const getPermissionResp = await shareClientWithOAuthToken.getPermission( + cResp.filePermissionKey! + ); + assert.ok(getPermissionResp.date!); + assert.equal(getPermissionResp.errorCode, undefined); + }); + + it("Customized audience should work", async () => { + const directoryName = recorder.getUniqueName("dir"); + const directoryClient = shareClient.getDirectoryClient(directoryName); + + const cResp = await directoryClient.create(); + assert.ok(cResp.filePermissionKey); + + const shareClientWithOAuthToken = new ShareClient( + shareClient.url, + new DefaultAzureCredential(), + { + audience: getFileServiceAccountAudience(getAccountName()), + fileRequestIntent: "backup", + } + ); + const getPermissionResp = await shareClientWithOAuthToken.getPermission( + cResp.filePermissionKey! + ); + assert.ok(getPermissionResp.date!); + assert.equal(getPermissionResp.errorCode, undefined); + }); + + it("Bad audience should fail", async () => { + const directoryName = recorder.getUniqueName("dir"); + const directoryClient = shareClient.getDirectoryClient(directoryName); + + const cResp = await directoryClient.create(); + assert.ok(cResp.filePermissionKey); + + const shareClientWithOAuthToken = new ShareClient( + shareClient.url, + new DefaultAzureCredential(), + { + audience: "https://badaudience.file.core.windows.net/.default", + fileRequestIntent: "backup", + } + ); + try { + await shareClientWithOAuthToken.getPermission(cResp.filePermissionKey!); + assert.fail("Should fail with 403"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 403); + } + }); + it("setAccessPolicy", async () => { const yesterday = recorder.newDate("now"); const tomorrow = recorder.newDate("now"); diff --git a/sdk/storage/storage-file-share/test/utils/index.ts b/sdk/storage/storage-file-share/test/utils/index.ts index 82730a354b3f..593e2d479f1d 100644 --- a/sdk/storage/storage-file-share/test/utils/index.ts +++ b/sdk/storage/storage-file-share/test/utils/index.ts @@ -80,6 +80,18 @@ export function getBSU(config?: ShareClientConfig): ShareServiceClient { return getGenericBSU("", "", config); } +export function getAccountName(): string { + const accountNameEnvVar = `ACCOUNT_NAME`; + + const accountName = process.env[accountNameEnvVar]; + + if (!accountName || accountName === "") { + throw new Error(`${accountNameEnvVar} environment variables not specified.`); + } + + return accountName; +} + export function getAlternateBSU(): ShareServiceClient { return getGenericBSU("SECONDARY_", "-secondary"); } diff --git a/sdk/storage/storage-file-share/test/utils/testutils.common.ts b/sdk/storage/storage-file-share/test/utils/testutils.common.ts index 41724378f2a3..4a9adb94192b 100644 --- a/sdk/storage/storage-file-share/test/utils/testutils.common.ts +++ b/sdk/storage/storage-file-share/test/utils/testutils.common.ts @@ -23,6 +23,9 @@ export const recorderEnvSetup: RecorderEnvironmentSetup = { // Comment following line to skip user delegation key/SAS related cases in record and play // which depends on this environment variable ACCOUNT_TOKEN: `${mockAccountKey}`, + AZURE_CLIENT_ID: `${mockAccountKey}`, + AZURE_TENANT_ID: `${mockAccountKey}`, + AZURE_CLIENT_SECRET: `${mockAccountKey}`, SOFT_DELETE_ACCOUNT_NAME: `${mockSDAccountName}`, SOFT_DELETE_ACCOUNT_KEY: `${mockAccountKey}`, SOFT_DELETE_ACCOUNT_SAS: `${mockAccountKey}`, diff --git a/sdk/storage/storage-queue/CHANGELOG.md b/sdk/storage/storage-queue/CHANGELOG.md index 91b28895233c..e2458db437d4 100644 --- a/sdk/storage/storage-queue/CHANGELOG.md +++ b/sdk/storage/storage-queue/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 12.15.1 (Unreleased) + +### Features Added + +- Added support for service version 2023-11-03. +- Added support for indicating audience in StoragePipelineOptions. + ## 12.15.0 (2023-09-14) ### Features Added diff --git a/sdk/storage/storage-queue/package.json b/sdk/storage/storage-queue/package.json index da93c8eae11f..f40602e00c30 100644 --- a/sdk/storage/storage-queue/package.json +++ b/sdk/storage/storage-queue/package.json @@ -1,7 +1,7 @@ { "name": "@azure/storage-queue", "sdk-type": "client", - "version": "12.15.0", + "version": "12.15.1", "description": "Microsoft Azure Storage SDK for JavaScript - Queue", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", diff --git a/sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_bearer_token_challenge_should_work.js b/sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_bearer_token_challenge_should_work.js new file mode 100644 index 000000000000..071c19e1b78c --- /dev/null +++ b/sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_bearer_token_challenge_should_work.js @@ -0,0 +1,402 @@ +let nock = require('nock'); + +module.exports.hash = "c0dc07c97ec2d0fc8e337e6444108c12"; + +module.exports.testInfo = {"uniqueName":{"queue":"queue169718100941401204"},"newDate":{}} + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .put('/queue169718100941401204') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24e837-8003-0013-80a4-fdb72d000000', + 'x-ms-client-request-id', + '915b7aba-a0f8-4a69-a689-3366c1cec545', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 07:10:08 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '111a28a4-b862-422c-b8dc-ca5468140300', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AqX2aJ5h53pGlAWuYg_E8G4; expires=Sun, 12-Nov-2023 07:10:09 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPIOuImoaA-hUcmxPAJ7LOGzsUyTxQJfqjp5KZlpinM2JQ08NZTFiulmJgJBirlpF7JPsPDOst7Dd7BRJPO0gIV7zeU6B0P7eOtLP83dQKY_niSr5JXW-XJXuUh6_Td9WIwEDTK1Do5qTpE-a7jSvV6qCXyLf3Nn7auV_fLYcTcvogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:09 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'ae29efa3-f26e-4b20-9e18-6f95f8665900', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AtoiLYhfWMdEgOb8tHbCrXg; expires=Sun, 12-Nov-2023 07:10:09 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPkyEmlg9FIalFW-6HLYqOtLJr3HcjOHBKFta3ORwi0N2PRxtpXoaveqfkOjZ4TzSuM1giq5r7zXkdJ2Q_UuVCmILTOznwutCJZKJ6Vb-zlhmIe-LFnteB9yaGR5HFI5Bj0OmnqQoaVvSPlfW33g-W587TLY9jGKLpvCpGNGUEEH0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:09 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=dda9b555-ccd9-4e93-ac84-070df9f8710a&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '4441e1ad-16ea-43e6-9046-4d5d17751500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-vmwRLl9MmWDz15muTmZ9Vw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Ao3NBtYDLqlPtLEnCsfSMq6t-wbLAQAAAFHkutwOAAAA; expires=Sun, 12-Nov-2023 07:10:10 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:09 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .get('/queue169718100941401204') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:7f24e989-8003-0013-45a4-fdb72d000000\nTime:2023-10-13T07:10:10.1868558ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Vary', + 'Origin', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24e989-8003-0013-45a4-fdb72d000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Fri, 13 Oct 2023 07:10:09 GMT' +]); + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .get('/queue169718100941401204') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:7f24e9c6-8003-0013-80a4-fdb72d000000\nTime:2023-10-13T07:10:10.2927936ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Vary', + 'Origin', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24e9c6-8003-0013-80a4-fdb72d000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Fri, 13 Oct 2023 07:10:09 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-20647f942100', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-lx4cIu8YJ5Eamtj_WPtsTQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AhZNcOX-fW1JrOeXvHwFark; expires=Sun, 12-Nov-2023 07:10:10 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPvs1zgwumsO9Flsfo4L1mRC1YUlifsVlfMm-uSBZxwY8hG5U5OukmHoin9I64dw9nt9hO6aSwCFVjEzzpHsfhQxMurXbwf8D0D7poH51vdtRcJ06W7AYM5wqQKK1462P649PeiEeOMVcS-ZxEuj8OGLs7hp4Np0yuBQBKtbervGMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:10 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'fccd021d-0da7-428b-9d3a-206485942100', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-tB-T5S3pc2oPR-lIf1_8mg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AvSR9uT-4LxPnw1x8BeySFw; expires=Sun, 12-Nov-2023 07:10:10 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPY6wa3BdV6pGG9mFnpEoWHsWu6ww1xJP3JNqzITlAROiZviSqZkcdJTe4en1q2uCSsWEg93sUYEC9zAN6QWvoPkkCOANesnMreUGnsVHQwRJzv7nbjnJ1-BMQvVN4Eaz9YUIF6tCJfK6c81jCT3aZDfokq_14tT6vyksZ5x8iIxsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:10 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=c72b4bf4-1362-4cf3-9ad9-e4fd565b8392&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '59464e40-62af-47f9-87a5-6fa15d142200', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-ilyKsonz3qDDAx_2ROKdTw' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AkT8mhGHbGxOuhk7sATYT7St-wbLAQAAAFLkutwOAAAA; expires=Sun, 12-Nov-2023 07:10:10 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:10 GMT', + 'Content-Length', + '1339' +]); + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .get('/queue169718100941401204') + .query(true) + .reply(401, "InvalidAuthenticationInfoServer failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:7f24eb02-8003-0013-33a4-fdb72d000000\nTime:2023-10-13T07:10:10.9194339ZAudience validation failed. Audience did not match.", [ + 'Content-Length', + '406', + 'Content-Type', + 'application/xml', + 'Vary', + 'Origin', + 'Server', + 'Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24eb02-8003-0013-33a4-fdb72d000000', + 'x-ms-error-code', + 'InvalidAuthenticationInfo', + 'WWW-Authenticate', + 'Bearer authorization_uri=https://login.microsoftonline.com/aaaaa/oauth2/authorize resource_id=https://storage.azure.com', + 'Date', + 'Fri, 13 Oct 2023 07:10:10 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=50256062-089c-4e70-ab30-78ebb08c6b6c&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '4441e1ad-16ea-43e6-9046-4d5d23751500', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-Tb2r5td8LsKpDu0TT-PoHg' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ApjWnkDXCNVEuw82a0LrxRreeSdeAQAAAFLkutwOAAAA; expires=Sun, 12-Nov-2023 07:10:11 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:10 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .get('/queue169718100941401204') + .query(true) + .reply(200, "", [ + 'Cache-Control', + 'no-cache', + 'Content-Length', + '0', + 'Vary', + 'Origin', + 'Server', + 'Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24ebd2-8003-0013-7aa4-fdb72d000000', + 'x-ms-client-request-id', + '62b096de-ba38-42ac-a1b3-e907715973ef', + 'x-ms-version', + '2023-11-03', + 'x-ms-approximate-messages-count', + '0', + 'Date', + 'Fri, 13 Oct 2023 07:10:10 GMT' +]); + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/queue169718100941401204') + .query(true) + .reply(204, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24ec20-8003-0013-45a4-fdb72d000000', + 'x-ms-client-request-id', + '68372477-5773-401c-b40f-ee9ff2f8850c', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 07:10:10 GMT' +]); diff --git a/sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_customized_audience_should_work.js b/sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_customized_audience_should_work.js new file mode 100644 index 000000000000..903dae74a86e --- /dev/null +++ b/sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_customized_audience_should_work.js @@ -0,0 +1,179 @@ +let nock = require('nock'); + +module.exports.hash = "e204c00d602e363defd77658dbb7f1d4"; + +module.exports.testInfo = {"uniqueName":{"queue":"queue169718100845201519"},"newDate":{}} + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .put('/queue169718100845201519') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24e661-8003-0013-37a4-fdb72d000000', + 'x-ms-client-request-id', + '42e2e3d2-269c-4a65-a019-032876f272cc', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 07:10:07 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'ae29efa3-f26e-4b20-9e18-6f95ef665900', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=ArzhhYIy6kZLnjUZQr60FLQ; expires=Sun, 12-Nov-2023 07:10:08 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPkDk85fchsU5qpou_CmF7JhSMevYZZGQuUDXcmx7d2q1qCzI-TqPKOUyCtXpigPbE4pryzdUaesBhMC5l4hW25BpJGgvVYCnSvaS4yLczAI1EsfrBTZMxAJZSkyBm3vizCLmrOaGZr2Rs8CYx9XRkSa8IcHt5O2GEwwFnKo6Q_XggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:08 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '111a28a4-b862-422c-b8dc-ca545a140300', + 'x-ms-ests-server', + '2.1.16522.6 - SEASLR1 ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AlV97oQ-wVlDt-ETwsgecwU; expires=Sun, 12-Nov-2023 07:10:08 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP3h-XKvOBFgVK1q9-p56u5gawuryqEnCAXdFZ49UvaWguelZyyKz2pRh9SMkFaUc_uum6oz0ehWm9lektO3jM19VUeHAVMEe2BNBlIuh3gcnIvhoMQr05nJNrtUlBdN5P4CPCFdr6Ab5fuYei4h5t3OpyS1hUDzS7JI8Ogq04FoogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:08 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=bfb65ac0-bb7b-4859-bb78-991ed9f562bc&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + 'afd986a8-2fbf-4ba6-87a8-31be0c720800', + 'x-ms-ests-server', + '2.1.16522.6 - KRSLR1 ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-KcDMv2x_H5sHiFafRV1O1g' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AjCrH_q3eIhLm920P1nWb2JcU5QEAQAAAFDkutwOAAAA; expires=Sun, 12-Nov-2023 07:10:09 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:08 GMT', + 'Content-Length', + '1338' +]); + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .get('/queue169718100845201519') + .query(true) + .reply(200, "", [ + 'Cache-Control', + 'no-cache', + 'Content-Length', + '0', + 'Vary', + 'Origin', + 'Server', + 'Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24e7be-8003-0013-0ca4-fdb72d000000', + 'x-ms-client-request-id', + 'd0a36185-c6e9-4cbd-8137-d4d320f265f9', + 'x-ms-version', + '2023-11-03', + 'x-ms-approximate-messages-count', + '0', + 'Date', + 'Fri, 13 Oct 2023 07:10:08 GMT' +]); + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/queue169718100845201519') + .query(true) + .reply(204, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24e7fb-8003-0013-47a4-fdb72d000000', + 'x-ms-client-request-id', + 'c4a57194-ca87-4ab9-aa81-f12433e5ed5d', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 07:10:08 GMT' +]); diff --git a/sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_default_audience_should_work.js b/sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_default_audience_should_work.js new file mode 100644 index 000000000000..13232874bb43 --- /dev/null +++ b/sdk/storage/storage-queue/recordings/node/queueclient_nodejs_only/recording_queueclient_default_audience_should_work.js @@ -0,0 +1,181 @@ +let nock = require('nock'); + +module.exports.hash = "03aaa4db7f94e82aa57412a35b9c9392"; + +module.exports.testInfo = {"uniqueName":{"queue":"queue169718100661906684"},"newDate":{}} + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .put('/queue169718100661906684') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24e3d9-8003-0013-3ea4-fdb72d000000', + 'x-ms-client-request-id', + '9825ec59-74e8-491b-95c9-04b902971820', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 07:10:06 GMT' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/common/discovery/instance') + .query(true) + .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/aaaaa/v2.0/.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"]}]}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '6919e70c-adbf-4d71-be62-de85830c5c00', + 'x-ms-ests-server', + '2.1.16522.6 - KRC ProdSlices', + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AmdkVua8JXFIlIVF6Ukxos8; expires=Sun, 12-Nov-2023 07:10:07 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEPj-nrqKc-EqqNY3WZMxzaJ6-i8fAqKnne5obnTs30FItURGCqe_ltyf6bAOsy4XOK1oQsYbFpYCUnUi_VwsyM9tJiE-MqGizoxH_pWcMxcri970f6bsv9LXrrW0uCtYq7JeMthoTi3NYe2ET1BzvN5yMAQ2kXUaV5SI27OmiMqUYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:07 GMT', + 'Content-Length', + '980' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .get('/aaaaa/v2.0/.well-known/openid-configuration') + .reply(200, {"token_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/aaaaa/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/aaaaa/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/aaaaa/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/aaaaa/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"],"kerberos_endpoint":"https://login.microsoftonline.com/aaaaa/kerberos","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"}, [ + 'Cache-Control', + 'max-age=86400, private', + 'Content-Type', + 'application/json; charset=utf-8', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'Access-Control-Allow-Origin', + '*', + 'Access-Control-Allow-Methods', + 'GET, OPTIONS', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '59464e40-62af-47f9-87a5-6fa131142200', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-Xa-CkB6-pf1zIz0K0Pi8hQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=Aqdu8zJrpgBKmwDKsnIXOLc; expires=Sun, 12-Nov-2023 07:10:07 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'esctx=PAQABAAEAAAAtyolDObpQQ5VtlI4uGjEP4ATI_HBHnh5PsIzKGJeH2Wf25VxwQ-oHDvxZt3sY-1JhWgx9SWC1ogDwAhGcSx1c4UIObsK7M6YxV5b7lA5xftgc-oiulbdoxcdPn0_E2CUI6gLQq-MBIsHZk2OXPtAL1QcQhCH661Wf4eYAUNvUiaIwsNqwIcizkyTF-2sfrFggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:07 GMT', + 'Content-Length', + '1753' +]); + +nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) + .post('/aaaaa/oauth2/v2.0/token', "client_id=aaaaa&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.15.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=81321278-973b-49b4-8f8d-6353f8fdad11&client_secret=aaaaa&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22cp1%22%5D%7D%7D%7D") + .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ + 'Cache-Control', + 'no-store, no-cache', + 'Pragma', + 'no-cache', + 'Content-Type', + 'application/json; charset=utf-8', + 'Expires', + '-1', + 'Strict-Transport-Security', + 'max-age=31536000; includeSubDomains', + 'X-Content-Type-Options', + 'nosniff', + 'P3P', + 'CP="DSP CUR OTPi IND OTRi ONL FIN"', + 'x-ms-request-id', + '59464e40-62af-47f9-87a5-6fa139142200', + 'x-ms-ests-server', + '2.1.16522.6 - JPE ProdSlices', + 'x-ms-clitelem', + '1,0,0,,', + 'Content-Security-Policy-Report-Only', + "script-src 'self' 'nonce-5KiLUkHGVu1VkaRhpo17HQ' 'unsafe-eval' 'unsafe-inline' 'report-sample'; object-src 'none'; base-uri 'self'; report-uri https://csp.microsoft.com/report/ESTS-UX-All", + 'X-XSS-Protection', + '0', + 'Set-Cookie', + 'fpc=AjM-mTfUh-dBlppS65SeSwfeeSdeAQAAAE_kutwOAAAA; expires=Sun, 12-Nov-2023 07:10:08 GMT; path=/; secure; HttpOnly; SameSite=None', + 'Set-Cookie', + 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', + 'Set-Cookie', + 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', + 'Date', + 'Fri, 13 Oct 2023 07:10:07 GMT', + 'Content-Length', + '1318' +]); + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .get('/queue169718100661906684') + .query(true) + .reply(200, "", [ + 'Cache-Control', + 'no-cache', + 'Content-Length', + '0', + 'Vary', + 'Origin', + 'Server', + 'Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24e5e4-8003-0013-3ba4-fdb72d000000', + 'x-ms-client-request-id', + '6b834dba-bc62-44d3-bcd0-ed74dcc214a2', + 'x-ms-version', + '2023-11-03', + 'x-ms-approximate-messages-count', + '0', + 'Date', + 'Fri, 13 Oct 2023 07:10:07 GMT' +]); + +nock('https://fakestorageaccount.queue.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/queue169718100661906684') + .query(true) + .reply(204, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '7f24e624-8003-0013-7aa4-fdb72d000000', + 'x-ms-client-request-id', + 'abac89df-3788-4bb6-800c-0d20bc28db82', + 'x-ms-version', + '2023-11-03', + 'Date', + 'Fri, 13 Oct 2023 07:10:07 GMT' +]); diff --git a/sdk/storage/storage-queue/review/storage-queue.api.md b/sdk/storage/storage-queue/review/storage-queue.api.md index 805fe53dee81..388b5affb3e9 100644 --- a/sdk/storage/storage-queue/review/storage-queue.api.md +++ b/sdk/storage/storage-queue/review/storage-queue.api.md @@ -158,6 +158,9 @@ export interface GeoReplication { // @public export type GeoReplicationStatusType = "live" | "bootstrap" | "unavailable"; +// @public (undocumented) +export function getQueueServiceAccountAudience(storageAccountName: string): string; + export { HttpHeaders } export { HttpOperationResponse } @@ -830,6 +833,7 @@ export const StorageOAuthScopes: string | string[]; // @public export interface StoragePipelineOptions { + audience?: string; httpClient?: IHttpClient; keepAliveOptions?: KeepAliveOptions; proxyOptions?: ProxyOptions; @@ -837,6 +841,11 @@ export interface StoragePipelineOptions { userAgentOptions?: UserAgentOptions; } +// @public +export enum StorageQueueAudience { + StorageOAuthScopes = "https://storage.azure.com/.default" +} + // @public export interface StorageRetryOptions { readonly maxRetryDelayInMs?: number; diff --git a/sdk/storage/storage-queue/src/Pipeline.ts b/sdk/storage/storage-queue/src/Pipeline.ts index c7bd38a5b3aa..8c19ebff49eb 100644 --- a/sdk/storage/storage-queue/src/Pipeline.ts +++ b/sdk/storage/storage-queue/src/Pipeline.ts @@ -17,7 +17,6 @@ import { isNode, TokenCredential, isTokenCredential, - bearerTokenAuthenticationPolicy, tracingPolicy, logPolicy, ProxyOptions, @@ -39,6 +38,7 @@ import { StorageQueueLoggingAllowedQueryParameters, } from "./utils/constants"; import { getCachedDefaultHttpClient } from "./utils/cache"; +import { storageBearerTokenChallengeAuthenticationPolicy } from "./policies/StorageBearerTokenChallengeAuthenticationPolicy"; // Export following interfaces and types for customers who want to implement their // own RequestPolicy or HTTPClient @@ -138,6 +138,11 @@ export interface StoragePipelineOptions { * Configures the HTTP client to send requests and receive responses. */ httpClient?: IHttpClient; + /** + * The audience used to retrieve an AAD token. + * By default, audience 'https://storage.azure.com/.default' will be used. + */ + audience?: string; } /** @@ -180,7 +185,10 @@ export function newPipeline( } factories.push( isTokenCredential(credential) - ? bearerTokenAuthenticationPolicy(credential, StorageOAuthScopes) + ? storageBearerTokenChallengeAuthenticationPolicy( + credential, + pipelineOptions.audience ?? StorageOAuthScopes + ) : credential ); diff --git a/sdk/storage/storage-queue/src/generated/src/models/parameters.ts b/sdk/storage/storage-queue/src/generated/src/models/parameters.ts index c29473f4bba6..588a4f6d66a1 100644 --- a/sdk/storage/storage-queue/src/generated/src/models/parameters.ts +++ b/sdk/storage/storage-queue/src/generated/src/models/parameters.ts @@ -100,7 +100,7 @@ export const timeoutInSeconds: OperationQueryParameter = { export const version: OperationParameter = { parameterPath: "version", mapper: { - defaultValue: "2023-08-03", + defaultValue: "2023-11-03", isConstant: true, serializedName: "x-ms-version", type: { diff --git a/sdk/storage/storage-queue/src/generated/src/storageClientContext.ts b/sdk/storage/storage-queue/src/generated/src/storageClientContext.ts index 51c9cb86d7dd..4a5f12a6e372 100644 --- a/sdk/storage/storage-queue/src/generated/src/storageClientContext.ts +++ b/sdk/storage/storage-queue/src/generated/src/storageClientContext.ts @@ -10,7 +10,7 @@ import * as coreHttp from "@azure/core-http"; import { StorageClientOptionalParams } from "./models"; const packageName = "azure-storage-queue"; -const packageVersion = "12.15.0"; +const packageVersion = "12.15.1"; export class StorageClientContext extends coreHttp.ServiceClient { url: string; @@ -47,6 +47,6 @@ export class StorageClientContext extends coreHttp.ServiceClient { this.url = url; // Assigning values to Constant parameters - this.version = options.version || "2023-08-03"; + this.version = options.version || "2023-11-03"; } } diff --git a/sdk/storage/storage-queue/src/index.ts b/sdk/storage/storage-queue/src/index.ts index 1c940215affb..6d668a5e8197 100644 --- a/sdk/storage/storage-queue/src/index.ts +++ b/sdk/storage/storage-queue/src/index.ts @@ -16,7 +16,7 @@ export * from "./policies/AnonymousCredentialPolicy"; export * from "./policies/CredentialPolicy"; export * from "./StorageRetryPolicyFactory"; export * from "./StorageBrowserPolicyFactory"; -export { Metadata } from "./models"; +export { Metadata, StorageQueueAudience, getQueueServiceAccountAudience } from "./models"; export * from "./policies/StorageSharedKeyCredentialPolicy"; export * from "./QueueClient"; export * from "./QueueSASPermissions"; diff --git a/sdk/storage/storage-queue/src/models.ts b/sdk/storage/storage-queue/src/models.ts index d013de14e79d..1647f816af48 100644 --- a/sdk/storage/storage-queue/src/models.ts +++ b/sdk/storage/storage-queue/src/models.ts @@ -10,3 +10,17 @@ export interface Metadata { */ [propertyName: string]: string; } + +/** + * Defines the known cloud audiences for Storage. + */ +export enum StorageQueueAudience { + /** + * The OAuth scope to use to retrieve an AAD token for Azure Storage. + */ + StorageOAuthScopes = "https://storage.azure.com/.default", +} + +export function getQueueServiceAccountAudience(storageAccountName: string): string { + return `https://${storageAccountName}.queue.core.windows.net/.default`; +} diff --git a/sdk/storage/storage-queue/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.ts b/sdk/storage/storage-queue/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.ts new file mode 100644 index 000000000000..02f76e39f984 --- /dev/null +++ b/sdk/storage/storage-queue/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.ts @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AccessToken, GetTokenOptions, TokenCredential, URLBuilder } from "@azure/core-http"; +import { + BaseRequestPolicy, + RequestPolicy, + RequestPolicyFactory, + RequestPolicyOptions, +} from "@azure/core-http"; +import { HttpOperationResponse } from "@azure/core-http"; +import { WebResourceLike } from "@azure/core-http"; +import { delay } from "@azure/core-http"; + +/** + * A set of constants used internally when processing requests. + */ +const Constants = { + DefaultScope: "/.default", + /** + * Defines constants for use with HTTP headers. + */ + HeaderConstants: { + /** + * The Authorization header. + */ + AUTHORIZATION: "authorization", + }, +}; + +// #region Access Token Cycler + +/** + * A function that gets a promise of an access token and allows providing + * options. + * + * @param options - the options to pass to the underlying token provider + */ +type AccessTokenGetter = (options: GetTokenOptions) => Promise; + +interface TokenCyclerOptions { + /** + * The window of time before token expiration during which the token will be + * considered unusable due to risk of the token expiring before sending the + * request. + * + * This will only become meaningful if the refresh fails for over + * (refreshWindow - forcedRefreshWindow) milliseconds. + */ + forcedRefreshWindowInMs: number; + /** + * Interval in milliseconds to retry failed token refreshes. + */ + retryIntervalInMs: number; + /** + * The window of time before token expiration during which + * we will attempt to refresh the token. + */ + refreshWindowInMs: number; +} + +// Default options for the cycler if none are provided +const DEFAULT_CYCLER_OPTIONS: TokenCyclerOptions = { + forcedRefreshWindowInMs: 1000, // Force waiting for a refresh 1s before the token expires + retryIntervalInMs: 3000, // Allow refresh attempts every 3s + refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry +}; + +/** + * Converts an an unreliable access token getter (which may resolve with null) + * into an AccessTokenGetter by retrying the unreliable getter in a regular + * interval. + * + * @param getAccessToken - a function that produces a promise of an access + * token that may fail by returning null + * @param retryIntervalInMs - the time (in milliseconds) to wait between retry + * attempts + * @param timeoutInMs - the timestamp after which the refresh attempt will fail, + * throwing an exception + * @returns - a promise that, if it resolves, will resolve with an access token + */ +async function beginRefresh( + getAccessToken: () => Promise, + retryIntervalInMs: number, + timeoutInMs: number +): Promise { + // This wrapper handles exceptions gracefully as long as we haven't exceeded + // the timeout. + async function tryGetAccessToken(): Promise { + if (Date.now() < timeoutInMs) { + try { + return await getAccessToken(); + } catch { + return null; + } + } else { + const finalToken = await getAccessToken(); + + // Timeout is up, so throw if it's still null + if (finalToken === null) { + throw new Error("Failed to refresh access token."); + } + + return finalToken; + } + } + + let token: AccessToken | null = await tryGetAccessToken(); + + while (token === null) { + await delay(retryIntervalInMs); + + token = await tryGetAccessToken(); + } + + return token; +} + +/** + * Creates a token cycler from a credential, scopes, and optional settings. + * + * A token cycler represents a way to reliably retrieve a valid access token + * from a TokenCredential. It will handle initializing the token, refreshing it + * when it nears expiration, and synchronizes refresh attempts to avoid + * concurrency hazards. + * + * @param credential - the underlying TokenCredential that provides the access + * token + * @param scopes - the scopes to request authorization for + * @param tokenCyclerOptions - optionally override default settings for the cycler + * + * @returns - a function that reliably produces a valid access token + */ +function createTokenCycler( + credential: TokenCredential, + scopes: string | string[], + tokenCyclerOptions?: Partial +): AccessTokenGetter { + let refreshWorker: Promise | null = null; + let token: AccessToken | null = null; + + const options = { + ...DEFAULT_CYCLER_OPTIONS, + ...tokenCyclerOptions, + }; + + /** + * This little holder defines several predicates that we use to construct + * the rules of refreshing the token. + */ + const cycler = { + /** + * Produces true if a refresh job is currently in progress. + */ + get isRefreshing(): boolean { + return refreshWorker !== null; + }, + /** + * Produces true if the cycler SHOULD refresh (we are within the refresh + * window and not already refreshing) + */ + get shouldRefresh(): boolean { + return ( + !cycler.isRefreshing && + (token?.expiresOnTimestamp ?? 0) - options.refreshWindowInMs < Date.now() + ); + }, + /** + * Produces true if the cycler MUST refresh (null or nearly-expired + * token). + */ + get mustRefresh(): boolean { + return ( + token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now() + ); + }, + }; + + /** + * Starts a refresh job or returns the existing job if one is already + * running. + */ + function refresh(getTokenOptions: GetTokenOptions): Promise { + if (!cycler.isRefreshing) { + // We bind `scopes` here to avoid passing it around a lot + const tryGetAccessToken = (): Promise => + credential.getToken(scopes, getTokenOptions); + + // Take advantage of promise chaining to insert an assignment to `token` + // before the refresh can be considered done. + refreshWorker = beginRefresh( + tryGetAccessToken, + options.retryIntervalInMs, + // If we don't have a token, then we should timeout immediately + token?.expiresOnTimestamp ?? Date.now() + ) + .then((_token) => { + refreshWorker = null; + token = _token; + return token; + }) + .catch((reason) => { + // We also should reset the refresher if we enter a failed state. All + // existing awaiters will throw, but subsequent requests will start a + // new retry chain. + refreshWorker = null; + token = null; + throw reason; + }); + } + + return refreshWorker as Promise; + } + + return async (tokenOptions: GetTokenOptions): Promise => { + // + // Simple rules: + // - If we MUST refresh, then return the refresh task, blocking + // the pipeline until a token is available. + // - If we SHOULD refresh, then run refresh but don't return it + // (we can still use the cached token). + // - Return the token, since it's fine if we didn't return in + // step 1. + // + + if (cycler.mustRefresh) return refresh(tokenOptions); + + if (cycler.shouldRefresh) { + refresh(tokenOptions); + } + + return token as AccessToken; + }; +} +/** + * We will retrieve the challenge only if the response status code was 401, + * and if the response contained the header "WWW-Authenticate" with a non-empty value. + */ +function getChallenge(response: HttpOperationResponse): string | undefined { + const challenge = response.headers.get("WWW-Authenticate"); + if (response.status === 401 && challenge) { + return challenge; + } + return; +} + +/** + * Challenge structure + */ +interface Challenge { + authorization_uri: string; + resource_id: string; +} + +/** + * Converts: `Bearer a="b" c="d"`. + * Into: `[ { a: 'b', c: 'd' }]`. + * + * @internal + */ +function parseChallenge(challenge: string): any { + const bearerChallenge = challenge.slice("Bearer ".length); + const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x) => x); + const keyValuePairs = challengeParts.map((keyValue) => + (([key, value]) => ({ [key]: value }))(keyValue.trim().split("=")) + ); + // Key-value pairs to plain object: + return keyValuePairs.reduce((a, b) => ({ ...a, ...b }), {}); +} + +// #endregion + +/** + * Creates a new factory for a RequestPolicy that applies a bearer token to + * the requests' `Authorization` headers. + * + * @param credential - The TokenCredential implementation that can supply the bearer token. + * @param scopes - The scopes for which the bearer token applies. + */ + +export function storageBearerTokenChallengeAuthenticationPolicy( + credential: TokenCredential, + scopes: string | string[] +): RequestPolicyFactory { + // This simple function encapsulates the entire process of reliably retrieving the token + let getToken = createTokenCycler(credential, scopes); + + class StorageBearerTokenChallengeAuthenticationPolicy extends BaseRequestPolicy { + public constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions) { + super(nextPolicy, options); + } + + public async sendRequest(webResource: WebResourceLike): Promise { + if (!webResource.url.toLowerCase().startsWith("https://")) { + throw new Error( + "Bearer token authentication is not permitted for non-TLS protected (non-https) URLs." + ); + } + + const getTokenInternal = getToken; + const token = ( + await getTokenInternal({ + abortSignal: webResource.abortSignal, + tracingOptions: { + tracingContext: webResource.tracingContext, + }, + }) + ).token; + webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${token}`); + + const response = await this._nextPolicy.sendRequest(webResource); + + if (response?.status === 401) { + const challenge = getChallenge(response); + if (challenge) { + const challengeInfo: Challenge = parseChallenge(challenge); + const challengeScopes = challengeInfo.resource_id + Constants.DefaultScope; + const parsedAuthUri = URLBuilder.parse(challengeInfo.authorization_uri); + const pathSegments = parsedAuthUri.getPath()!.split("/"); + const tenantId = pathSegments[1]; + const getTokenForChallenge = createTokenCycler(credential, challengeScopes); + + const tokenForChallenge = ( + await getTokenForChallenge({ + abortSignal: webResource.abortSignal, + tracingOptions: { + tracingContext: webResource.tracingContext, + }, + tenantId: tenantId, + }) + ).token; + + getToken = getTokenForChallenge; + webResource.headers.set( + Constants.HeaderConstants.AUTHORIZATION, + `Bearer ${tokenForChallenge}` + ); + return this._nextPolicy.sendRequest(webResource); + } + } + + return response; + } + } + + return { + create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions) => { + return new StorageBearerTokenChallengeAuthenticationPolicy(nextPolicy, options); + }, + }; +} diff --git a/sdk/storage/storage-queue/src/utils/constants.ts b/sdk/storage/storage-queue/src/utils/constants.ts index b0c13cac8582..2ddc2841eece 100644 --- a/sdk/storage/storage-queue/src/utils/constants.ts +++ b/sdk/storage/storage-queue/src/utils/constants.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export const SDK_VERSION: string = "12.15.0"; -export const SERVICE_VERSION: string = "2023-08-03"; +export const SDK_VERSION: string = "12.15.1"; +export const SERVICE_VERSION: string = "2023-11-03"; /** * The OAuth scope to use with Azure Storage. diff --git a/sdk/storage/storage-queue/swagger/README.md b/sdk/storage/storage-queue/swagger/README.md index 3f8778b364a5..03b3fecef9d0 100644 --- a/sdk/storage/storage-queue/swagger/README.md +++ b/sdk/storage/storage-queue/swagger/README.md @@ -20,7 +20,7 @@ disable-async-iterators: true add-credentials: false use-extension: "@autorest/typescript": "6.0.0-dev.20210218.1" -package-version: 12.15.0 +package-version: 12.15.1 ``` ## Customizations for Track 2 Generator @@ -226,13 +226,13 @@ directive: $["x-ms-client-name"] = "queueAnalyticsLogging" ``` -### Update service version from "2018-03-28" to "2023-08-03" +### Update service version from "2018-03-28" to "2023-11-03" ```yaml directive: - from: swagger-document where: $.parameters.ApiVersionParameter - transform: $.enum = [ "2023-08-03" ]; + transform: $.enum = [ "2023-11-03" ]; ``` ### Rename AccessPolicy start -> startsOn diff --git a/sdk/storage/storage-queue/test/node/queueclient.spec.ts b/sdk/storage/storage-queue/test/node/queueclient.spec.ts index 3eba02f9c869..22966c221e55 100644 --- a/sdk/storage/storage-queue/test/node/queueclient.spec.ts +++ b/sdk/storage/storage-queue/test/node/queueclient.spec.ts @@ -4,21 +4,29 @@ import { assert } from "chai"; import { getQSU, getConnectionStringFromEnvironment } from "../utils"; import { record, Recorder } from "@azure-tools/test-recorder"; -import { newPipeline, QueueClient, StorageSharedKeyCredential } from "../../src"; +import { + getQueueServiceAccountAudience, + newPipeline, + QueueClient, + QueueServiceClient, + StorageSharedKeyCredential, +} from "../../src"; import { TokenCredential } from "@azure/core-http"; import { assertClientUsesTokenCredential } from "../utils/assert"; -import { recorderEnvSetup } from "../utils/testutils.common"; +import { SimpleTokenCredential, recorderEnvSetup } from "../utils/testutils.common"; import { Context } from "mocha"; +import { DefaultAzureCredential } from "@azure/identity"; describe("QueueClient Node.js only", () => { let queueName: string; + let queueServiceClient: QueueServiceClient; let queueClient: QueueClient; let recorder: Recorder; beforeEach(async function (this: Context) { recorder = record(this, recorderEnvSetup); - const queueServiceClient = getQSU(); + queueServiceClient = getQSU(); queueName = recorder.getUniqueName("queue"); queueClient = queueServiceClient.getQueueClient(queueName); await queueClient.create(); @@ -29,6 +37,53 @@ describe("QueueClient Node.js only", () => { await recorder.stop(); }); + it("QueueClient default audience should work", async () => { + const queueClientWithOAuthToken = new QueueClient( + queueClient.url, + new DefaultAzureCredential() + ); + const exist = await queueClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("QueueClient customized audience should work", async () => { + const queueClientWithOAuthToken = new QueueClient( + queueClient.url, + new DefaultAzureCredential(), + { audience: getQueueServiceAccountAudience(queueServiceClient.accountName) } + ); + const exist = await queueClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + + it("QueueClient Bearer token challenge should work", async () => { + // Validate that bad audience should fail first. + const authToken = await new DefaultAzureCredential().getToken( + "https://badaudience.blob.core.windows.net/.default" + ); + const queueClientWithPlainOAuthToken = new QueueClient( + queueClient.url, + new SimpleTokenCredential(authToken.token) + ); + + try { + await queueClientWithPlainOAuthToken.exists(); + assert.fail("Should fail with 401"); + } catch (err) { + assert.strictEqual((err as any).statusCode, 401); + } + + const queueClientWithOAuthToken = new QueueClient( + queueClient.url, + new DefaultAzureCredential(), + { + audience: "https://badaudience.blob.core.windows.net/.default", + } + ); + const exist = await queueClientWithOAuthToken.exists(); + assert.equal(exist, true); + }); + it("getAccessPolicy", async () => { const result = await queueClient.getAccessPolicy(); assert.ok(result.requestId); diff --git a/sdk/storage/storage-queue/test/utils/assert.ts b/sdk/storage/storage-queue/test/utils/assert.ts index 666009af6a59..290f9882062a 100644 --- a/sdk/storage/storage-queue/test/utils/assert.ts +++ b/sdk/storage/storage-queue/test/utils/assert.ts @@ -7,5 +7,8 @@ import { StorageClient } from "../../src/StorageClient"; export function assertClientUsesTokenCredential(client: StorageClient): void { const factories = (client as any).pipeline.factories; const authPolicy = factories[factories.length - 1].create(); - assert.strictEqual(authPolicy.constructor.name, "BearerTokenAuthenticationPolicy"); + assert.strictEqual( + authPolicy.constructor.name, + "StorageBearerTokenChallengeAuthenticationPolicy" + ); } diff --git a/sdk/storage/storage-queue/test/utils/testutils.common.ts b/sdk/storage/storage-queue/test/utils/testutils.common.ts index f1b9778cc51c..c13465f433a3 100644 --- a/sdk/storage/storage-queue/test/utils/testutils.common.ts +++ b/sdk/storage/storage-queue/test/utils/testutils.common.ts @@ -2,6 +2,7 @@ // Licensed under the MIT license. import { env, RecorderEnvironmentSetup } from "@azure-tools/test-recorder"; +import { AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-http"; export function isBrowser(): boolean { return typeof self !== "undefined"; @@ -21,6 +22,9 @@ export const recorderEnvSetup: RecorderEnvironmentSetup = { // Comment following line to skip user delegation key/SAS related cases in record and play // which depends on this environment variable ACCOUNT_TOKEN: `${mockAccountKey}`, + AZURE_CLIENT_ID: `${mockAccountKey}`, + AZURE_TENANT_ID: `${mockAccountKey}`, + AZURE_CLIENT_SECRET: `${mockAccountKey}`, }, customizationsOnRecordings: [ // Used in record mode @@ -59,3 +63,46 @@ export function base64encode(content: string): string { export function base64decode(encodedString: string): string { return isBrowser() ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); } + +/** + * A TokenCredential that always returns the given token. This class can be + * used when the access token is already known or can be retrieved from an + * outside source. + */ +export class SimpleTokenCredential implements TokenCredential { + /** + * The raw token string. Can be changed when the token needs to be updated. + */ + public token: string; + + /** + * The Date at which the token expires. Can be changed to update the expiration time. + */ + public expiresOn: Date; + + /** + * Creates an instance of TokenCredential. + * @param token - + */ + constructor(token: string, expiresOn?: Date) { + this.token = token; + this.expiresOn = expiresOn ? expiresOn : new Date(Date.now() + 60 * 60 * 1000); + } + + /** + * Retrieves the token stored in this RawTokenCredential. + * + * @param _scopes - Ignored since token is already known. + * @param _options - Ignored since token is already known. + * @returns The access token details. + */ + async getToken( + _scopes: string | string[], + _options?: GetTokenOptions + ): Promise { + return { + token: this.token, + expiresOnTimestamp: this.expiresOn.getTime(), + }; + } +}