azure-sdk-for-js/sdk/core/core-client/test
Jeff Fisher 072c3f592b
[storage] address two issues related to Azure Disk Storage (#29087)
### Packages impacted by this PR

`@azure/storage-blob`

### Describe the problem that is addressed by this PR

As reported by @EmmaZhu there are currently two issues when interacting
with Azure Disk Storage.

The first is if you try to access a Storage account that is not properly
configured to support bearer challenges. In that case an invalid
`authorization_uri` will be returned. Our code currently makes
assumptions about `authorization_uri`, specifically that it can 'split'
the path part of the URL and reliably get a tenantId. In the case that a
valid tenant is not found, the request can end up refreshing in an
infinite loop.

My solution to this problem is to actually check if what we think is a
tenant id is a valid guid or not. Now in the case where we don't see the
expected `authorization_uri`, we will allow the request to fail with the
401.

The second issue occurs when the initial token scope is set to
`https://storage.azure.com/.default`, but the actual required scope is
`https://disk.azure.com//.default` -- when calculating the new scope we
do not duplicate the forward slash, but since the double forward slash
is **required** by the service, a workaround was needed to add it back
in.

### Are there test cases added in this PR? _(If not, why?)_

Yes
2024-04-01 09:09:29 -05:00
..
browser [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00
utils [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00
authorizeRequestOnClaimChallenge.spec.ts [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00
authorizeRequestOnTenantChallenge.spec.ts [storage] address two issues related to Azure Disk Storage (#29087) 2024-04-01 09:09:29 -05:00
deserializationPolicy.spec.ts [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00
serializationPolicy.spec.ts [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00
serializer.spec.ts [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00
serviceClient.spec.ts [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00
testMappers1.ts [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00
testMappers2.ts [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00
urlHelpers.spec.ts [core] Upgrade to ES-Modules for core (#26238) 2024-02-20 17:42:23 +00:00