diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java
index 5ed79aae5c3a..57e4f698d7cb 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java
@@ -29,18 +29,10 @@
import com.azure.storage.blob.models.SignedIdentifier;
import com.azure.storage.blob.models.StorageAccountInfo;
import com.azure.storage.blob.models.StorageException;
-import com.azure.storage.blob.models.UserDelegationKey;
-import com.azure.storage.blob.specialized.BlobServiceSasQueryParameters;
-import com.azure.storage.blob.specialized.BlobServiceSasSignatureValues;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
-import com.azure.storage.common.credentials.SharedKeyCredential;
import reactor.core.publisher.Mono;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
@@ -290,7 +282,7 @@ public Mono> deleteWithResponse(BlobContainerAccessConditions acc
Mono> deleteWithResponse(BlobContainerAccessConditions accessConditions, Context context) {
accessConditions = accessConditions == null ? new BlobContainerAccessConditions() : accessConditions;
- if (!validateNoEtag(accessConditions.getModifiedAccessConditions())) {
+ if (!validateNoETag(accessConditions.getModifiedAccessConditions())) {
// Throwing is preferred to Single.error because this will error out immediately instead of waiting until
// subscription.
throw logger.logExceptionAsError(
@@ -379,7 +371,7 @@ public Mono> setMetadataWithResponse(Map metadata
Mono> setMetadataWithResponse(Map metadata,
BlobContainerAccessConditions accessConditions, Context context) {
accessConditions = accessConditions == null ? new BlobContainerAccessConditions() : accessConditions;
- if (!validateNoEtag(accessConditions.getModifiedAccessConditions())
+ if (!validateNoETag(accessConditions.getModifiedAccessConditions())
|| accessConditions.getModifiedAccessConditions().getIfUnmodifiedSince() != null) {
// Throwing is preferred to Single.error because this will error out immediately instead of waiting until
// subscription.
@@ -486,7 +478,7 @@ Mono> setAccessPolicyWithResponse(PublicAccessType accessType, Li
BlobContainerAccessConditions accessConditions, Context context) {
accessConditions = accessConditions == null ? new BlobContainerAccessConditions() : accessConditions;
- if (!validateNoEtag(accessConditions.getModifiedAccessConditions())) {
+ if (!validateNoETag(accessConditions.getModifiedAccessConditions())) {
// Throwing is preferred to Single.error because this will error out immediately instead of waiting until
// subscription.
throw logger.logExceptionAsError(
@@ -785,194 +777,10 @@ Mono> getAccountInfoWithResponse(Context context) {
}
- private boolean validateNoEtag(ModifiedAccessConditions modifiedAccessConditions) {
+ private boolean validateNoETag(ModifiedAccessConditions modifiedAccessConditions) {
if (modifiedAccessConditions == null) {
return true;
}
return modifiedAccessConditions.getIfMatch() == null && modifiedAccessConditions.getIfNoneMatch() == null;
}
-
- /**
- * Generates a user delegation SAS with the specified parameters
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobContainerSasPermission permissions, OffsetDateTime expiryTime) {
- return this.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, null, null,
- null, null, null, null, null, null, null);
- }
-
- /**
- * Generates a user delegation SAS token with the specified parameters
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
- SASProtocol sasProtocol, IpRange ipRange) {
- return this.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime,
- version, sasProtocol, ipRange, null /* cacheControl */, null /* contentDisposition */, null /*
- contentEncoding */, null /* contentLanguage */, null /* contentType */);
- }
-
- /**
- * Generates a user delegation SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.BlobContainerAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure
- * Docs
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
- SASProtocol sasProtocol, IpRange ipRange, String cacheControl, String contentDisposition,
- String contentEncoding, String contentLanguage, String contentType) {
- BlobServiceSasSignatureValues blobServiceSASSignatureValues = new BlobServiceSasSignatureValues(version,
- sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange,
- null /* identifier*/, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
-
- BlobServiceSasSignatureValues values =
- configureServiceSASSignatureValues(blobServiceSASSignatureValues, accountName);
-
- BlobServiceSasQueryParameters blobServiceSasQueryParameters =
- values.generateSASQueryParameters(userDelegationKey);
-
- return blobServiceSasQueryParameters.encode();
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(BlobContainerSasPermission permissions, OffsetDateTime expiryTime) {
- return this.generateSAS(null, permissions, /* identifier */ expiryTime, null /* startTime */, null /* version
- */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /* contentDisposition */,
- null /* contentEncoding */, null /* contentLanguage */, null /*contentType*/);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier) {
- return this.generateSAS(identifier, null /* permissions*/, null /* expiryTime */, null /* startTime */, null
- /* version */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /*
- contentDisposition */, null /* contentEncoding */, null /* contentLanguage */, null /*contentType*/);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, BlobContainerSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) {
- return this.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null
- /* cacheControl */, null /* contentDisposition */, null /* contentEncoding */, null /* contentLanguage */,
- null /*contentType*/);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.BlobContainerAsyncClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure Docs
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, BlobContainerSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl,
- String contentDisposition, String contentEncoding, String contentLanguage, String contentType) {
- BlobServiceSasSignatureValues blobServiceSASSignatureValues = new BlobServiceSasSignatureValues(version,
- sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange,
- identifier, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
-
- SharedKeyCredential sharedKeyCredential =
- Utility.getSharedKeyCredential(this.azureBlobStorage.getHttpPipeline());
-
- Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);
-
- BlobServiceSasSignatureValues values = configureServiceSASSignatureValues(blobServiceSASSignatureValues,
- sharedKeyCredential.getAccountName());
-
- BlobServiceSasQueryParameters blobServiceSasQueryParameters =
- values.generateSASQueryParameters(sharedKeyCredential);
-
- return blobServiceSasQueryParameters.encode();
- }
-
- /**
- * Sets blobServiceSASSignatureValues parameters dependent on the current blob type
- */
- private BlobServiceSasSignatureValues configureServiceSASSignatureValues(
- BlobServiceSasSignatureValues blobServiceSASSignatureValues, String accountName) {
- // Set canonical name
- blobServiceSASSignatureValues.setCanonicalName(this.azureBlobStorage.getUrl(), accountName);
-
- // Set snapshotId to null
- blobServiceSASSignatureValues.setSnapshotId(null);
-
- // Set resource
- blobServiceSASSignatureValues.setResource(Constants.UrlConstants.SAS_CONTAINER_CONSTANT);
- return blobServiceSASSignatureValues;
- }
}
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java
index e8b37a78173b..66dfdd95c45a 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java
@@ -17,14 +17,10 @@
import com.azure.storage.blob.models.PublicAccessType;
import com.azure.storage.blob.models.SignedIdentifier;
import com.azure.storage.blob.models.StorageAccountInfo;
-import com.azure.storage.blob.models.UserDelegationKey;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import reactor.core.publisher.Mono;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
@@ -61,6 +57,7 @@ public final class BlobContainerClient {
this.blobContainerAsyncClient = blobContainerAsyncClient;
}
+
/**
* Initializes a new BlobClient object by concatenating blobName to the end of ContainerAsyncClient's URL. The new
* BlobClient uses the same request policy pipeline as the ContainerAsyncClient. To change the pipeline, create the
@@ -96,6 +93,19 @@ public BlobClient getBlobClient(String blobName, String snapshot) {
return new BlobClient(blobContainerAsyncClient.getBlobAsyncClient(blobName, snapshot));
}
+ /**
+ * Get the container name.
+ *
+ * Code Samples
+ *
+ * {@codesnippet com.azure.storage.blob.BlobContainerClient.getBlobContainerName}
+ *
+ * @return The name of container.
+ */
+ public String getBlobContainerName() {
+ return this.blobContainerAsyncClient.getBlobContainerName();
+ }
+
/**
* Gets the URL of the container represented by this client.
*
@@ -532,157 +542,4 @@ public Response getAccountInfoWithResponse(Duration timeout,
return Utility.blockWithOptionalTimeout(response, timeout);
}
-
- /**
- * Generates a user delegation SAS token with the specified parameters
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobContainerSasPermission permissions, OffsetDateTime expiryTime) {
- return this.blobContainerAsyncClient.generateUserDelegationSAS(userDelegationKey, accountName, permissions,
- expiryTime);
- }
-
- /**
- * Generates a user delegation SAS token with the specified parameters
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
- SASProtocol sasProtocol, IpRange ipRange) {
- return this.blobContainerAsyncClient.generateUserDelegationSAS(userDelegationKey, accountName, permissions,
- expiryTime, startTime, version, sasProtocol, ipRange);
- }
-
- /**
- * Generates a user delegation SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.BlobContainerClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure
- * Docs
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobContainerSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
- SASProtocol sasProtocol, IpRange ipRange, String cacheControl, String contentDisposition,
- String contentEncoding, String contentLanguage, String contentType) {
- return this.blobContainerAsyncClient.generateUserDelegationSAS(userDelegationKey, accountName, permissions,
- expiryTime, startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding,
- contentLanguage, contentType);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(BlobContainerSasPermission permissions, OffsetDateTime expiryTime) {
- return this.blobContainerAsyncClient.generateSAS(permissions, expiryTime);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier) {
- return this.blobContainerAsyncClient.generateSAS(identifier);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, BlobContainerSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) {
- return this.blobContainerAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version,
- sasProtocol, ipRange);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.BlobContainerClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure Docs
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @param permissions The {@code BlobContainerSasPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, BlobContainerSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl,
- String contentDisposition, String contentEncoding, String contentLanguage, String contentType) {
- return this.blobContainerAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version,
- sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- }
-
- /**
- * Get the container name.
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.BlobContainerClient.getBlobContainerName}
- *
- * @return The name of container.
- */
- public String getBlobContainerName() {
- return this.blobContainerAsyncClient.getBlobContainerName();
- }
}
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java
index 63e8fac4eb20..8dad684c6c19 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java
@@ -26,14 +26,7 @@
import com.azure.storage.blob.models.StorageServiceProperties;
import com.azure.storage.blob.models.StorageServiceStats;
import com.azure.storage.blob.models.UserDelegationKey;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.AccountSASSignatureValues;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
-import com.azure.storage.common.credentials.SharedKeyCredential;
import reactor.core.publisher.Mono;
import java.time.Duration;
@@ -453,53 +446,4 @@ Mono> getAccountInfoWithResponse(Context context) {
return postProcessResponse(this.azureBlobStorage.services().getAccountInfoWithRestResponseAsync(context))
.map(rb -> new SimpleResponse<>(rb, new StorageAccountInfo(rb.getDeserializedHeaders())));
}
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException if {@code sharedKeyCredential} is null
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime) {
- return this.generateAccountSAS(accountSASService, accountSASResourceType, accountSASPermission, expiryTime,
- null /* startTime */, null /* version */, null /* ipRange */, null /* sasProtocol */);
- }
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.blobServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol}
- *
- * For more information, see the
- * Azure Docs
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @param startTime The {@code OffsetDateTime} start time for the account SAS
- * @param version The {@code String} version for the account SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException if {@code sharedKeyCredential} is null
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime,
- String version, IpRange ipRange, SASProtocol sasProtocol) {
-
- SharedKeyCredential sharedKeyCredential =
- Utility.getSharedKeyCredential(this.azureBlobStorage.getHttpPipeline());
- Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);
-
- return AccountSASSignatureValues.generateAccountSAS(sharedKeyCredential, accountSASService,
- accountSASResourceType, accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol);
- }
}
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java
index 7e6d13c51843..0bb9ecc96066 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java
@@ -17,11 +17,6 @@
import com.azure.storage.blob.models.StorageServiceProperties;
import com.azure.storage.blob.models.StorageServiceStats;
import com.azure.storage.blob.models.UserDelegationKey;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import reactor.core.publisher.Mono;
@@ -359,46 +354,4 @@ public Response getAccountInfoWithResponse(Duration timeout,
return Utility.blockWithOptionalTimeout(response, timeout);
}
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @return A string that represents the SAS token
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime) {
- return this.blobServiceAsyncClient.generateAccountSAS(accountSASService, accountSASResourceType,
- accountSASPermission, expiryTime);
- }
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.blobServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol}
- *
- * For more information, see the
- * Azure Docs
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @param startTime The {@code OffsetDateTime} start time for the account SAS
- * @param version The {@code String} version for the account SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @return A string that represents the SAS token
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime,
- String version, IpRange ipRange, SASProtocol sasProtocol) {
- return this.blobServiceAsyncClient.generateAccountSAS(accountSASService, accountSASResourceType,
- accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol);
- }
}
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java
index e2bcd5812b85..d50317535180 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java
@@ -11,7 +11,6 @@
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.storage.blob.BlobProperties;
-import com.azure.storage.blob.BlobSasPermission;
import com.azure.storage.blob.BlobURLParts;
import com.azure.storage.blob.HTTPGetterInfo;
import com.azure.storage.blob.implementation.AzureBlobStorageBuilder;
@@ -30,12 +29,8 @@
import com.azure.storage.blob.models.SourceModifiedAccessConditions;
import com.azure.storage.blob.models.StorageAccountInfo;
import com.azure.storage.blob.models.StorageException;
-import com.azure.storage.blob.models.UserDelegationKey;
import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
-import com.azure.storage.common.credentials.SharedKeyCredential;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;
@@ -49,7 +44,6 @@
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
-import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -974,201 +968,4 @@ Mono> getAccountInfoWithResponse(Context context) {
this.azureBlobStorage.blobs().getAccountInfoWithRestResponseAsync(null, null, context))
.map(rb -> new SimpleResponse<>(rb, new StorageAccountInfo(rb.getDeserializedHeaders())));
}
-
- /**
- * Generates a user delegation SAS with the specified parameters
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code ContainerSASPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobSasPermission permissions, OffsetDateTime expiryTime) {
- return this.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, null /*
- startTime */, null /* version */, null /*sasProtocol */, null /* ipRange */, null /* cacheControl */, null
- /*contentDisposition */, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */);
- }
-
- /**
- * Generates a user delegation SAS token with the specified parameters
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code ContainerSASPermissions} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
- SASProtocol sasProtocol, IpRange ipRange) {
- return this.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime, startTime,
- version, sasProtocol, ipRange, null /* cacheControl */, null /* contentDisposition */, null /*
- contentEncoding */, null /* contentLanguage */, null /* contentType */);
- }
-
- /**
- * Generates a user delegation SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.specialized.BlobAsyncClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure
- * Docs
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code BlobSASPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
- SASProtocol sasProtocol, IpRange ipRange, String cacheControl, String contentDisposition,
- String contentEncoding, String contentLanguage, String contentType) {
-
- BlobServiceSasSignatureValues blobServiceSASSignatureValues = new BlobServiceSasSignatureValues(version,
- sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange,
- null /* identifier*/, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
-
- BlobServiceSasSignatureValues values = configureServiceSASSignatureValues(blobServiceSASSignatureValues,
- accountName);
-
- BlobServiceSasQueryParameters blobServiceSasQueryParameters =
- values.generateSASQueryParameters(userDelegationKey);
-
- return blobServiceSasQueryParameters.encode();
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param permissions The {@code BlobSASPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException if {@code sharedKeyCredential} is null
- */
- public String generateSAS(BlobSasPermission permissions, OffsetDateTime expiryTime) {
- return this.generateSAS(null, permissions, expiryTime, null /* startTime */, /* identifier */ null /*
- version */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /* contentLanguage*/,
- null /* contentEncoding */, null /* contentLanguage */, null /* contentType */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @return A string that represents the SAS token
- * @throws NullPointerException if {@code sharedKeyCredential} is null
- */
- public String generateSAS(String identifier) {
- return this.generateSAS(identifier, null /* permissions */, null /* expiryTime */, null /* startTime */,
- null /* version */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /*
- contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @param permissions The {@code BlobSASPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException if {@code sharedKeyCredential} is null
- */
- public String generateSAS(String identifier, BlobSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) {
- return this.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null
- /* cacheControl */, null /* contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */,
- null /* contentType */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.specialized.BlobAsyncClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure Docs
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @param permissions The {@code BlobSASPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- * @throws NullPointerException if {@code sharedKeyCredential} is null
- */
- public String generateSAS(String identifier, BlobSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl,
- String contentDisposition, String contentEncoding, String contentLanguage, String contentType) {
-
- BlobServiceSasSignatureValues blobServiceSASSignatureValues = new BlobServiceSasSignatureValues(version,
- sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange,
- identifier, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
-
- SharedKeyCredential sharedKeyCredential =
- Utility.getSharedKeyCredential(this.azureBlobStorage.getHttpPipeline());
-
- Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);
-
- BlobServiceSasSignatureValues values = configureServiceSASSignatureValues(blobServiceSASSignatureValues,
- sharedKeyCredential.getAccountName());
-
- BlobServiceSasQueryParameters blobServiceSasQueryParameters =
- values.generateSASQueryParameters(sharedKeyCredential);
-
- return blobServiceSasQueryParameters.encode();
- }
-
- /**
- * Sets blobServiceSASSignatureValues parameters dependent on the current blob type
- */
- private BlobServiceSasSignatureValues configureServiceSASSignatureValues(
- BlobServiceSasSignatureValues blobServiceSASSignatureValues, String accountName) {
-
- // Set canonical name
- blobServiceSASSignatureValues.setCanonicalName(this.azureBlobStorage.getUrl(), accountName);
-
- // Set snapshotId
- blobServiceSASSignatureValues.setSnapshotId(getSnapshotId());
-
- // Set resource
- if (isSnapshot()) {
- blobServiceSASSignatureValues.setResource(Constants.UrlConstants.SAS_BLOB_SNAPSHOT_CONSTANT);
- } else {
- blobServiceSASSignatureValues.setResource(Constants.UrlConstants.SAS_BLOB_CONSTANT);
- }
-
- return blobServiceSASSignatureValues;
- }
}
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java
index 1af4ac625d7f..18bbb6774ae3 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java
@@ -11,7 +11,6 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.storage.blob.BlobClient;
import com.azure.storage.blob.BlobProperties;
-import com.azure.storage.blob.BlobSasPermission;
import com.azure.storage.blob.models.AccessTier;
import com.azure.storage.blob.models.BlobAccessConditions;
import com.azure.storage.blob.models.BlobHTTPHeaders;
@@ -25,9 +24,6 @@
import com.azure.storage.blob.models.ReliableDownloadOptions;
import com.azure.storage.blob.models.StorageAccountInfo;
import com.azure.storage.blob.models.StorageException;
-import com.azure.storage.blob.models.UserDelegationKey;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import reactor.core.publisher.Mono;
@@ -37,7 +33,6 @@
import java.net.URL;
import java.nio.file.FileAlreadyExistsException;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.util.Map;
/**
@@ -783,143 +778,4 @@ public Response getAccountInfoWithResponse(Duration timeout,
return Utility.blockWithOptionalTimeout(response, timeout);
}
-
- /**
- * Generates a user delegation SAS token with the specified parameters
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code BlobSASPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobSasPermission permissions, OffsetDateTime expiryTime) {
- return this.client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime);
- }
-
- /**
- * Generates a user delegation SAS token with the specified parameters
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code BlobSASPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
- SASProtocol sasProtocol, IpRange ipRange) {
- return this.client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime,
- startTime, version, sasProtocol, ipRange);
- }
-
- /**
- * Generates a user delegation SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.specialized.BlobClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure
- * Docs
- *
- * @param userDelegationKey The {@code UserDelegationKey} user delegation key for the SAS
- * @param accountName The {@code String} account name for the SAS
- * @param permissions The {@code BlobSASPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- */
- public String generateUserDelegationSAS(UserDelegationKey userDelegationKey, String accountName,
- BlobSasPermission permissions, OffsetDateTime expiryTime, OffsetDateTime startTime, String version,
- SASProtocol sasProtocol, IpRange ipRange, String cacheControl, String contentDisposition,
- String contentEncoding, String contentLanguage, String contentType) {
- return this.client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime,
- startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding,
- contentLanguage, contentType);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param permissions The {@code BlobSASPermission} permission for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(OffsetDateTime expiryTime, BlobSasPermission permissions) {
- return this.client.generateSAS(permissions, expiryTime);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier) {
- return this.client.generateSAS(identifier);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @param permissions The {@code BlobSASPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, BlobSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) {
- return this.client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol,
- ipRange);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.blob.specialized.BlobClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure Docs
- *
- * @param identifier The {@code String} name of the access policy on the container this SAS references if any
- * @param permissions The {@code BlobSASPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, BlobSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl,
- String contentDisposition, String contentEncoding, String contentLanguage, String contentType) {
- return this.client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol,
- ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- }
}
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasSignatureValues.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasSignatureValues.java
index 2b94450513c7..3f4187ad1d3a 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasSignatureValues.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobServiceSasSignatureValues.java
@@ -195,14 +195,34 @@ public String getPermissions() {
}
/**
- * Sets the permissions string allowed by the SAS. Please refer to either {@link BlobContainerSasPermission} or
- * {@link BlobSasPermission} depending on the resource being accessed for help constructing the permissions string.
+ * Sets the Blob permissions allowed by the SAS.
*
- * @param permissions Permissions string for the SAS
+ * this will set the {@link #resource} to
+ * {@link com.azure.storage.common.Constants.UrlConstants#SAS_BLOB_CONSTANT}
+ * or {@link com.azure.storage.common.Constants.UrlConstants#SAS_BLOB_SNAPSHOT_CONSTANT} based on the value of
+ * {@link #getSnapshotId()}.
+ *
+ * @param permissions {@link BlobSasPermission}
* @return the updated BlobServiceSASSignatureValues object
*/
- public BlobServiceSasSignatureValues setPermissions(String permissions) {
- this.permissions = permissions;
+ public BlobServiceSasSignatureValues setPermissions(BlobSasPermission permissions) {
+ this.permissions = permissions.toString();
+ this.resource = Constants.UrlConstants.SAS_BLOB_CONSTANT;
+ return this;
+ }
+
+ /**
+ * Sets the Container permissions allowed by the SAS.
+ *
+ * this will set the {@link #resource} to
+ * {@link com.azure.storage.common.Constants.UrlConstants#SAS_CONTAINER_CONSTANT}.
+ *
+ * @param permissions {@link BlobContainerSasPermission}
+ * @return the updated BlobServiceSASSignatureValues object
+ */
+ public BlobServiceSasSignatureValues setPermissions(BlobContainerSasPermission permissions) {
+ this.permissions = permissions.toString();
+ this.resource = Constants.UrlConstants.SAS_CONTAINER_CONSTANT;
return this;
}
@@ -291,11 +311,19 @@ public String getSnapshotId() {
/**
* Sets the specific snapshot the SAS user may access.
*
+ * {@link #resource} will be set to
+ * {@link com.azure.storage.common.Constants.UrlConstants#SAS_BLOB_SNAPSHOT_CONSTANT} if the passed
+ * {@code snapshotId} isn't {@code null} and {@link #resource} is set to
+ * {@link com.azure.storage.common.Constants.UrlConstants#SAS_BLOB_CONSTANT}.
+ *
* @param snapshotId Identifier of the snapshot
* @return the updated BlobServiceSASSignatureValues object
*/
public BlobServiceSasSignatureValues setSnapshotId(String snapshotId) {
this.snapshotId = snapshotId;
+ if (snapshotId != null && Constants.UrlConstants.SAS_BLOB_CONSTANT.equals(resource)) {
+ this.resource = Constants.UrlConstants.SAS_BLOB_SNAPSHOT_CONSTANT;
+ }
return this;
}
diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobAsyncClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobAsyncClientJavaDocCodeSnippets.java
index 34da7ccad6d2..f0a199d5294d 100644
--- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobAsyncClientJavaDocCodeSnippets.java
+++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobAsyncClientJavaDocCodeSnippets.java
@@ -13,11 +13,7 @@
import com.azure.storage.blob.models.ParallelTransferOptions;
import com.azure.storage.blob.models.RehydratePriority;
import com.azure.storage.blob.models.ReliableDownloadOptions;
-import com.azure.storage.blob.models.UserDelegationKey;
import com.azure.storage.blob.specialized.BlobAsyncClientBase;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import reactor.core.publisher.Flux;
import java.io.ByteArrayOutputStream;
@@ -411,71 +407,6 @@ public void getAccountInfoWithResponseCodeSnippets() {
// END: com.azure.storage.blob.BlobAsyncClient.getAccountInfoWithResponse
}
- /**
- * Code snippet for {@link BlobAsyncClient#generateUserDelegationSAS(UserDelegationKey, String, BlobSasPermission,
- * OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateUserDelegationSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.BlobAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobSasPermission permissions = new BlobSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
- String accountName = "accountName";
- UserDelegationKey userDelegationKey = new UserDelegationKey();
-
- String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime,
- startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding,
- contentLanguage, contentType);
- // END: com.azure.storage.blob.BlobAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
- /**
- * Code snippet for {@link BlobAsyncClient#generateSAS(String, BlobSasPermission, OffsetDateTime, OffsetDateTime,
- * String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.BlobAsyncClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobSasPermission permissions = new BlobSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String identifier = "identifier";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- // Note either "identifier", or "expiryTime and permissions" are required to be set
- String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange,
- cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- // END: com.azure.storage.blob.BlobAsyncClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
/**
* Generates a code sample for using {@link BlobAsyncClient#getContainerName()}
*/
diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobClientJavaDocCodeSnippets.java
index 2f2b9b403ef0..fc7ab8622035 100644
--- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobClientJavaDocCodeSnippets.java
+++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobClientJavaDocCodeSnippets.java
@@ -15,11 +15,8 @@
import com.azure.storage.blob.models.RehydratePriority;
import com.azure.storage.blob.models.ReliableDownloadOptions;
import com.azure.storage.blob.models.StorageAccountInfo;
-import com.azure.storage.blob.models.UserDelegationKey;
import com.azure.storage.blob.specialized.BlobClientBase;
import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -388,71 +385,6 @@ public void getAccountInfoWithResponseCodeSnippets() {
// END: com.azure.storage.blob.BlobClient.getAccountInfoWithResponse#Duration-Context
}
- /**
- * Code snippet for {@link BlobClient#generateUserDelegationSAS(UserDelegationKey, String, BlobSasPermission,
- * OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateUserDelegationSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.BlobClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobSasPermission permissions = new BlobSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
- UserDelegationKey userDelegationKey = new UserDelegationKey();
- String accountName = "accountName";
-
- String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime,
- startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding,
- contentLanguage, contentType);
- // END: com.azure.storage.blob.BlobClient.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
- /**
- * Code snippet for {@link BlobClient#generateSAS(String, BlobSasPermission, OffsetDateTime, OffsetDateTime, String,
- * SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.BlobClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobSasPermission permissions = new BlobSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String identifier = "identifier";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- // Note either "identifier", or "expiryTime and permissions" are required to be set
- String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange,
- cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- // END: com.azure.storage.blob.BlobClient.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
/**
* Generates a code sample for using {@link BlobClient#getContainerName()}
*/
diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerAsyncClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerAsyncClientJavaDocCodeSnippets.java
index 79b7b0aa6773..1e9520302f9f 100644
--- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerAsyncClientJavaDocCodeSnippets.java
+++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerAsyncClientJavaDocCodeSnippets.java
@@ -12,10 +12,6 @@
import com.azure.storage.blob.models.ModifiedAccessConditions;
import com.azure.storage.blob.models.PublicAccessType;
import com.azure.storage.blob.models.SignedIdentifier;
-import com.azure.storage.blob.models.UserDelegationKey;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import java.time.Duration;
import java.time.OffsetDateTime;
@@ -36,74 +32,6 @@ public class BlobContainerAsyncClientJavaDocCodeSnippets {
private String proposedId = "proposedId";
private int leaseDuration = (int) Duration.ofSeconds(30).getSeconds();
- /**
- * Code snippet for {@link BlobContainerAsyncClient#generateUserDelegationSAS(UserDelegationKey, String,
- * BlobContainerSasPermission, OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String,
- * String, String)}
- */
- public void generateUserDelegationSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.BlobContainerAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobContainerSasPermission permissions = new BlobContainerSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true)
- .setListPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
- String accountName = "accountName";
- UserDelegationKey userDelegationKey = new UserDelegationKey();
-
- String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime,
- startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding,
- contentLanguage, contentType);
- // END: com.azure.storage.blob.BlobContainerAsyncClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
- /**
- * Code snippet for {@link BlobContainerAsyncClient#generateSAS(String, BlobContainerSasPermission, OffsetDateTime,
- * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.BlobContainerAsyncClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobContainerSasPermission permissions = new BlobContainerSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true)
- .setListPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String identifier = "identifier";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- // Note either "identifier", or "expiryTime and permissions" are required to be set
- String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange,
- cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- // END: com.azure.storage.blob.BlobContainerAsyncClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
/**
* Code snippet for {@link BlobContainerAsyncClient#getBlobAsyncClient(String)}
*/
diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerClientJavaDocCodeSnippets.java
index a26cdc9c76cc..743a4f8bd461 100644
--- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerClientJavaDocCodeSnippets.java
+++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobContainerClientJavaDocCodeSnippets.java
@@ -16,10 +16,6 @@
import com.azure.storage.blob.models.StorageAccountInfo;
import com.azure.storage.blob.models.StorageErrorCode;
import com.azure.storage.blob.models.StorageException;
-import com.azure.storage.blob.models.UserDelegationKey;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import java.time.Duration;
import java.time.OffsetDateTime;
@@ -38,74 +34,6 @@ public class BlobContainerClientJavaDocCodeSnippets {
private int leaseDuration = (int) Duration.ofSeconds(30).getSeconds();
private Duration timeout = Duration.ofSeconds(30);
- /**
- * Code snippet for {@link BlobContainerClient#generateUserDelegationSAS(UserDelegationKey, String,
- * BlobContainerSasPermission, OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String,
- * String, String)}
- */
- public void generateUserDelegationSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.BlobContainerClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobContainerSasPermission permissions = new BlobContainerSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true)
- .setListPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
- String accountName = "accountName";
- UserDelegationKey userDelegationKey = new UserDelegationKey();
-
- String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime,
- startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding,
- contentLanguage, contentType);
- // END: com.azure.storage.blob.BlobContainerClient.generateUserDelegationSAS#UserDelegationKey-String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
- /**
- * Code snippet for {@link BlobContainerClient#generateSAS(String, BlobContainerSasPermission, OffsetDateTime,
- * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.BlobContainerClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobContainerSasPermission permissions = new BlobContainerSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true)
- .setListPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String identifier = "";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- // Note either "identifier", or "expiryTime and permissions" are required to be set
- String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange,
- cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- // END: com.azure.storage.blob.BlobContainerClient.generateSAS#String-BlobContainerSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
/**
* Code snippet for {@link BlobContainerClient#getBlobClient(String)}
*/
diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java
index 1473724a4806..b5b7a22ead5b 100644
--- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java
+++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java
@@ -11,12 +11,6 @@
import com.azure.storage.blob.models.PublicAccessType;
import com.azure.storage.blob.models.RetentionPolicy;
import com.azure.storage.blob.models.StorageServiceProperties;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import java.time.OffsetDateTime;
import java.util.Collections;
import java.util.Map;
@@ -29,43 +23,6 @@ public class BlobServiceAsyncClientJavaDocCodeSnippets {
private BlobServiceAsyncClient client = JavaDocCodeSnippetsHelpers.getBlobServiceAsyncClient();
- /**
- * Generates a code sample for using {@link BlobServiceAsyncClient#generateAccountSAS(AccountSASService,
- * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)}
- */
- public void generateAccountSAS() {
- // BEGIN: com.azure.storage.blob.blobServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- AccountSASService service = new AccountSASService()
- .setBlob(true)
- .setFile(true)
- .setQueue(true)
- .setTable(true);
- AccountSASResourceType resourceType = new AccountSASResourceType()
- .setContainer(true)
- .setObject(true)
- .setService(true);
- AccountSASPermission permission = new AccountSASPermission()
- .setReadPermission(true)
- .setAddPermission(true)
- .setCreatePermission(true)
- .setWritePermission(true)
- .setDeletePermission(true)
- .setListPermission(true)
- .setProcessMessages(true)
- .setUpdatePermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- String sas = client.generateAccountSAS(service, resourceType, permission, expiryTime, startTime, version,
- ipRange, sasProtocol);
- // END: com.azure.storage.blob.blobServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- }
-
/**
* Code snippet for {@link BlobServiceAsyncClient#getBlobContainerAsyncClient(String)}
*/
@@ -91,8 +48,9 @@ public void createContainer() {
public void createContainerWithResponse() {
// BEGIN: com.azure.storage.blob.BlobServiceAsyncClient.createBlobContainerWithResponse#String-Map-PublicAccessType
Map metadata = Collections.singletonMap("metadata", "value");
- BlobContainerAsyncClient containerClient =
- client.createBlobContainerWithResponse("containerName", metadata, PublicAccessType.CONTAINER).block().getValue();
+
+ BlobContainerAsyncClient containerClient = client
+ .createBlobContainerWithResponse("containerName", metadata, PublicAccessType.CONTAINER).block().getValue();
// END: com.azure.storage.blob.BlobServiceAsyncClient.createBlobContainerWithResponse#String-Map-PublicAccessType
}
diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java
index 8ee24a5b5b23..acd4dc10390d 100644
--- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java
+++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceClientJavaDocCodeSnippets.java
@@ -12,12 +12,7 @@
import com.azure.storage.blob.models.RetentionPolicy;
import com.azure.storage.blob.models.StorageAccountInfo;
import com.azure.storage.blob.models.StorageServiceProperties;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
+
import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.Collections;
@@ -31,43 +26,6 @@ public class BlobServiceClientJavaDocCodeSnippets {
private final BlobServiceClient client = JavaDocCodeSnippetsHelpers.getBlobServiceClient();
private final Duration timeout = Duration.ofSeconds(30);
- /**
- * Generates a code sample for using {@link BlobServiceClient#generateAccountSAS(AccountSASService,
- * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)}
- */
- public void generateAccountSAS() {
- // BEGIN: com.azure.storage.blob.blobServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- AccountSASService service = new AccountSASService()
- .setBlob(true)
- .setFile(true)
- .setQueue(true)
- .setTable(true);
- AccountSASResourceType resourceType = new AccountSASResourceType()
- .setContainer(true)
- .setObject(true)
- .setService(true);
- AccountSASPermission permission = new AccountSASPermission()
- .setReadPermission(true)
- .setAddPermission(true)
- .setCreatePermission(true)
- .setWritePermission(true)
- .setDeletePermission(true)
- .setListPermission(true)
- .setProcessMessages(true)
- .setUpdatePermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- String sas = client.generateAccountSAS(service, resourceType, permission, expiryTime, startTime, version,
- ipRange, sasProtocol);
- // END: com.azure.storage.blob.blobServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- }
-
/**
* Code snippet for {@link BlobServiceClient#getBlobContainerClient(String)}
*/
diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobAsyncClientBaseJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobAsyncClientBaseJavaDocCodeSnippets.java
index d8c17072416a..03b5faa90702 100644
--- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobAsyncClientBaseJavaDocCodeSnippets.java
+++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobAsyncClientBaseJavaDocCodeSnippets.java
@@ -3,7 +3,6 @@
package com.azure.storage.blob.specialized;
-import com.azure.storage.blob.BlobSasPermission;
import com.azure.storage.blob.models.AccessTier;
import com.azure.storage.blob.models.BlobAccessConditions;
import com.azure.storage.blob.models.BlobHTTPHeaders;
@@ -14,10 +13,6 @@
import com.azure.storage.blob.models.ParallelTransferOptions;
import com.azure.storage.blob.models.RehydratePriority;
import com.azure.storage.blob.models.ReliableDownloadOptions;
-import com.azure.storage.blob.models.UserDelegationKey;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -407,69 +402,4 @@ public void getAccountInfoWithResponseCodeSnippets() {
response.getValue().getAccountKind(), response.getValue().getSkuName()));
// END: com.azure.storage.blob.specialized.BlobAsyncClientBase.getAccountInfoWithResponse
}
-
- /**
- * Code snippet for {@link BlobAsyncClientBase#generateUserDelegationSAS(UserDelegationKey, String, BlobSasPermission,
- * OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateUserDelegationSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobSasPermission permissions = new BlobSasPermission()
- .setAddPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
- String accountName = "accountName";
- UserDelegationKey userDelegationKey = new UserDelegationKey();
-
- String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime,
- startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding,
- contentLanguage, contentType);
- // END: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
- /**
- * Code snippet for {@link BlobAsyncClientBase#generateSAS(String, BlobSasPermission, OffsetDateTime, OffsetDateTime,
- * String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobSasPermission permissions = new BlobSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String identifier = "identifier";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- // Note either "identifier", or "expiryTime and permissions" are required to be set
- String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange,
- cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- // END: com.azure.storage.blob.specialized.BlobAsyncClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
}
diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobClientBaseJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobClientBaseJavaDocCodeSnippets.java
index 87fd7533d2a6..73bf9057425e 100644
--- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobClientBaseJavaDocCodeSnippets.java
+++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/BlobClientBaseJavaDocCodeSnippets.java
@@ -5,7 +5,6 @@
import com.azure.core.util.Context;
import com.azure.storage.blob.BlobProperties;
-import com.azure.storage.blob.BlobSasPermission;
import com.azure.storage.blob.models.AccessTier;
import com.azure.storage.blob.models.BlobAccessConditions;
import com.azure.storage.blob.models.BlobHTTPHeaders;
@@ -17,10 +16,7 @@
import com.azure.storage.blob.models.RehydratePriority;
import com.azure.storage.blob.models.ReliableDownloadOptions;
import com.azure.storage.blob.models.StorageAccountInfo;
-import com.azure.storage.blob.models.UserDelegationKey;
import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
@@ -393,69 +389,4 @@ public void getAccountInfoWithResponseCodeSnippets() {
System.out.printf("Account Kind: %s, SKU: %s%n", accountInfo.getAccountKind(), accountInfo.getSkuName());
// END: com.azure.storage.blob.specialized.BlobClientBase.getAccountInfoWithResponse#Duration-Context
}
-
- /**
- * Code snippet for {@link BlobClientBase#generateUserDelegationSAS(UserDelegationKey, String, BlobSasPermission,
- * OffsetDateTime, OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateUserDelegationSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.specialized.BlobClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobSasPermission permissions = new BlobSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
- UserDelegationKey userDelegationKey = new UserDelegationKey();
- String accountName = "accountName";
-
- String sas = client.generateUserDelegationSAS(userDelegationKey, accountName, permissions, expiryTime,
- startTime, version, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding,
- contentLanguage, contentType);
- // END: com.azure.storage.blob.specialized.BlobClientBase.generateUserDelegationSAS#UserDelegationKey-String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
- /**
- * Code snippet for {@link BlobClientBase#generateSAS(String, BlobSasPermission, OffsetDateTime, OffsetDateTime, String,
- * SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateSASCodeSnippets() {
- // BEGIN: com.azure.storage.blob.specialized.BlobClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- BlobSasPermission permissions = new BlobSasPermission()
- .setReadPermission(true)
- .setWritePermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setAddPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String identifier = "identifier";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- // Note either "identifier", or "expiryTime and permissions" are required to be set
- String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange,
- cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- // END: com.azure.storage.blob.specialized.BlobClientBase.generateSAS#String-BlobSASPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
}
diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/BlobAPITest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/BlobAPITest.groovy
index c2643cd3f484..31f1601b4dac 100644
--- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/BlobAPITest.groovy
+++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/BlobAPITest.groovy
@@ -15,7 +15,6 @@ import com.azure.storage.blob.models.DeleteSnapshotsOptionType
import com.azure.storage.blob.models.LeaseAccessConditions
import com.azure.storage.blob.models.LeaseStateType
import com.azure.storage.blob.models.LeaseStatusType
-
import com.azure.storage.blob.models.ModifiedAccessConditions
import com.azure.storage.blob.models.PublicAccessType
import com.azure.storage.blob.models.RehydratePriority
@@ -24,6 +23,7 @@ import com.azure.storage.blob.models.StorageErrorCode
import com.azure.storage.blob.models.StorageException
import com.azure.storage.blob.models.SyncCopyStatusType
import com.azure.storage.blob.specialized.BlobClientBase
+import com.azure.storage.blob.specialized.BlobServiceSasSignatureValues
import com.azure.storage.blob.specialized.SpecializedBlobClientBuilder
import spock.lang.Unroll
@@ -1455,7 +1455,13 @@ class BlobAPITest extends APISpec {
def bcCopy = cc.getBlobClient(generateBlobName()).getBlockBlobClient()
when:
- bcCopy.copyFromURLWithResponse(new URL(bc.getBlobUrl() + "?" + bc.generateSAS(OffsetDateTime.now().plusHours(1), new BlobSasPermission().setReadPermission(true))), null, tier2, null, null, null, null)
+ def sas = new BlobServiceSasSignatureValues()
+ .setExpiryTime(OffsetDateTime.now().plusHours(1))
+ .setPermissions(new BlobSasPermission().setReadPermission(true))
+ .setCanonicalName(bc.getBlobUrl().toString(), primaryCredential.getAccountName())
+ .generateSASQueryParameters(primaryCredential)
+ .encode()
+ bcCopy.copyFromURLWithResponse(new URL(bc.getBlobUrl().toString() + "?" + sas), null, tier2, null, null, null, null)
then:
bcCopy.getProperties().getAccessTier() == tier2
diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/CPKTest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/CPKTest.groovy
index 50dbf8541d4c..dd66b60a4c33 100644
--- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/CPKTest.groovy
+++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/CPKTest.groovy
@@ -2,10 +2,10 @@ package com.azure.storage.blob
import com.azure.core.http.policy.HttpLogDetailLevel
import com.azure.storage.blob.models.CustomerProvidedKey
-
import com.azure.storage.blob.models.PageRange
import com.azure.storage.blob.specialized.AppendBlobClient
import com.azure.storage.blob.specialized.BlobClientBase
+import com.azure.storage.blob.specialized.BlobServiceSasSignatureValues
import com.azure.storage.blob.specialized.BlockBlobClient
import com.azure.storage.blob.specialized.PageBlobClient
import com.azure.storage.common.Constants
@@ -92,8 +92,14 @@ class CPKTest extends APISpec {
sourceBlob.upload(defaultInputStream.get(), defaultDataSize)
when:
- def response = cpkBlockBlob.stageBlockFromURLWithResponse(getBlockID(),
- new URL(sourceBlob.getBlobUrl() + "?" + sourceBlob.generateSAS(OffsetDateTime.now().plusHours(1), new BlobSasPermission().setReadPermission(true))),
+ def sas = new BlobServiceSasSignatureValues()
+ .setExpiryTime(OffsetDateTime.now().plusHours(1))
+ .setPermissions(new BlobSasPermission().setReadPermission(true))
+ .setCanonicalName(sourceBlob.getBlobUrl().toString(), primaryCredential.getAccountName())
+ .generateSASQueryParameters(primaryCredential)
+ .encode()
+
+ def response = cpkBlockBlob.stageBlockFromURLWithResponse(getBlockID(), new URL(sourceBlob.getBlobUrl().toString() + "?" + sas),
null, null, null, null, null, null)
then:
@@ -141,9 +147,15 @@ class CPKTest extends APISpec {
cpkPageBlob.create(PageBlobClient.PAGE_BYTES)
when:
+ def sas = new BlobServiceSasSignatureValues()
+ .setExpiryTime(OffsetDateTime.now().plusHours(1))
+ .setPermissions(new BlobSasPermission().setReadPermission(true))
+ .setCanonicalName(sourceBlob.getBlobUrl().toString(), primaryCredential.getAccountName())
+ .generateSASQueryParameters(primaryCredential)
+ .encode()
+
def response = cpkPageBlob.uploadPagesFromURLWithResponse(new PageRange().setStart(0).setEnd(PageBlobClient.PAGE_BYTES - 1),
- new URL(sourceBlob.getBlobUrl() + "?" + sourceBlob.generateSAS(OffsetDateTime.now().plusHours(1), new BlobSasPermission().setReadPermission(true))),
- null, null, null, null, null, null)
+ new URL(sourceBlob.getBlobUrl().toString() + "?" + sas), null, null, null, null, null, null)
then:
response.getStatusCode() == 201
@@ -186,8 +198,13 @@ class CPKTest extends APISpec {
sourceBlob.upload(defaultInputStream.get(), defaultDataSize)
when:
- def response = cpkAppendBlob.appendBlockFromUrlWithResponse(
- new URL(sourceBlob.getBlobUrl() + "?" + sourceBlob.generateSAS(OffsetDateTime.now().plusHours(1), new BlobSasPermission().setReadPermission(true))),
+ def sas = new BlobServiceSasSignatureValues()
+ .setExpiryTime(OffsetDateTime.now().plusHours(1))
+ .setPermissions(new BlobSasPermission().setReadPermission(true))
+ .setCanonicalName(sourceBlob.getBlobUrl().toString(), primaryCredential.getAccountName())
+ .generateSASQueryParameters(primaryCredential)
+ .encode()
+ def response = cpkAppendBlob.appendBlockFromUrlWithResponse(new URL(sourceBlob.getBlobUrl().toString() + "?" + sas),
null, null, null, null, null, null)
then:
diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/SASTest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/SASTest.groovy
index 834f4d7be10b..3ff1e79a07d8 100644
--- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/SASTest.groovy
+++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/SASTest.groovy
@@ -118,7 +118,21 @@ class SASTest extends APISpec {
def contentType = "type"
when:
- def sas = bu.generateSAS(null, permissions, expiryTime, startTime, null, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType)
+ def sas = new BlobServiceSasSignatureValues()
+ .setPermissions(permissions)
+ .setExpiryTime(expiryTime)
+ .setStartTime(startTime)
+ .setProtocol(sasProtocol)
+ .setIpRange(ipRange)
+ .setCacheControl(cacheControl)
+ .setContentDisposition(contentDisposition)
+ .setContentEncoding(contentEncoding)
+ .setContentLanguage(contentLanguage)
+ .setContentType(contentType)
+ .setCanonicalName(bu.getBlobUrl(), primaryCredential.getAccountName())
+ .setSnapshotId(bu.getSnapshotId())
+ .generateSASQueryParameters(primaryCredential)
+ .encode()
def client = getBlobClient(sas, cc.getBlobContainerUrl(), blobName).getBlockBlobClient()
@@ -165,7 +179,21 @@ class SASTest extends APISpec {
def contentType = "type"
when:
- def sas = snapshotBlob.generateSAS(null, permissions, expiryTime, startTime, null, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType)
+ def sas = new BlobServiceSasSignatureValues()
+ .setPermissions(permissions)
+ .setExpiryTime(expiryTime)
+ .setStartTime(startTime)
+ .setProtocol(sasProtocol)
+ .setIpRange(ipRange)
+ .setCacheControl(cacheControl)
+ .setContentDisposition(contentDisposition)
+ .setContentEncoding(contentEncoding)
+ .setContentLanguage(contentLanguage)
+ .setContentType(contentType)
+ .setCanonicalName(snapshotBlob.getBlobUrl(), primaryCredential.getAccountName())
+ .setSnapshotId(snapshotBlob.getSnapshotId())
+ .generateSASQueryParameters(primaryCredential)
+ .encode()
def client = getBlobClient(sas, cc.getBlobContainerUrl(), blobName, snapshotId).getBlockBlobClient()
@@ -202,13 +230,23 @@ class SASTest extends APISpec {
def expiryTime = getUTCNow().plusDays(1)
when:
- def sasWithId = cc.generateSAS(identifier.getId())
+ def sasWithId = new BlobServiceSasSignatureValues()
+ .setIdentifier(identifier.getId())
+ .setCanonicalName(cc.getBlobContainerUrl(), primaryCredential.getAccountName())
+ .setResource(Constants.UrlConstants.SAS_CONTAINER_CONSTANT)
+ .generateSASQueryParameters(primaryCredential)
+ .encode()
def client1 = getContainerClient(sasWithId, cc.getBlobContainerUrl())
client1.listBlobsFlat().iterator().hasNext()
- def sasWithPermissions = cc.generateSAS(permissions, expiryTime)
+ def sasWithPermissions = new BlobServiceSasSignatureValues()
+ .setPermissions(permissions)
+ .setExpiryTime(expiryTime)
+ .setCanonicalName(cc.getBlobContainerUrl().toString(), primaryCredential.getAccountName())
+ .generateSASQueryParameters(primaryCredential)
+ .encode()
def client2 = getContainerClient(sasWithPermissions, cc.getBlobContainerUrl())
@@ -251,7 +289,22 @@ class SASTest extends APISpec {
def key = getOAuthServiceClient().getUserDelegationKey(null, expiryTime)
when:
- def sas = bu.generateUserDelegationSAS(key, primaryCredential.getAccountName(), permissions, expiryTime, startTime, key.getSignedVersion(), sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType)
+ def sas = new BlobServiceSasSignatureValues()
+ .setPermissions(permissions)
+ .setExpiryTime(expiryTime)
+ .setStartTime(startTime)
+ .setProtocol(sasProtocol)
+ .setIpRange(ipRange)
+ .setCacheControl(cacheControl)
+ .setContentDisposition(contentDisposition)
+ .setContentEncoding(contentEncoding)
+ .setContentLanguage(contentLanguage)
+ .setContentType(contentType)
+ .setCanonicalName(bu.getBlobUrl().toString(), primaryCredential.getAccountName())
+ .setSnapshotId(bu.getSnapshotId())
+ .setVersion(key.getSignedVersion())
+ .generateSASQueryParameters(key)
+ .encode()
then:
sas != null
@@ -301,7 +354,21 @@ class SASTest extends APISpec {
def contentType = "type"
when:
- def sas = snapshotBlob.generateSAS(null, permissions, expiryTime, startTime, null, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType)
+ def sas = new BlobServiceSasSignatureValues()
+ .setPermissions(permissions)
+ .setExpiryTime(expiryTime)
+ .setStartTime(startTime)
+ .setProtocol(sasProtocol)
+ .setIpRange(ipRange)
+ .setCacheControl(cacheControl)
+ .setContentDisposition(contentDisposition)
+ .setContentEncoding(contentEncoding)
+ .setContentLanguage(contentLanguage)
+ .setContentType(contentType)
+ .setCanonicalName(snapshotBlob.getBlobUrl(), primaryCredential.getAccountName())
+ .setSnapshotId(snapshotBlob.getSnapshotId())
+ .generateSASQueryParameters(primaryCredential)
+ .encode()
and:
def client = getBlobClient(sas, containerClient.getBlobContainerUrl(), blobName).getAppendBlobClient()
@@ -366,7 +433,22 @@ class SASTest extends APISpec {
def key = getOAuthServiceClient().getUserDelegationKey(startTime, expiryTime)
when:
- def sas = snapshotBlob.generateUserDelegationSAS(key, primaryCredential.getAccountName(), permissions, expiryTime, startTime, key.getSignedVersion(), sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType)
+ def sas = new BlobServiceSasSignatureValues()
+ .setPermissions(permissions)
+ .setExpiryTime(expiryTime)
+ .setStartTime(startTime)
+ .setProtocol(sasProtocol)
+ .setIpRange(ipRange)
+ .setCacheControl(cacheControl)
+ .setContentDisposition(contentDisposition)
+ .setContentEncoding(contentEncoding)
+ .setContentLanguage(contentLanguage)
+ .setContentType(contentType)
+ .setCanonicalName(snapshotBlob.getBlobUrl().toString(), primaryCredential.getAccountName())
+ .setSnapshotId(snapshotBlob.getSnapshotId())
+ .setVersion(key.getSignedVersion())
+ .generateSASQueryParameters(key)
+ .encode()
// base blob with snapshot SAS
def client1 = getBlobClient(sas, cc.getBlobContainerUrl(), blobName).getBlockBlobClient()
@@ -412,7 +494,12 @@ class SASTest extends APISpec {
def key = getOAuthServiceClient().getUserDelegationKey(null, expiryTime)
when:
- def sasWithPermissions = cc.generateUserDelegationSAS(key, primaryCredential.getAccountName(), permissions, expiryTime)
+ def sasWithPermissions = new BlobServiceSasSignatureValues()
+ .setPermissions(permissions)
+ .setExpiryTime(expiryTime)
+ .setCanonicalName(cc.getBlobContainerUrl().toString(), primaryCredential.getAccountName())
+ .generateSASQueryParameters(key)
+ .encode()
def client = getContainerClient(sasWithPermissions, cc.getBlobContainerUrl())
client.listBlobsFlat().iterator().hasNext()
@@ -439,7 +526,7 @@ class SASTest extends APISpec {
def expiryTime = getUTCNow().plusDays(1)
when:
- def sas = primaryBlobServiceClient.generateAccountSAS(service, resourceType, permissions, expiryTime, null, null, null, null)
+ def sas = AccountSASSignatureValues.generateAccountSAS(primaryCredential, service, resourceType, permissions, expiryTime, null, null, null, null)
def client = getBlobClient(sas, cc.getBlobContainerUrl(), blobName).getBlockBlobClient()
def os = new ByteArrayOutputStream()
@@ -467,7 +554,7 @@ class SASTest extends APISpec {
def expiryTime = getUTCNow().plusDays(1)
when:
- def sas = primaryBlobServiceClient.generateAccountSAS(service, resourceType, permissions, expiryTime, null, null, null, null)
+ def sas = AccountSASSignatureValues.generateAccountSAS(primaryCredential, service, resourceType, permissions, expiryTime, null, null, null, null)
def client = getBlobClient(sas, cc.getBlobContainerUrl(), blobName).getBlockBlobClient()
client.delete()
@@ -490,7 +577,7 @@ class SASTest extends APISpec {
def expiryTime = getUTCNow().plusDays(1)
when:
- def sas = primaryBlobServiceClient.generateAccountSAS(service, resourceType, permissions, expiryTime, null, null, null, null)
+ def sas = AccountSASSignatureValues.generateAccountSAS(primaryCredential, service, resourceType, permissions, expiryTime, null, null, null, null)
def sc = getServiceClient(sas, primaryBlobServiceClient.getAccountUrl())
sc.createBlobContainer(generateContainerName())
@@ -513,7 +600,7 @@ class SASTest extends APISpec {
def expiryTime = getUTCNow().plusDays(1)
when:
- def sas = primaryBlobServiceClient.generateAccountSAS(service, resourceType, permissions, expiryTime, null, null, null, null)
+ def sas = AccountSASSignatureValues.generateAccountSAS(primaryCredential, service, resourceType, permissions, expiryTime, null, null, null, null)
def sc = getServiceClient(sas, primaryBlobServiceClient.getAccountUrl())
sc.createBlobContainer(generateContainerName())
@@ -534,7 +621,7 @@ class SASTest extends APISpec {
def v = new BlobServiceSasSignatureValues()
def p = new BlobSasPermission()
p.setReadPermission(true)
- v.setPermissions(p.toString())
+ v.setPermissions(p)
v.setStartTime(startTime)
def e = OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)
@@ -587,7 +674,7 @@ class SASTest extends APISpec {
def p = new BlobSasPermission()
p.setReadPermission(true)
- v.setPermissions(p.toString())
+ v.setPermissions(p)
v.setStartTime(startTime)
def e = OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)
@@ -825,11 +912,14 @@ class SASTest extends APISpec {
.setVersion(version)
.setCanonicalName(canonicalName)
.setExpiryTime(expiryTime)
- .setPermissions(permissions)
.setIdentifier(identifier)
.setResource(resource)
.setSnapshotId(snapshotId)
+ if (permissions != null) {
+ serviceSASSignatureValues.setPermissions(permissions)
+ }
+
if (usingUserDelegation) {
serviceSASSignatureValues.generateSASQueryParameters(new UserDelegationKey())
} else {
@@ -841,16 +931,15 @@ class SASTest extends APISpec {
thrown(NullPointerException)
where:
- usingUserDelegation | version | canonicalName | expiryTime | permissions | identifier | resource | snapshotId
- false | null | null | null | null | null | null | null
- false | Constants.HeaderConstants.TARGET_STORAGE_VERSION | null | null | null | null | null | null
- false | Constants.HeaderConstants.TARGET_STORAGE_VERSION | "containerName/blobName" | null | null | null | null | null
- false | Constants.HeaderConstants.TARGET_STORAGE_VERSION | "containerName/blobName" | OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC) | null | null | null | null
- false | Constants.HeaderConstants.TARGET_STORAGE_VERSION | "containerName/blobName" | null | new BlobSasPermission().setReadPermission(true).toString() | null | null | null
- false | null | null | null | null | "0000" | "c" | "id"
+ usingUserDelegation | version | canonicalName | expiryTime | permissions | identifier | resource | snapshotId
+ false | null | null | null | null | null | null | null
+ false | Constants.HeaderConstants.TARGET_STORAGE_VERSION | null | null | null | null | null | null
+ false | Constants.HeaderConstants.TARGET_STORAGE_VERSION | "containerName/blobName" | null | null | null | null | null
+ false | Constants.HeaderConstants.TARGET_STORAGE_VERSION | "containerName/blobName" | OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC) | null | null | null | null
+ false | Constants.HeaderConstants.TARGET_STORAGE_VERSION | "containerName/blobName" | null | new BlobSasPermission().setReadPermission(true) | null | null | null
+ false | null | null | null | null | "0000" | "c" | "id"
}
- // TODO : Account SAS should go into the common package
/*
This test will ensure that each field gets placed into the proper location within the string to sign and that null
values are handled correctly. We will validate the whole SAS with service calls as well as correct serialization of
@@ -1035,7 +1124,7 @@ class SASTest extends APISpec {
.setBlobName("blob")
.setSnapshot("snapshot")
def sasValues = new BlobServiceSasSignatureValues()
- .setPermissions("r")
+ .setPermissions(new BlobSasPermission().setReadPermission(true))
.setCanonicalName("/containerName/blobName")
.setExpiryTime(OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC))
.setResource("bs")
diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/HelperTest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/HelperTest.groovy
index 7fa416b9809d..81223787366b 100644
--- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/HelperTest.groovy
+++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/HelperTest.groovy
@@ -88,9 +88,9 @@ class HelperTest extends APISpec {
when:
BlobServiceSasSignatureValues v = new BlobServiceSasSignatureValues()
if (permissions != null) {
- v.setPermissions(new BlobSasPermission().setReadPermission(true).toString())
+ v.setPermissions(new BlobSasPermission().setReadPermission(true))
} else {
- v.setPermissions("")
+ v.setPermissions(new BlobSasPermission())
}
if (snapId != null) {
@@ -164,9 +164,9 @@ class HelperTest extends APISpec {
when:
BlobServiceSasSignatureValues v = new BlobServiceSasSignatureValues()
if (permissions != null) {
- v.setPermissions(new BlobSasPermission().setReadPermission(true).toString())
+ v.setPermissions(new BlobSasPermission().setReadPermission(true))
} else {
- v.setPermissions("")
+ v.setPermissions(new BlobSasPermission())
}
v.setStartTime(startTime)
@@ -241,7 +241,7 @@ class HelperTest extends APISpec {
setup:
BlobServiceSasSignatureValues v = new BlobServiceSasSignatureValues()
.setExpiryTime(expiryTime)
- .setPermissions(new BlobSasPermission().toString())
+ .setPermissions(new BlobSasPermission())
.setResource(expectedResource)
.setCanonicalName(String.format("/blob/%s/%s", primaryCredential.getAccountName(), containerName))
.setSnapshotId(snapId)
@@ -272,8 +272,8 @@ class HelperTest extends APISpec {
@Unroll
def "serviceSasSignatureValues IA"() {
setup:
- BlobServiceSasSignatureValues v = new BlobServiceSasSignatureValues()
- .setPermissions(new AccountSASPermission().toString())
+ def v = new BlobServiceSasSignatureValues()
+ .setPermissions(new BlobSasPermission())
.setExpiryTime(OffsetDateTime.now())
.setResource(containerName)
.setCanonicalName(blobName)
@@ -635,7 +635,7 @@ class HelperTest extends APISpec {
BlobServiceSasSignatureValues sasValues = new BlobServiceSasSignatureValues()
.setExpiryTime(OffsetDateTime.now(ZoneOffset.UTC).plusDays(1))
- .setPermissions("r")
+ .setPermissions(new BlobSasPermission().setReadPermission(true))
.setCanonicalName(String.format("/blob/%s/container/blob", primaryCredential.getAccountName()))
.setResource(Constants.UrlConstants.SAS_BLOB_SNAPSHOT_CONSTANT)
diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworkcreatecontainerfails.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworkcreatecontainerfails.json
index cd2a35d5b50b..9dfb6f0dfcc2 100644
--- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworkcreatecontainerfails.json
+++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworkcreatecontainerfails.json
@@ -1,32 +1,32 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworkcreatecontainerfails0864650c46ca24?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworkcreatecontainerfails098222916cc6dd?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "c771c2b0-9bd8-46fb-b3ba-71448ef567d3"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "7639f4cb-e2e7-4a4f-887e-039e93d62f40"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D7356020CDCD4C\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:47 GMT",
+ "ETag" : "\"0x8D7484124A8B9EF\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:52 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fbbf4-801e-001f-0448-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "c771c2b0-9bd8-46fb-b3ba-71448ef567d3"
+ "x-ms-request-id" : "1ed03dae-f01e-00cd-662a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "7639f4cb-e2e7-4a4f-887e-039e93d62f40"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworkcreatecontainerfails1415220094cb8e?restype=container&sv=2019-02-02&ss=b&srt=sco&se=2019-09-10T19%3A58%3A48Z&sp=r&sig=REDACTED",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworkcreatecontainerfails135012fbc7d27b?restype=container&sv=2019-02-02&ss=b&srt=sco&se=2019-10-04T20%3A34%3A52Z&sp=r&sig=REDACTED",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "626eaf4b-7e6b-45a7-936d-58b805d43e87"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "41085bb5-ede6-4db9-9a82-0f9621d1594e"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -35,20 +35,20 @@
"retry-after" : "0",
"Content-Length" : "279",
"StatusCode" : "403",
- "x-ms-request-id" : "077fbc04-801e-001f-1248-673bbb000000",
- "Body" : "AuthorizationPermissionMismatchThis request is not authorized to perform this operation using this permission.\nRequestId:077fbc04-801e-001f-1248-673bbb000000\nTime:2019-09-09T19:58:48.0526009Z",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "626eaf4b-7e6b-45a7-936d-58b805d43e87",
+ "x-ms-request-id" : "1ed03dcb-f01e-00cd-802a-7a553e000000",
+ "Body" : "AuthorizationPermissionMismatchThis request is not authorized to perform this operation using this permission.\nRequestId:1ed03dcb-f01e-00cd-802a-7a553e000000\nTime:2019-10-03T20:34:52.1816531Z",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "41085bb5-ede6-4db9-9a82-0f9621d1594e",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net?prefix=jtcaccountsasnetworkcreatecontainerfails&comp=list",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net?prefix=jtcaccountsasnetworkcreatecontainerfails&comp=list",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "22d2903d-a6ce-465f-9d03-5c99ccf78f9f"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "d20ab1ca-3728-4a48-8102-9e6ea3e4f9a5"
},
"Response" : {
"Transfer-Encoding" : "chunked",
@@ -56,20 +56,20 @@
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fbc23-801e-001f-2c48-673bbb000000",
- "Body" : "jtcaccountsasnetworkcreatecontainerfailsjtcaccountsasnetworkcreatecontainerfails0864650c46ca24Mon, 09 Sep 2019 19:58:47 GMT\"0x8D7356020CDCD4C\"unlockedavailable$account-encryption-keyfalsefalsefalse",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "22d2903d-a6ce-465f-9d03-5c99ccf78f9f",
+ "x-ms-request-id" : "1ed03dda-f01e-00cd-0f2a-7a553e000000",
+ "Body" : "jtcaccountsasnetworkcreatecontainerfailsjtcaccountsasnetworkcreatecontainerfails098222916cc6ddThu, 03 Oct 2019 20:34:52 GMT\"0x8D7484124A8B9EF\"unlockedavailable$account-encryption-keyfalsefalsefalse",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "d20ab1ca-3728-4a48-8102-9e6ea3e4f9a5",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworkcreatecontainerfails0864650c46ca24?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworkcreatecontainerfails098222916cc6dd?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "fc012f87-629b-4d36-88e0-62a1f4ad6ce4"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "5d124be3-0195-4b6d-8f0e-2f64d7436884"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -77,11 +77,11 @@
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
- "x-ms-request-id" : "077fbc31-801e-001f-3a48-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "fc012f87-629b-4d36-88e0-62a1f4ad6ce4"
+ "x-ms-request-id" : "1ed03de8-f01e-00cd-1d2a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "5d124be3-0195-4b6d-8f0e-2f64d7436884"
},
"Exception" : null
} ],
- "variables" : [ "jtcaccountsasnetworkcreatecontainerfails0864650c46ca24", "2019-09-09T19:58:48.051Z", "jtcaccountsasnetworkcreatecontainerfails1415220094cb8e" ]
+ "variables" : [ "jtcaccountsasnetworkcreatecontainerfails098222916cc6dd", "2019-10-03T20:34:52.179008200Z", "jtcaccountsasnetworkcreatecontainerfails135012fbc7d27b" ]
}
\ No newline at end of file
diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworkcreatecontainersucceeds.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworkcreatecontainersucceeds.json
index 5067a7cc973e..097a9f6a5de9 100644
--- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworkcreatecontainersucceeds.json
+++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworkcreatecontainersucceeds.json
@@ -1,53 +1,53 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworkcreatecontainersucceeds085024a04341c?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworkcreatecontainersucceeds0955816992d43?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "6993f61a-97cc-4b4b-9e5c-4c34feb934ed"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "fca3df1f-96fa-4cc6-a84c-92e458812bfb"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D73560210317EA\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:48 GMT",
+ "ETag" : "\"0x8D7484124C410D7\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:52 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fbc40-801e-001f-4748-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "6993f61a-97cc-4b4b-9e5c-4c34feb934ed"
+ "x-ms-request-id" : "1ed03dfa-f01e-00cd-2e2a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "fca3df1f-96fa-4cc6-a84c-92e458812bfb"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworkcreatecontainersucceeds181802151c1ac?restype=container&sv=2019-02-02&ss=b&srt=sco&se=2019-09-10T19%3A58%3A48Z&sp=rc&sig=REDACTED",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworkcreatecontainersucceeds168048e7fdba3?restype=container&sv=2019-02-02&ss=b&srt=sco&se=2019-10-04T20%3A34%3A52Z&sp=rc&sig=REDACTED",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "afda5771-1286-47b5-9087-e535330e9bd5"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "20c9a56d-9b05-410e-836c-22392e872c92"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D735602110129A\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:48 GMT",
+ "ETag" : "\"0x8D7484124CB1770\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:52 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fbc4d-801e-001f-5248-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "afda5771-1286-47b5-9087-e535330e9bd5"
+ "x-ms-request-id" : "1ed03e11-f01e-00cd-402a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "20c9a56d-9b05-410e-836c-22392e872c92"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net?prefix=jtcaccountsasnetworkcreatecontainersucceeds&comp=list",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net?prefix=jtcaccountsasnetworkcreatecontainersucceeds&comp=list",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "8f417ba9-34d1-4338-88cb-9da4aa6759f9"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "11c603dd-20e2-4e83-a8ae-f79dafa950a2"
},
"Response" : {
"Transfer-Encoding" : "chunked",
@@ -55,20 +55,20 @@
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fbc5a-801e-001f-5c48-673bbb000000",
- "Body" : "jtcaccountsasnetworkcreatecontainersucceedsjtcaccountsasnetworkcreatecontainersucceeds085024a04341cMon, 09 Sep 2019 19:58:48 GMT\"0x8D73560210317EA\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcaccountsasnetworkcreatecontainersucceeds181802151c1acMon, 09 Sep 2019 19:58:48 GMT\"0x8D735602110129A\"unlockedavailable$account-encryption-keyfalsefalsefalse",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "8f417ba9-34d1-4338-88cb-9da4aa6759f9",
+ "x-ms-request-id" : "1ed03e33-f01e-00cd-5b2a-7a553e000000",
+ "Body" : "jtcaccountsasnetworkcreatecontainersucceedsjtcaccountsasnetworkcreatecontainersucceeds0955816992d43Thu, 03 Oct 2019 20:34:52 GMT\"0x8D7484124C410D7\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcaccountsasnetworkcreatecontainersucceeds168048e7fdba3Thu, 03 Oct 2019 20:34:52 GMT\"0x8D7484124CB1770\"unlockedavailable$account-encryption-keyfalsefalsefalse",
+ "Date" : "Thu, 03 Oct 2019 20:34:52 GMT",
+ "x-ms-client-request-id" : "11c603dd-20e2-4e83-a8ae-f79dafa950a2",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworkcreatecontainersucceeds085024a04341c?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworkcreatecontainersucceeds0955816992d43?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "e27a57d6-2083-4e31-b155-60e394aca5e4"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "66c49f51-2cd1-437b-8a62-ad184612bc69"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -76,18 +76,18 @@
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
- "x-ms-request-id" : "077fbc6c-801e-001f-6c48-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:48 GMT",
- "x-ms-client-request-id" : "e27a57d6-2083-4e31-b155-60e394aca5e4"
+ "x-ms-request-id" : "1ed03e49-f01e-00cd-702a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:52 GMT",
+ "x-ms-client-request-id" : "66c49f51-2cd1-437b-8a62-ad184612bc69"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworkcreatecontainersucceeds181802151c1ac?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworkcreatecontainersucceeds168048e7fdba3?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "7cc59a12-4e74-45fe-9814-b91449b702b8"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "e8fda95d-25e9-4ebd-b69d-6a9b64b0c6db"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -95,11 +95,11 @@
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
- "x-ms-request-id" : "077fbc7b-801e-001f-7b48-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:48 GMT",
- "x-ms-client-request-id" : "7cc59a12-4e74-45fe-9814-b91449b702b8"
+ "x-ms-request-id" : "1ed03e6a-f01e-00cd-0b2a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:52 GMT",
+ "x-ms-client-request-id" : "e8fda95d-25e9-4ebd-b69d-6a9b64b0c6db"
},
"Exception" : null
} ],
- "variables" : [ "jtcaccountsasnetworkcreatecontainersucceeds085024a04341c", "2019-09-09T19:58:48.400Z", "jtcaccountsasnetworkcreatecontainersucceeds181802151c1ac" ]
+ "variables" : [ "jtcaccountsasnetworkcreatecontainersucceeds0955816992d43", "2019-10-03T20:34:52.346458900Z", "jtcaccountsasnetworkcreatecontainersucceeds168048e7fdba3" ]
}
\ No newline at end of file
diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworktestblobdeletefails.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworktestblobdeletefails.json
index 0ffc5cabecad..ee6e98f95443 100644
--- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworktestblobdeletefails.json
+++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworktestblobdeletefails.json
@@ -1,57 +1,57 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworktestblobdeletefails0523992ab2f48e1?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworktestblobdeletefails06047960cc9decf?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "2f71364c-33fd-467a-84b6-2393135c8b85"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "69bb74f9-7a3b-425e-bfb1-7aca1e3c0646"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D73560208E208A\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:47 GMT",
+ "ETag" : "\"0x8D74841247FA409\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fbbc2-801e-001f-5748-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "2f71364c-33fd-467a-84b6-2393135c8b85"
+ "x-ms-request-id" : "1ed03d15-f01e-00cd-672a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "69bb74f9-7a3b-425e-bfb1-7aca1e3c0646"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworktestblobdeletefails0523992ab2f48e1/javablobaccountsasnetworktestblobdeletefails1483136b9f2e",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworktestblobdeletefails06047960cc9decf/javablobaccountsasnetworktestblobdeletefails114020533621",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "e4263362-dccc-417a-a0e4-4f53ee26316c",
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "cb9adf98-1b1c-4aa9-9b45-dcb97125d5d9",
"Content-Type" : "application/octet-stream"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-content-crc64" : "Q7G6/s6+u/k=",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:47 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-server-encrypted" : "true",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
"Content-MD5" : "CY9rzUYh03PK3k6DJie09g==",
- "ETag" : "\"0x8D73560209B4254\"",
+ "ETag" : "\"0x8D7484124885DEF\"",
"Content-Length" : "0",
- "x-ms-request-id" : "077fbbd3-801e-001f-6548-673bbb000000",
- "x-ms-client-request-id" : "e4263362-dccc-417a-a0e4-4f53ee26316c"
+ "x-ms-request-id" : "1ed03d33-f01e-00cd-802a-7a553e000000",
+ "x-ms-client-request-id" : "cb9adf98-1b1c-4aa9-9b45-dcb97125d5d9"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworktestblobdeletefails0523992ab2f48e1/javablobaccountsasnetworktestblobdeletefails1483136b9f2e?sv=2019-02-02&ss=b&srt=sco&se=2019-09-10T19%3A58%3A47Z&sp=r&sig=REDACTED",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworktestblobdeletefails06047960cc9decf/javablobaccountsasnetworktestblobdeletefails114020533621?sv=2019-02-02&ss=b&srt=sco&se=2019-10-04T20%3A34%3A51Z&sp=r&sig=REDACTED",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "662a20b8-404d-4b3a-b79a-f753f00e8370"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "f88cb540-342a-4caf-a3bd-e2cef1d347b3"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -60,20 +60,20 @@
"retry-after" : "0",
"Content-Length" : "279",
"StatusCode" : "403",
- "x-ms-request-id" : "077fbbdc-801e-001f-6e48-673bbb000000",
- "Body" : "AuthorizationPermissionMismatchThis request is not authorized to perform this operation using this permission.\nRequestId:077fbbdc-801e-001f-6e48-673bbb000000\nTime:2019-09-09T19:58:47.7223638Z",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "662a20b8-404d-4b3a-b79a-f753f00e8370",
+ "x-ms-request-id" : "1ed03d50-f01e-00cd-182a-7a553e000000",
+ "Body" : "AuthorizationPermissionMismatchThis request is not authorized to perform this operation using this permission.\nRequestId:1ed03d50-f01e-00cd-182a-7a553e000000\nTime:2019-10-03T20:34:51.9624428Z",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "f88cb540-342a-4caf-a3bd-e2cef1d347b3",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net?prefix=jtcaccountsasnetworktestblobdeletefails&comp=list",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net?prefix=jtcaccountsasnetworktestblobdeletefails&comp=list",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "685cde15-0d8a-4519-ace3-d2e8b9e1ab1e"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "0a8eb691-d87b-4801-9c12-4a4c972b5de1"
},
"Response" : {
"Transfer-Encoding" : "chunked",
@@ -81,20 +81,20 @@
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fbbe8-801e-001f-7848-673bbb000000",
- "Body" : "jtcaccountsasnetworktestblobdeletefailsjtcaccountsasnetworktestblobdeletefails0523992ab2f48e1Mon, 09 Sep 2019 19:58:47 GMT\"0x8D73560208E208A\"unlockedavailable$account-encryption-keyfalsefalsefalse",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "685cde15-0d8a-4519-ace3-d2e8b9e1ab1e",
+ "x-ms-request-id" : "1ed03d67-f01e-00cd-2d2a-7a553e000000",
+ "Body" : "jtcaccountsasnetworktestblobdeletefailsjtcaccountsasnetworktestblobdeletefails06047960cc9decfThu, 03 Oct 2019 20:34:51 GMT\"0x8D74841247FA409\"unlockedavailable$account-encryption-keyfalsefalsefalse",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "0a8eb691-d87b-4801-9c12-4a4c972b5de1",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworktestblobdeletefails0523992ab2f48e1?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworktestblobdeletefails06047960cc9decf?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "2a3fbc62-d10d-46b8-ae82-1eb672233ab8"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "55bb9b19-bfc9-473a-9407-390f258e3b90"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -102,11 +102,11 @@
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
- "x-ms-request-id" : "077fbbf2-801e-001f-0248-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:47 GMT",
- "x-ms-client-request-id" : "2a3fbc62-d10d-46b8-ae82-1eb672233ab8"
+ "x-ms-request-id" : "1ed03d91-f01e-00cd-4f2a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "55bb9b19-bfc9-473a-9407-390f258e3b90"
},
"Exception" : null
} ],
- "variables" : [ "jtcaccountsasnetworktestblobdeletefails0523992ab2f48e1", "javablobaccountsasnetworktestblobdeletefails1483136b9f2e", "2019-09-09T19:58:47.719Z" ]
+ "variables" : [ "jtcaccountsasnetworktestblobdeletefails06047960cc9decf", "javablobaccountsasnetworktestblobdeletefails114020533621", "2019-10-03T20:34:51.962903400Z" ]
}
\ No newline at end of file
diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworktestblobread.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworktestblobread.json
index 0d026afe8d26..7f731b36ba4d 100644
--- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworktestblobread.json
+++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestaccountsasnetworktestblobread.json
@@ -1,88 +1,87 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworktestblobread005273c382c5ea5e3e?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworktestblobread010505d22cfb909832?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "02cbfcef-9d92-4578-a746-2e8560fa98a0"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "be595caf-c4a2-4821-be37-d18caec62340"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D73560203F07A0\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:47 GMT",
+ "ETag" : "\"0x8D748412459C33E\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fbb70-801e-001f-0d48-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:46 GMT",
- "x-ms-client-request-id" : "02cbfcef-9d92-4578-a746-2e8560fa98a0"
+ "x-ms-request-id" : "1ed03c87-f01e-00cd-752a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "be595caf-c4a2-4821-be37-d18caec62340"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworktestblobread005273c382c5ea5e3e/javablobaccountsasnetworktestblobread1409227176455fc4",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworktestblobread010505d22cfb909832/javablobaccountsasnetworktestblobread117780fb62d19cf1",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "67df9187-5eb7-4ced-91b3-db67cdd23ada",
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "897482ff-449d-4621-ad9a-75c92827a2d1",
"Content-Type" : "application/octet-stream"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-content-crc64" : "Q7G6/s6+u/k=",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:47 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-server-encrypted" : "true",
- "Date" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
"Content-MD5" : "CY9rzUYh03PK3k6DJie09g==",
- "ETag" : "\"0x8D73560205356AA\"",
+ "ETag" : "\"0x8D7484124614499\"",
"Content-Length" : "0",
- "x-ms-request-id" : "077fbb83-801e-001f-1f48-673bbb000000",
- "x-ms-client-request-id" : "67df9187-5eb7-4ced-91b3-db67cdd23ada"
+ "x-ms-request-id" : "1ed03c9e-f01e-00cd-062a-7a553e000000",
+ "x-ms-client-request-id" : "897482ff-449d-4621-ad9a-75c92827a2d1"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworktestblobread005273c382c5ea5e3e/javablobaccountsasnetworktestblobread1409227176455fc4?sv=2019-02-02&ss=b&srt=sco&se=2019-09-10T19%3A58%3A47Z&sp=r&sig=REDACTED",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworktestblobread010505d22cfb909832/javablobaccountsasnetworktestblobread117780fb62d19cf1?sv=2019-02-02&ss=b&srt=sco&se=2019-10-04T20%3A34%3A51Z&sp=r&sig=REDACTED",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "baac3248-df60-4582-a68a-245b3df13b68"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "9a27887f-8ee4-4cfa-a9fb-adbe91d84fb5"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"x-ms-lease-status" : "unlocked",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "x-ms-tag-count" : "0",
"x-ms-lease-state" : "available",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:47 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"StatusCode" : "200",
- "Date" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
"x-ms-blob-type" : "BlockBlob",
"Content-MD5" : "CY9rzUYh03PK3k6DJie09g==",
"Accept-Ranges" : "bytes",
"x-ms-server-encrypted" : "true",
- "ETag" : "\"0x8D73560205356AA\"",
- "x-ms-creation-time" : "Mon, 09 Sep 2019 19:58:47 GMT",
+ "ETag" : "\"0x8D7484124614499\"",
+ "x-ms-creation-time" : "Thu, 03 Oct 2019 20:34:51 GMT",
"Content-Length" : "4",
- "x-ms-request-id" : "077fbb96-801e-001f-2e48-673bbb000000",
+ "x-ms-request-id" : "1ed03cbb-f01e-00cd-202a-7a553e000000",
"Body" : "[116, 101, 115, 116]",
- "x-ms-client-request-id" : "baac3248-df60-4582-a68a-245b3df13b68",
+ "x-ms-client-request-id" : "9a27887f-8ee4-4cfa-a9fb-adbe91d84fb5",
"Content-Type" : "application/octet-stream"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net?prefix=jtcaccountsasnetworktestblobread&comp=list",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net?prefix=jtcaccountsasnetworktestblobread&comp=list",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "d05b47ab-c627-4f72-a432-210ef3ecd4f4"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "75e1ee55-90be-4498-9baf-7981b25b7b54"
},
"Response" : {
"Transfer-Encoding" : "chunked",
@@ -90,20 +89,20 @@
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fbbad-801e-001f-4448-673bbb000000",
- "Body" : "jtcaccountsasnetworktestblobreadjtcaccountsasnetworktestblobread005273c382c5ea5e3eMon, 09 Sep 2019 19:58:47 GMT\"0x8D73560203F07A0\"unlockedavailable$account-encryption-keyfalsefalsefalse",
- "Date" : "Mon, 09 Sep 2019 19:58:46 GMT",
- "x-ms-client-request-id" : "d05b47ab-c627-4f72-a432-210ef3ecd4f4",
+ "x-ms-request-id" : "1ed03cd7-f01e-00cd-392a-7a553e000000",
+ "Body" : "jtcaccountsasnetworktestblobreadjtcaccountsasnetworktestblobread010505d22cfb909832Thu, 03 Oct 2019 20:34:51 GMT\"0x8D748412459C33E\"unlockedavailable$account-encryption-keyfalsefalsefalse",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "75e1ee55-90be-4498-9baf-7981b25b7b54",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcaccountsasnetworktestblobread005273c382c5ea5e3e?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcaccountsasnetworktestblobread010505d22cfb909832?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "ba0f3769-961a-424e-b0e0-076369b375b5"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "53299507-b9ff-4cf6-8c5e-1f95e87fe361"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -111,11 +110,11 @@
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
- "x-ms-request-id" : "077fbbbc-801e-001f-5148-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:46 GMT",
- "x-ms-client-request-id" : "ba0f3769-961a-424e-b0e0-076369b375b5"
+ "x-ms-request-id" : "1ed03cf0-f01e-00cd-4a2a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "53299507-b9ff-4cf6-8c5e-1f95e87fe361"
},
"Exception" : null
} ],
- "variables" : [ "jtcaccountsasnetworktestblobread005273c382c5ea5e3e", "javablobaccountsasnetworktestblobread1409227176455fc4", "2019-09-09T19:58:47.285Z" ]
+ "variables" : [ "jtcaccountsasnetworktestblobread010505d22cfb909832", "javablobaccountsasnetworktestblobread117780fb62d19cf1", "2019-10-03T20:34:51.709167400Z" ]
}
\ No newline at end of file
diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestblobservicesasnetworktestblobsnapshot.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestblobservicesasnetworktestblobsnapshot.json
index 926576a060cb..d5098767a2d6 100644
--- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestblobservicesasnetworktestblobsnapshot.json
+++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestblobservicesasnetworktestblobsnapshot.json
@@ -1,101 +1,101 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot090063b8550fc7?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot008074aacc125d?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "cde41189-880a-4f4f-88c4-15841c76e911"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "849b3f81-ec5c-46d7-8956-0cccfbc9cd63"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D735601FB5C15C\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "ETag" : "\"0x8D7484124094590\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fbaf3-801e-001f-1b48-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
- "x-ms-client-request-id" : "cde41189-880a-4f4f-88c4-15841c76e911"
+ "x-ms-request-id" : "1ed03b6d-f01e-00cd-0b2a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "849b3f81-ec5c-46d7-8956-0cccfbc9cd63"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot187339c10cc806?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot158813784f51d6?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "10a8e197-4c86-4d08-9593-9a702d3f4521"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "0b559db0-0676-4680-ad98-f206b44bf48c"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D735601FC2E320\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "ETag" : "\"0x8D7484124109A61\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fbafb-801e-001f-2248-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
- "x-ms-client-request-id" : "10a8e197-4c86-4d08-9593-9a702d3f4521"
+ "x-ms-request-id" : "1ed03b9e-f01e-00cd-312a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "0b559db0-0676-4680-ad98-f206b44bf48c"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot187339c10cc806/javablobblobservicesasnetworktestblobsnapshot268555a7e876",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot158813784f51d6/javablobblobservicesasnetworktestblobsnapshot24469591b681",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "120848c5-375d-429a-a26b-c676e4141ee3",
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "cd32119f-224a-477a-901d-41031d2b5371",
"Content-Type" : "application/octet-stream"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-content-crc64" : "6RYQPwaVsyQ=",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-server-encrypted" : "true",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
"Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==",
- "ETag" : "\"0x8D735601FD0A145\"",
+ "ETag" : "\"0x8D7484124189178\"",
"Content-Length" : "0",
- "x-ms-request-id" : "077fbb06-801e-001f-2c48-673bbb000000",
- "x-ms-client-request-id" : "120848c5-375d-429a-a26b-c676e4141ee3"
+ "x-ms-request-id" : "1ed03bb8-f01e-00cd-442a-7a553e000000",
+ "x-ms-client-request-id" : "cd32119f-224a-477a-901d-41031d2b5371"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot187339c10cc806/javablobblobservicesasnetworktestblobsnapshot268555a7e876?comp=snapshot",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot158813784f51d6/javablobblobservicesasnetworktestblobsnapshot24469591b681?comp=snapshot",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "6654505d-cbe6-4f6d-9dd5-e725130b5163"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "f658637d-0844-477e-84dc-884b78643104"
},
"Response" : {
"x-ms-version" : "2019-02-02",
- "x-ms-snapshot" : "2019-09-09T19:58:46.3934129Z",
+ "x-ms-snapshot" : "2019-10-03T20:34:51.2399010Z",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D735601FD0A145\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "ETag" : "\"0x8D7484124189178\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fbb10-801e-001f-3648-673bbb000000",
+ "x-ms-request-id" : "1ed03bd4-f01e-00cd-5c2a-7a553e000000",
"x-ms-request-server-encrypted" : "false",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
- "x-ms-client-request-id" : "6654505d-cbe6-4f6d-9dd5-e725130b5163"
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "f658637d-0844-477e-84dc-884b78643104"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot187339c10cc806/javablobblobservicesasnetworktestblobsnapshot268555a7e876?sv=2019-02-02&spr=https%2Chttp&st=2019-09-08T19%3A58%3A46Z&se=2019-09-10T19%3A58%3A46Z&sip=0.0.0.0-255.255.255.255&sr=bs&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot158813784f51d6/javablobblobservicesasnetworktestblobsnapshot24469591b681?sv=2019-02-02&spr=https%2Chttp&st=2019-10-02T20%3A34%3A51Z&se=2019-10-04T20%3A34%3A51Z&sip=0.0.0.0-255.255.255.255&sr=bs&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "7b4ba01c-cbf2-43d1-b86f-2af5e5a922cb"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "407fead0-425c-46ac-a8fa-962f042a550f"
},
"Response" : {
"Server" : "Microsoft-HTTPAPI/2.0",
@@ -103,87 +103,83 @@
"retry-after" : "0",
"Content-Length" : "447",
"StatusCode" : "403",
- "x-ms-request-id" : "077fbb23-801e-001f-4648-673bbb000000",
- "Body" : "AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:077fbb23-801e-001f-4648-673bbb000000\nTime:2019-09-09T19:58:46.4774727ZThe specified signed resource is not allowed for the this resource level",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
+ "x-ms-request-id" : "1ed03bfa-f01e-00cd-7c2a-7a553e000000",
+ "Body" : "AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:1ed03bfa-f01e-00cd-7c2a-7a553e000000\nTime:2019-10-03T20:34:51.3178255ZThe specified signed resource is not allowed for the this resource level",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot187339c10cc806/javablobblobservicesasnetworktestblobsnapshot268555a7e876?snapshot=2019-09-09T19%3a58%3a46.3934129Z&sv=2019-02-02&spr=https%2Chttp&st=2019-09-08T19%3A58%3A46Z&se=2019-09-10T19%3A58%3A46Z&sip=0.0.0.0-255.255.255.255&sr=bs&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot158813784f51d6/javablobblobservicesasnetworktestblobsnapshot24469591b681?snapshot=2019-10-03T20%3a34%3a51.2399010Z&sv=2019-02-02&spr=https%2Chttp&st=2019-10-02T20%3A34%3A51Z&se=2019-10-04T20%3A34%3A51Z&sip=0.0.0.0-255.255.255.255&sr=bs&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "12316e2e-d5e6-4ec5-bbe6-dab4db52032f"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "ea9a629b-8290-435a-a65e-5735f89736c6"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "x-ms-tag-count" : "0",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"StatusCode" : "200",
- "Date" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
"x-ms-blob-type" : "BlockBlob",
"Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==",
"Accept-Ranges" : "bytes",
"x-ms-server-encrypted" : "true",
- "x-ms-snapshot" : "2019-09-09T19:58:46.3934129Z",
"Cache-Control" : "cache",
- "ETag" : "\"0x8D735601FD0A145\"",
+ "ETag" : "\"0x8D7484124189178\"",
"Content-Disposition" : "disposition",
- "x-ms-creation-time" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "x-ms-creation-time" : "Thu, 03 Oct 2019 20:34:51 GMT",
"Content-Length" : "7",
- "x-ms-request-id" : "077fbb2e-801e-001f-5148-673bbb000000",
+ "x-ms-request-id" : "1ed03c11-f01e-00cd-102a-7a553e000000",
"Body" : "default",
- "x-ms-client-request-id" : "12316e2e-d5e6-4ec5-bbe6-dab4db52032f",
+ "x-ms-client-request-id" : "ea9a629b-8290-435a-a65e-5735f89736c6",
"Content-Language" : "language",
"Content-Type" : "type"
},
"Exception" : null
}, {
"Method" : "HEAD",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot187339c10cc806/javablobblobservicesasnetworktestblobsnapshot268555a7e876?snapshot=2019-09-09T19%3a58%3a46.3934129Z&sv=2019-02-02&spr=https%2Chttp&st=2019-09-08T19%3A58%3A46Z&se=2019-09-10T19%3A58%3A46Z&sip=0.0.0.0-255.255.255.255&sr=bs&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot158813784f51d6/javablobblobservicesasnetworktestblobsnapshot24469591b681?snapshot=2019-10-03T20%3a34%3a51.2399010Z&sv=2019-02-02&spr=https%2Chttp&st=2019-10-02T20%3A34%3A51Z&se=2019-10-04T20%3A34%3A51Z&sip=0.0.0.0-255.255.255.255&sr=bs&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "214fe5f2-816b-400a-8448-f8a34302d62e"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "6d17f45f-5cdd-4a55-b264-3e03cb24c4cf"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "x-ms-tag-count" : "0",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:51 GMT",
"retry-after" : "0",
"StatusCode" : "200",
- "Date" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
"x-ms-blob-type" : "BlockBlob",
"Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==",
"Accept-Ranges" : "bytes",
"x-ms-server-encrypted" : "true",
"x-ms-access-tier-inferred" : "true",
- "x-ms-snapshot" : "2019-09-09T19:58:46.3934129Z",
"x-ms-access-tier" : "Hot",
"Cache-Control" : "cache",
- "ETag" : "\"0x8D735601FD0A145\"",
+ "ETag" : "\"0x8D7484124189178\"",
"Content-Disposition" : "disposition",
"Content-Encoding" : "encoding",
- "x-ms-creation-time" : "Mon, 09 Sep 2019 19:58:46 GMT",
+ "x-ms-creation-time" : "Thu, 03 Oct 2019 20:34:51 GMT",
"Content-Length" : "7",
- "x-ms-request-id" : "077fbb41-801e-001f-6148-673bbb000000",
- "x-ms-client-request-id" : "214fe5f2-816b-400a-8448-f8a34302d62e",
+ "x-ms-request-id" : "1ed03c29-f01e-00cd-252a-7a553e000000",
+ "x-ms-client-request-id" : "6d17f45f-5cdd-4a55-b264-3e03cb24c4cf",
"Content-Language" : "language",
"Content-Type" : "type"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net?prefix=jtcblobservicesasnetworktestblobsnapshot&comp=list",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net?prefix=jtcblobservicesasnetworktestblobsnapshot&comp=list",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "dbabc1b4-d083-4114-bc18-5bebf07e0de9"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "0c0dc9ae-fcea-4c6b-99d3-d739209581ec"
},
"Response" : {
"Transfer-Encoding" : "chunked",
@@ -191,20 +187,20 @@
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fbb4e-801e-001f-6e48-673bbb000000",
- "Body" : "jtcblobservicesasnetworktestblobsnapshotjtcblobservicesasnetworktestblobsnapshot090063b8550fc7Mon, 09 Sep 2019 19:58:46 GMT\"0x8D735601FB5C15C\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcblobservicesasnetworktestblobsnapshot187339c10cc806Mon, 09 Sep 2019 19:58:46 GMT\"0x8D735601FC2E320\"unlockedavailable$account-encryption-keyfalsefalsefalse",
- "Date" : "Mon, 09 Sep 2019 19:58:46 GMT",
- "x-ms-client-request-id" : "dbabc1b4-d083-4114-bc18-5bebf07e0de9",
+ "x-ms-request-id" : "1ed03c40-f01e-00cd-372a-7a553e000000",
+ "Body" : "jtcblobservicesasnetworktestblobsnapshotjtcblobservicesasnetworktestblobsnapshot008074aacc125dThu, 03 Oct 2019 20:34:51 GMT\"0x8D7484124094590\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcblobservicesasnetworktestblobsnapshot158813784f51d6Thu, 03 Oct 2019 20:34:51 GMT\"0x8D7484124109A61\"unlockedavailable$account-encryption-keyfalsefalsefalse",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "0c0dc9ae-fcea-4c6b-99d3-d739209581ec",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot090063b8550fc7?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot008074aacc125d?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "1d22aa90-4adc-45f9-9c10-a0994a34a716"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "4060787e-3000-4d1b-970a-6eb8b1ac3c17"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -212,18 +208,18 @@
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
- "x-ms-request-id" : "077fbb5a-801e-001f-7a48-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:46 GMT",
- "x-ms-client-request-id" : "1d22aa90-4adc-45f9-9c10-a0994a34a716"
+ "x-ms-request-id" : "1ed03c52-f01e-00cd-462a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "4060787e-3000-4d1b-970a-6eb8b1ac3c17"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot187339c10cc806?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcblobservicesasnetworktestblobsnapshot158813784f51d6?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "af80d26d-15e2-472d-b382-4aec110a45c4"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "195b92be-b91f-4cd3-a2e4-6789298f1df4"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -231,11 +227,11 @@
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
- "x-ms-request-id" : "077fbb65-801e-001f-0448-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:46 GMT",
- "x-ms-client-request-id" : "af80d26d-15e2-472d-b382-4aec110a45c4"
+ "x-ms-request-id" : "1ed03c6e-f01e-00cd-5f2a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:51 GMT",
+ "x-ms-client-request-id" : "195b92be-b91f-4cd3-a2e4-6789298f1df4"
},
"Exception" : null
} ],
- "variables" : [ "jtcblobservicesasnetworktestblobsnapshot090063b8550fc7", "jtcblobservicesasnetworktestblobsnapshot187339c10cc806", "javablobblobservicesasnetworktestblobsnapshot268555a7e876", "2019-09-09T19:58:46.474Z", "2019-09-09T19:58:46.474Z" ]
+ "variables" : [ "jtcblobservicesasnetworktestblobsnapshot008074aacc125d", "jtcblobservicesasnetworktestblobsnapshot158813784f51d6", "javablobblobservicesasnetworktestblobsnapshot24469591b681", "2019-10-03T20:34:51.308964Z", "2019-10-03T20:34:51.308964Z" ]
}
\ No newline at end of file
diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestblob.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestblob.json
index e16c1372f9fe..62435a3708a4 100644
--- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestblob.json
+++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestblob.json
@@ -1,127 +1,125 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblob003141355f82b?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblob01262372542f2?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "cfa961eb-6241-414a-a645-2b8d13996773"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "03325978-d4db-4d3f-bb33-8f7588902cb1"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D735601E9EEE1B\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "ETag" : "\"0x8D748412344DB00\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:49 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fb9a7-801e-001f-6d48-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:43 GMT",
- "x-ms-client-request-id" : "cfa961eb-6241-414a-a645-2b8d13996773"
+ "x-ms-request-id" : "1ed03834-f01e-00cd-692a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:49 GMT",
+ "x-ms-client-request-id" : "03325978-d4db-4d3f-bb33-8f7588902cb1"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblob003141355f82b/javablobservicesassignaturevaluesnetworktestblob178524a837",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblob01262372542f2/javablobservicesassignaturevaluesnetworktestblob129798a7d7",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "5d7bce00-b7eb-4cfb-9d7e-4767765e0e1e",
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "9a96d51a-8644-4c5b-aaca-5471575c3e0e",
"Content-Type" : "application/octet-stream"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-content-crc64" : "Q7G6/s6+u/k=",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:49 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-server-encrypted" : "true",
- "Date" : "Mon, 09 Sep 2019 19:58:43 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:49 GMT",
"Content-MD5" : "CY9rzUYh03PK3k6DJie09g==",
- "ETag" : "\"0x8D735601EADBDE7\"",
+ "ETag" : "\"0x8D74841235AB97B\"",
"Content-Length" : "0",
- "x-ms-request-id" : "077fb9bd-801e-001f-0248-673bbb000000",
- "x-ms-client-request-id" : "5d7bce00-b7eb-4cfb-9d7e-4767765e0e1e"
+ "x-ms-request-id" : "1ed03884-f01e-00cd-312a-7a553e000000",
+ "x-ms-client-request-id" : "9a96d51a-8644-4c5b-aaca-5471575c3e0e"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblob003141355f82b/javablobservicesassignaturevaluesnetworktestblob178524a837?sv=2019-02-02&spr=https%2Chttp&st=2019-09-08T19%3A58%3A44Z&se=2019-09-10T19%3A58%3A44Z&sip=0.0.0.0-255.255.255.255&sr=b&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblob01262372542f2/javablobservicesassignaturevaluesnetworktestblob129798a7d7?sv=2019-02-02&spr=https%2Chttp&st=2019-10-02T20%3A34%3A50Z&se=2019-10-04T20%3A34%3A50Z&sip=0.0.0.0-255.255.255.255&sr=b&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "3621e8d1-07ad-4a77-9b32-0688da6a6c7c"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "d8279fb1-d595-4c24-8d2b-e920e951cd73"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"x-ms-lease-status" : "unlocked",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "x-ms-tag-count" : "0",
"x-ms-lease-state" : "available",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:49 GMT",
"retry-after" : "0",
"StatusCode" : "200",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:49 GMT",
"x-ms-blob-type" : "BlockBlob",
"Content-MD5" : "CY9rzUYh03PK3k6DJie09g==",
"Accept-Ranges" : "bytes",
"x-ms-server-encrypted" : "true",
"Cache-Control" : "cache",
- "ETag" : "\"0x8D735601EADBDE7\"",
+ "ETag" : "\"0x8D74841235AB97B\"",
"Content-Disposition" : "disposition",
- "x-ms-creation-time" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "x-ms-creation-time" : "Thu, 03 Oct 2019 20:34:49 GMT",
"Content-Length" : "4",
- "x-ms-request-id" : "077fb9c8-801e-001f-0d48-673bbb000000",
+ "x-ms-request-id" : "1ed038bf-f01e-00cd-6a2a-7a553e000000",
"Body" : "test",
- "x-ms-client-request-id" : "3621e8d1-07ad-4a77-9b32-0688da6a6c7c",
+ "x-ms-client-request-id" : "d8279fb1-d595-4c24-8d2b-e920e951cd73",
"Content-Language" : "language",
"Content-Type" : "type"
},
"Exception" : null
}, {
"Method" : "HEAD",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblob003141355f82b/javablobservicesassignaturevaluesnetworktestblob178524a837?sv=2019-02-02&spr=https%2Chttp&st=2019-09-08T19%3A58%3A44Z&se=2019-09-10T19%3A58%3A44Z&sip=0.0.0.0-255.255.255.255&sr=b&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblob01262372542f2/javablobservicesassignaturevaluesnetworktestblob129798a7d7?sv=2019-02-02&spr=https%2Chttp&st=2019-10-02T20%3A34%3A50Z&se=2019-10-04T20%3A34%3A50Z&sip=0.0.0.0-255.255.255.255&sr=b&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "9954fa47-d98f-4a32-b1c0-0c4e08a86701"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "9d3cc2ed-79ef-43e7-894b-ae840c373813"
},
"Response" : {
+ "x-ms-version" : "2019-02-02",
"x-ms-lease-status" : "unlocked",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "x-ms-tag-count" : "0",
"x-ms-lease-state" : "available",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:49 GMT",
"retry-after" : "0",
"StatusCode" : "200",
+ "Date" : "Thu, 03 Oct 2019 20:34:49 GMT",
"x-ms-blob-type" : "BlockBlob",
- "x-ms-access-tier-inferred" : "true",
- "x-ms-access-tier" : "Hot",
- "Content-Encoding" : "encoding",
- "x-ms-creation-time" : "Mon, 09 Sep 2019 19:58:44 GMT",
- "Content-Length" : "4",
- "x-ms-request-id" : "077fb9e0-801e-001f-2248-673bbb000000",
- "Content-Type" : "type",
- "x-ms-version" : "2019-02-02",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
"Content-MD5" : "CY9rzUYh03PK3k6DJie09g==",
"Accept-Ranges" : "bytes",
"x-ms-server-encrypted" : "true",
+ "x-ms-access-tier-inferred" : "true",
+ "x-ms-access-tier" : "Hot",
"Cache-Control" : "cache",
- "ETag" : "\"0x8D735601EADBDE7\"",
+ "ETag" : "\"0x8D74841235AB97B\"",
"Content-Disposition" : "disposition",
- "x-ms-client-request-id" : "9954fa47-d98f-4a32-b1c0-0c4e08a86701",
- "Content-Language" : "language"
+ "Content-Encoding" : "encoding",
+ "x-ms-creation-time" : "Thu, 03 Oct 2019 20:34:49 GMT",
+ "Content-Length" : "4",
+ "x-ms-request-id" : "1ed03909-f01e-00cd-1f2a-7a553e000000",
+ "x-ms-client-request-id" : "9d3cc2ed-79ef-43e7-894b-ae840c373813",
+ "Content-Language" : "language",
+ "Content-Type" : "type"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net?prefix=jtcservicesassignaturevaluesnetworktestblob&comp=list",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net?prefix=jtcservicesassignaturevaluesnetworktestblob&comp=list",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "f1d8ac90-a62f-494d-8b0b-d8944d4924c0"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "d0c3befb-eea4-42d8-850a-76d568f52b0a"
},
"Response" : {
"Transfer-Encoding" : "chunked",
@@ -129,20 +127,20 @@
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fb9e7-801e-001f-2948-673bbb000000",
- "Body" : "jtcservicesassignaturevaluesnetworktestblobjtcservicesassignaturevaluesnetworktestblob003141355f82bMon, 09 Sep 2019 19:58:44 GMT\"0x8D735601E9EEE1B\"unlockedavailable$account-encryption-keyfalsefalsefalse",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
- "x-ms-client-request-id" : "f1d8ac90-a62f-494d-8b0b-d8944d4924c0",
+ "x-ms-request-id" : "1ed03932-f01e-00cd-3e2a-7a553e000000",
+ "Body" : "jtcservicesassignaturevaluesnetworktestblobjtcservicesassignaturevaluesnetworktestblob01262372542f2Thu, 03 Oct 2019 20:34:49 GMT\"0x8D748412344DB00\"unlockedavailable$account-encryption-keyfalsefalsefalse",
+ "Date" : "Thu, 03 Oct 2019 20:34:49 GMT",
+ "x-ms-client-request-id" : "d0c3befb-eea4-42d8-850a-76d568f52b0a",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblob003141355f82b?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblob01262372542f2?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "5b235243-b5b9-406d-bb86-bcc4a2b12faf"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "1637a1ec-8b0a-48de-98b8-b2adf66ae4c0"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -150,11 +148,11 @@
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
- "x-ms-request-id" : "077fb9f9-801e-001f-3a48-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
- "x-ms-client-request-id" : "5b235243-b5b9-406d-bb86-bcc4a2b12faf"
+ "x-ms-request-id" : "1ed0395a-f01e-00cd-5c2a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:49 GMT",
+ "x-ms-client-request-id" : "1637a1ec-8b0a-48de-98b8-b2adf66ae4c0"
},
"Exception" : null
} ],
- "variables" : [ "jtcservicesassignaturevaluesnetworktestblob003141355f82b", "javablobservicesassignaturevaluesnetworktestblob178524a837", "2019-09-09T19:58:44.488Z", "2019-09-09T19:58:44.488Z" ]
+ "variables" : [ "jtcservicesassignaturevaluesnetworktestblob01262372542f2", "javablobservicesassignaturevaluesnetworktestblob129798a7d7", "2019-10-03T20:34:50.001180800Z", "2019-10-03T20:34:50.001180800Z" ]
}
\ No newline at end of file
diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestblobsnapshot.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestblobsnapshot.json
index ea02a54d1020..1f2b1e856a9f 100644
--- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestblobsnapshot.json
+++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestblobsnapshot.json
@@ -1,148 +1,144 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot0657374b8?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot027008dbe?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "02a0a7e3-4b98-4dad-a4c7-f6f13e687507"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "128ba654-daf3-4f24-bda1-1052424d5efd"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D735601EF75789\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "ETag" : "\"0x8D74841238CF230\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:50 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fba0d-801e-001f-4c48-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
- "x-ms-client-request-id" : "02a0a7e3-4b98-4dad-a4c7-f6f13e687507"
+ "x-ms-request-id" : "1ed03979-f01e-00cd-772a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:49 GMT",
+ "x-ms-client-request-id" : "128ba654-daf3-4f24-bda1-1052424d5efd"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot0657374b8/javablobservicesassignaturevaluesnetworktestblobsnapshot127421",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot027008dbe/javablobservicesassignaturevaluesnetworktestblobsnapshot196664",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "28aa8177-e97e-4821-9098-bca5b45e2d87",
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "f4d16bad-a985-47b3-bbe8-cece220b0051",
"Content-Type" : "application/octet-stream"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-content-crc64" : "Q7G6/s6+u/k=",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:50 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-server-encrypted" : "true",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:49 GMT",
"Content-MD5" : "CY9rzUYh03PK3k6DJie09g==",
- "ETag" : "\"0x8D735601F06C3B1\"",
+ "ETag" : "\"0x8D7484123955F84\"",
"Content-Length" : "0",
- "x-ms-request-id" : "077fba1f-801e-001f-5c48-673bbb000000",
- "x-ms-client-request-id" : "28aa8177-e97e-4821-9098-bca5b45e2d87"
+ "x-ms-request-id" : "1ed039a3-f01e-00cd-182a-7a553e000000",
+ "x-ms-client-request-id" : "f4d16bad-a985-47b3-bbe8-cece220b0051"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot0657374b8/javablobservicesassignaturevaluesnetworktestblobsnapshot127421?comp=snapshot",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot027008dbe/javablobservicesassignaturevaluesnetworktestblobsnapshot196664?comp=snapshot",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "b2883df2-d1ac-48c1-8511-93d3c7e638d5"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "028980b0-41fb-4d1d-9557-9f966dc5adc3"
},
"Response" : {
"x-ms-version" : "2019-02-02",
- "x-ms-snapshot" : "2019-09-09T19:58:45.0714675Z",
+ "x-ms-snapshot" : "2019-10-03T20:34:50.3821011Z",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D735601F06C3B1\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "ETag" : "\"0x8D7484123955F84\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:50 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fba31-801e-001f-6c48-673bbb000000",
+ "x-ms-request-id" : "1ed039c8-f01e-00cd-342a-7a553e000000",
"x-ms-request-server-encrypted" : "false",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
- "x-ms-client-request-id" : "b2883df2-d1ac-48c1-8511-93d3c7e638d5"
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "028980b0-41fb-4d1d-9557-9f966dc5adc3"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot0657374b8/javablobservicesassignaturevaluesnetworktestblobsnapshot127421?snapshot=2019-09-09T19%3a58%3a45.0714675Z&sv=2019-02-02&spr=https%2Chttp&st=2019-09-08T19%3A58%3A45Z&se=2019-09-10T19%3A58%3A45Z&sip=0.0.0.0-255.255.255.255&sr=bs&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot027008dbe/javablobservicesassignaturevaluesnetworktestblobsnapshot196664?snapshot=2019-10-03T20%3a34%3a50.3821011Z&sv=2019-02-02&spr=https%2Chttp&st=2019-10-02T20%3A34%3A50Z&se=2019-10-04T20%3A34%3A50Z&sip=0.0.0.0-255.255.255.255&sr=bs&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "eaa14bd4-a77d-4e57-bb1a-e871185dc046"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "25898546-840e-4fd9-a43f-593cf71161e8"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "x-ms-tag-count" : "0",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:50 GMT",
"retry-after" : "0",
"StatusCode" : "200",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
"x-ms-blob-type" : "BlockBlob",
"Content-MD5" : "CY9rzUYh03PK3k6DJie09g==",
"Accept-Ranges" : "bytes",
"x-ms-server-encrypted" : "true",
- "x-ms-snapshot" : "2019-09-09T19:58:45.0714675Z",
"Cache-Control" : "cache",
- "ETag" : "\"0x8D735601F06C3B1\"",
+ "ETag" : "\"0x8D7484123955F84\"",
"Content-Disposition" : "disposition",
- "x-ms-creation-time" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "x-ms-creation-time" : "Thu, 03 Oct 2019 20:34:50 GMT",
"Content-Length" : "4",
- "x-ms-request-id" : "077fba3f-801e-001f-7948-673bbb000000",
+ "x-ms-request-id" : "1ed03a04-f01e-00cd-652a-7a553e000000",
"Body" : "test",
- "x-ms-client-request-id" : "eaa14bd4-a77d-4e57-bb1a-e871185dc046",
+ "x-ms-client-request-id" : "25898546-840e-4fd9-a43f-593cf71161e8",
"Content-Language" : "language",
"Content-Type" : "type"
},
"Exception" : null
}, {
"Method" : "HEAD",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot0657374b8/javablobservicesassignaturevaluesnetworktestblobsnapshot127421?snapshot=2019-09-09T19%3a58%3a45.0714675Z&sv=2019-02-02&spr=https%2Chttp&st=2019-09-08T19%3A58%3A45Z&se=2019-09-10T19%3A58%3A45Z&sip=0.0.0.0-255.255.255.255&sr=bs&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot027008dbe/javablobservicesassignaturevaluesnetworktestblobsnapshot196664?snapshot=2019-10-03T20%3a34%3a50.3821011Z&sv=2019-02-02&spr=https%2Chttp&st=2019-10-02T20%3A34%3A50Z&se=2019-10-04T20%3A34%3A50Z&sip=0.0.0.0-255.255.255.255&sr=bs&sp=racwd&sig=REDACTED&rscc=cache&rscd=disposition&rsce=encoding&rscl=language&rsct=type",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "23bc32d5-4ea8-4c7f-ae58-dc749bcef191"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "f4dc6bca-547d-4da0-bf99-38d5d8d63de0"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "x-ms-tag-count" : "0",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:50 GMT",
"retry-after" : "0",
"StatusCode" : "200",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
"x-ms-blob-type" : "BlockBlob",
"Content-MD5" : "CY9rzUYh03PK3k6DJie09g==",
"Accept-Ranges" : "bytes",
"x-ms-server-encrypted" : "true",
"x-ms-access-tier-inferred" : "true",
- "x-ms-snapshot" : "2019-09-09T19:58:45.0714675Z",
"x-ms-access-tier" : "Hot",
"Cache-Control" : "cache",
- "ETag" : "\"0x8D735601F06C3B1\"",
+ "ETag" : "\"0x8D7484123955F84\"",
"Content-Disposition" : "disposition",
"Content-Encoding" : "encoding",
- "x-ms-creation-time" : "Mon, 09 Sep 2019 19:58:44 GMT",
+ "x-ms-creation-time" : "Thu, 03 Oct 2019 20:34:50 GMT",
"Content-Length" : "4",
- "x-ms-request-id" : "077fba4a-801e-001f-0148-673bbb000000",
- "x-ms-client-request-id" : "23bc32d5-4ea8-4c7f-ae58-dc749bcef191",
+ "x-ms-request-id" : "1ed03a1d-f01e-00cd-7a2a-7a553e000000",
+ "x-ms-client-request-id" : "f4dc6bca-547d-4da0-bf99-38d5d8d63de0",
"Content-Language" : "language",
"Content-Type" : "type"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net?prefix=jtcservicesassignaturevaluesnetworktestblobsnapshot&comp=list",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net?prefix=jtcservicesassignaturevaluesnetworktestblobsnapshot&comp=list",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "24a49203-e429-4412-8df0-edbf4a4354ab"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "d0b92efd-c8fb-41a2-8b1d-6680b2155dca"
},
"Response" : {
"Transfer-Encoding" : "chunked",
@@ -150,20 +146,20 @@
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fba54-801e-001f-0948-673bbb000000",
- "Body" : "jtcservicesassignaturevaluesnetworktestblobsnapshotjtcservicesassignaturevaluesnetworktestblobsnapshot0657374b8Mon, 09 Sep 2019 19:58:44 GMT\"0x8D735601EF75789\"unlockedavailable$account-encryption-keyfalsefalsefalse",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
- "x-ms-client-request-id" : "24a49203-e429-4412-8df0-edbf4a4354ab",
+ "x-ms-request-id" : "1ed03a33-f01e-00cd-0c2a-7a553e000000",
+ "Body" : "jtcservicesassignaturevaluesnetworktestblobsnapshotjtcservicesassignaturevaluesnetworktestblobsnapshot027008dbeThu, 03 Oct 2019 20:34:50 GMT\"0x8D74841238CF230\"unlockedavailable$account-encryption-keyfalsefalsefalse",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "d0b92efd-c8fb-41a2-8b1d-6680b2155dca",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot0657374b8?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestblobsnapshot027008dbe?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "41ad8387-fd4b-4d4c-a416-7867a9d5e7e8"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "5fd5bc72-7587-4c19-b844-4d49496d7b5d"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -171,11 +167,11 @@
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
- "x-ms-request-id" : "077fba5e-801e-001f-1348-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:44 GMT",
- "x-ms-client-request-id" : "41ad8387-fd4b-4d4c-a416-7867a9d5e7e8"
+ "x-ms-request-id" : "1ed03a42-f01e-00cd-1a2a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "5fd5bc72-7587-4c19-b844-4d49496d7b5d"
},
"Exception" : null
} ],
- "variables" : [ "jtcservicesassignaturevaluesnetworktestblobsnapshot0657374b8", "javablobservicesassignaturevaluesnetworktestblobsnapshot127421", "2019-09-09T19:58:45.176Z", "2019-09-09T19:58:45.176Z" ]
+ "variables" : [ "jtcservicesassignaturevaluesnetworktestblobsnapshot027008dbe", "javablobservicesassignaturevaluesnetworktestblobsnapshot196664", "2019-10-03T20:34:50.476181200Z", "2019-10-03T20:34:50.476181200Z" ]
}
\ No newline at end of file
diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestcontainer.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestcontainer.json
index a265ba393322..98d9e8578b54 100644
--- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestcontainer.json
+++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/SASTestservicesassignaturevaluesnetworktestcontainer.json
@@ -1,54 +1,54 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestcontainer0643470cc9?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestcontainer04317616b6?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "676ae308-f1d9-4c94-9067-9871048bcf75"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "f67eae24-8748-4ee9-8799-0c69146f91fb"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D735601F589C38\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:45 GMT",
+ "ETag" : "\"0x8D7484123CB6A11\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:50 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
- "x-ms-request-id" : "077fba68-801e-001f-1c48-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
- "x-ms-client-request-id" : "676ae308-f1d9-4c94-9067-9871048bcf75"
+ "x-ms-request-id" : "1ed03a5e-f01e-00cd-332a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "f67eae24-8748-4ee9-8799-0c69146f91fb"
},
"Exception" : null
}, {
"Method" : "PUT",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestcontainer0643470cc9?restype=container&comp=acl",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestcontainer04317616b6?restype=container&comp=acl",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "600345e0-15ee-4630-9a90-e841bd7a7e5e",
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "1fb8ca6c-50f0-48bf-9abd-8c158f749df9",
"Content-Type" : "application/xml; charset=utf-8"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
- "ETag" : "\"0x8D735601F71241E\"",
- "Last-Modified" : "Mon, 09 Sep 2019 19:58:45 GMT",
+ "ETag" : "\"0x8D7484123DAD463\"",
+ "Last-Modified" : "Thu, 03 Oct 2019 20:34:50 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fba94-801e-001f-4548-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
- "x-ms-client-request-id" : "600345e0-15ee-4630-9a90-e841bd7a7e5e"
+ "x-ms-request-id" : "1ed03a98-f01e-00cd-602a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "1fb8ca6c-50f0-48bf-9abd-8c158f749df9"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestcontainer0643470cc9?include=&restype=container&comp=list&sv=2019-02-02&si=0000&sr=c&sig=REDACTED",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestcontainer04317616b6?include=&restype=container&comp=list&sv=2019-02-02&si=0000&sr=c&sig=REDACTED",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "87e57f83-dfe7-43be-8be0-c5fa61b8f614"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "2ee78322-3395-444b-9ffb-2bef46e80daa"
},
"Response" : {
"Transfer-Encoding" : "chunked",
@@ -56,20 +56,20 @@
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fbaa3-801e-001f-5448-673bbb000000",
- "Body" : "",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
- "x-ms-client-request-id" : "87e57f83-dfe7-43be-8be0-c5fa61b8f614",
+ "x-ms-request-id" : "1ed03ae2-f01e-00cd-1a2a-7a553e000000",
+ "Body" : "",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "2ee78322-3395-444b-9ffb-2bef46e80daa",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestcontainer0643470cc9?include=&restype=container&comp=list&sv=2019-02-02&se=2019-09-10T19%3A58%3A45Z&sr=c&sp=racwdl&sig=REDACTED",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestcontainer04317616b6?include=&restype=container&comp=list&sv=2019-02-02&se=2019-10-04T20%3A34%3A50Z&sr=c&sp=racwdl&sig=REDACTED",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "c5ec45e9-f610-4112-9f70-957fe235b3a7"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "695b8651-d0b4-4f15-87e0-e5f6193b8975"
},
"Response" : {
"Transfer-Encoding" : "chunked",
@@ -77,20 +77,20 @@
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fbabd-801e-001f-6b48-673bbb000000",
- "Body" : "",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
- "x-ms-client-request-id" : "c5ec45e9-f610-4112-9f70-957fe235b3a7",
+ "x-ms-request-id" : "1ed03afe-f01e-00cd-322a-7a553e000000",
+ "Body" : "",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "695b8651-d0b4-4f15-87e0-e5f6193b8975",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net?prefix=jtcservicesassignaturevaluesnetworktestcontainer&comp=list",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net?prefix=jtcservicesassignaturevaluesnetworktestcontainer&comp=list",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "1ac8fa41-e2ce-4ebd-8824-acd1ca337ada"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "cb5f5ebe-69a2-40d3-8aca-aa1b3e0516d1"
},
"Response" : {
"Transfer-Encoding" : "chunked",
@@ -98,20 +98,20 @@
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
- "x-ms-request-id" : "077fbacc-801e-001f-7648-673bbb000000",
- "Body" : "jtcservicesassignaturevaluesnetworktestcontainerjtcservicesassignaturevaluesnetworktestcontainer0643470cc9Mon, 09 Sep 2019 19:58:45 GMT\"0x8D735601F71241E\"unlockedavailable$account-encryption-keyfalsefalsefalse",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
- "x-ms-client-request-id" : "1ac8fa41-e2ce-4ebd-8824-acd1ca337ada",
+ "x-ms-request-id" : "1ed03b1c-f01e-00cd-4b2a-7a553e000000",
+ "Body" : "jtcservicesassignaturevaluesnetworktestcontainerjtcservicesassignaturevaluesnetworktestcontainer04317616b6Thu, 03 Oct 2019 20:34:50 GMT\"0x8D7484123DAD463\"unlockedavailable$account-encryption-keyfalsefalsefalse",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "cb5f5ebe-69a2-40d3-8aca-aa1b3e0516d1",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "DELETE",
- "Uri" : "https://jaschrepragrs.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestcontainer0643470cc9?restype=container",
+ "Uri" : "https://azstoragesdkaccount.blob.core.windows.net/jtcservicesassignaturevaluesnetworktestcontainer04317616b6?restype=container",
"Headers" : {
"x-ms-version" : "2019-02-02",
- "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.3 1.8.0_221; Windows 10 10.0",
- "x-ms-client-request-id" : "3d9a94ad-9ab3-4589-8720-65107a918370"
+ "User-Agent" : "azsdk-java-azure-storage-blob/12.0.0-preview.4 11.0.4; Windows 10 10.0",
+ "x-ms-client-request-id" : "87a9ce16-c038-4117-93bc-c0bd2d85a7d9"
},
"Response" : {
"x-ms-version" : "2019-02-02",
@@ -119,11 +119,11 @@
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
- "x-ms-request-id" : "077fbada-801e-001f-0448-673bbb000000",
- "Date" : "Mon, 09 Sep 2019 19:58:45 GMT",
- "x-ms-client-request-id" : "3d9a94ad-9ab3-4589-8720-65107a918370"
+ "x-ms-request-id" : "1ed03b38-f01e-00cd-602a-7a553e000000",
+ "Date" : "Thu, 03 Oct 2019 20:34:50 GMT",
+ "x-ms-client-request-id" : "87a9ce16-c038-4117-93bc-c0bd2d85a7d9"
},
"Exception" : null
} ],
- "variables" : [ "jtcservicesassignaturevaluesnetworktestcontainer0643470cc9", "2019-09-09T19:58:45.639Z", "2019-09-09T19:58:45.775Z" ]
+ "variables" : [ "jtcservicesassignaturevaluesnetworktestcontainer04317616b6", "2019-10-03T20:34:50.731565200Z", "2019-10-03T20:34:50.845196800Z" ]
}
\ No newline at end of file
diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java
index e399835a6204..6af096fe948d 100644
--- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java
+++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileAsyncClient.java
@@ -13,9 +13,6 @@
import com.azure.core.implementation.util.FluxUtil;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.implementation.AzureFileStorageImpl;
@@ -1097,116 +1094,6 @@ public String getShareSnapshotId() {
return this.snapshot;
}
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param permissions The {@code FileSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredentials} is null
- */
- public String generateSAS(FileSasPermission permissions, OffsetDateTime expiryTime) {
- return this.generateSAS(null, permissions, expiryTime, null /* startTime */, /* identifier */ null /*
- version */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /* contentLanguage*/,
- null /* contentEncoding */, null /* contentLanguage */, null /* contentType */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredentials} is null
- */
- public String generateSAS(String identifier) {
- return this.generateSAS(identifier, null /* permissions */, null /* expiryTime */, null /* startTime */,
- null /* version */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /*
- contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @param permissions The {@code FileSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredentials} is null
- */
- public String generateSAS(String identifier, FileSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) {
- return this.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null
- /* cacheControl */, null /* contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */,
- null /* contentType */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.file.fileAsyncClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure Docs.
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @param permissions The {@code FileSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredentials} is null
- */
- public String generateSAS(String identifier, FileSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange,
- String cacheControl, String contentDisposition, String contentEncoding,
- String contentLanguage, String contentType) {
-
- FileServiceSasSignatureValues fileServiceSASSignatureValues = new FileServiceSasSignatureValues(version,
- sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange,
- identifier, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
-
- SharedKeyCredential sharedKeyCredential =
- Utility.getSharedKeyCredential(this.azureFileStorageClient.getHttpPipeline());
-
- Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);
-
- FileServiceSasSignatureValues values = configureServiceSASSignatureValues(fileServiceSASSignatureValues,
- sharedKeyCredential.getAccountName());
-
- FileServiceSasQueryParameters fileServiceSasQueryParameters =
- values.generateSASQueryParameters(sharedKeyCredential);
-
- return fileServiceSasQueryParameters.encode();
- }
-
- /**
- * Sets fileServiceSASSignatureValues parameters dependent on the current file type
- */
- FileServiceSasSignatureValues configureServiceSASSignatureValues(
- FileServiceSasSignatureValues fileServiceSASSignatureValues, String accountName) {
-
- // Set canonical name
- fileServiceSASSignatureValues.setCanonicalName(this.shareName, this.filePath, accountName);
-
- // Set resource
- fileServiceSASSignatureValues.setResource(Constants.UrlConstants.SAS_FILE_CONSTANT);
-
- return fileServiceSASSignatureValues;
- }
-
/**
* Get the share name of file client.
*
diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java
index 0dbc2eeca6ca..082857cf1893 100644
--- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java
+++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileClient.java
@@ -7,8 +7,6 @@
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.models.FileCopyInfo;
@@ -29,7 +27,6 @@
import java.nio.ByteBuffer;
import java.nio.file.FileAlreadyExistsException;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.util.Map;
/**
@@ -856,76 +853,6 @@ public String getShareSnapshotId() {
return fileAsyncClient.getShareSnapshotId();
}
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param permissions The {@code FileSasPermission} permission for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(OffsetDateTime expiryTime, FileSasPermission permissions) {
- return this.fileAsyncClient.generateSAS(permissions, expiryTime);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier) {
- return this.fileAsyncClient.generateSAS(identifier);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @param permissions The {@code FileSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, FileSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) {
- return this.fileAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol,
- ipRange);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.file.FileClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure Docs.
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @param permissions The {@code FileSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, FileSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl,
- String contentDisposition, String contentEncoding, String contentLanguage, String contentType) {
- return this.fileAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol,
- ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- }
-
/**
* Get the share name of file client.
*
diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceAsyncClient.java
index 1ee25a7e2dc7..f6b016f8acfc 100644
--- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceAsyncClient.java
+++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceAsyncClient.java
@@ -13,12 +13,6 @@
import com.azure.core.implementation.util.ImplUtils;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.AccountSASSignatureValues;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.implementation.AzureFileStorageImpl;
@@ -32,7 +26,6 @@
import reactor.core.publisher.Mono;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -437,53 +430,4 @@ Mono> deleteShareWithResponse(String shareName, String snapshot,
.deleteWithRestResponseAsync(shareName, snapshot, null, deleteSnapshots, context))
.map(response -> new SimpleResponse<>(response, null));
}
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredentials} is null
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime) {
- return this.generateAccountSAS(accountSASService, accountSASResourceType, accountSASPermission, expiryTime,
- null /* startTime */, null /* version */, null /* ipRange */, null /* sasProtocol */);
- }
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.file.FileServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol}
- *
- * For more information, see the
- * Azure Docs.
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @param startTime The {@code OffsetDateTime} start time for the account SAS
- * @param version The {@code String} version for the account SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredentials} is null
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime,
- String version, IpRange ipRange, SASProtocol sasProtocol) {
-
- SharedKeyCredential sharedKeyCredential = Utility.getSharedKeyCredential(this.azureFileStorageClient
- .getHttpPipeline());
- Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);
-
- return AccountSASSignatureValues.generateAccountSAS(sharedKeyCredential, accountSASService,
- accountSASResourceType, accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol);
- }
}
diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClient.java
index f53293b6aa99..0f0e2448b640 100644
--- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClient.java
+++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceClient.java
@@ -8,11 +8,6 @@
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.models.CorsRule;
@@ -23,7 +18,6 @@
import reactor.core.publisher.Mono;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.util.Map;
/**
@@ -364,46 +358,4 @@ public Response deleteShareWithResponse(String shareName, String snapshot,
Mono> response = fileServiceAsyncClient.deleteShareWithResponse(shareName, snapshot, context);
return Utility.blockWithOptionalTimeout(response, timeout);
}
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @return A string that represents the SAS token
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime) {
- return this.fileServiceAsyncClient
- .generateAccountSAS(accountSASService, accountSASResourceType, accountSASPermission, expiryTime);
- }
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.file.FileServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol}
- *
- * For more information, see the
- * Azure Docs.
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @param startTime The {@code OffsetDateTime} start time for the account SAS
- * @param version The {@code String} version for the account SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @return A string that represents the SAS token
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime,
- String version, IpRange ipRange, SASProtocol sasProtocol) {
- return this.fileServiceAsyncClient.generateAccountSAS(accountSASService, accountSASResourceType,
- accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol);
- }
}
diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasSignatureValues.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasSignatureValues.java
index e3aa5bee1f36..4ff46fcff2ac 100644
--- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasSignatureValues.java
+++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/FileServiceSasSignatureValues.java
@@ -28,7 +28,7 @@
* here
* for additional samples.
*/
-final class FileServiceSasSignatureValues {
+public final class FileServiceSasSignatureValues {
private String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java
index 3346b33356f9..e07cb6e6749d 100644
--- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java
+++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java
@@ -14,10 +14,6 @@
import com.azure.core.implementation.util.FluxUtil;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
-import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.implementation.AzureFileStorageImpl;
import com.azure.storage.file.implementation.models.ShareCreateSnapshotHeaders;
@@ -880,100 +876,6 @@ public String getSnapshotId() {
return this.snapshot;
}
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param permissions The {@code ShareSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredentials} is null
- */
- public String generateSAS(ShareSasPermission permissions, OffsetDateTime expiryTime) {
- return this.generateSAS(null, permissions, expiryTime, null /* startTime */, /* identifier */ null /*
- version */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /* contentLanguage*/,
- null /* contentEncoding */, null /* contentLanguage */, null /* contentType */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredentials} is null
- */
- public String generateSAS(String identifier) {
- return this.generateSAS(identifier, null /* permissions */, null /* expiryTime */, null /* startTime */,
- null /* version */, null /* sasProtocol */, null /* ipRange */, null /* cacheControl */, null /*
- contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */, null /* contentType */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @param permissions The {@code ShareSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredentials} is null
- */
- public String generateSAS(String identifier, ShareSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) {
- return this.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange, null
- /* cacheControl */, null /* contentLanguage*/, null /* contentEncoding */, null /* contentLanguage */,
- null /* contentType */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.file.shareAsyncClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure Docs.
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @param permissions The {@code ShareSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredentials} is null
- */
- public String generateSAS(String identifier, ShareSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl,
- String contentDisposition, String contentEncoding, String contentLanguage, String contentType) {
-
- FileServiceSasSignatureValues fileServiceSASSignatureValues = new FileServiceSasSignatureValues(version,
- sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange,
- identifier, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
-
- SharedKeyCredential sharedKeyCredential =
- Utility.getSharedKeyCredential(this.azureFileStorageClient.getHttpPipeline());
-
- Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);
-
- FileServiceSasSignatureValues values = configureServiceSASSignatureValues(fileServiceSASSignatureValues,
- sharedKeyCredential.getAccountName());
-
- FileServiceSasQueryParameters fileServiceSasQueryParameters =
- values.generateSASQueryParameters(sharedKeyCredential);
-
- return fileServiceSasQueryParameters.encode();
- }
-
/**
* Get share name from share client.
*
@@ -987,21 +889,6 @@ public String getShareName() {
return shareName;
}
- /**
- * Sets fileServiceSASSignatureValues parameters dependent on the current file type
- */
- FileServiceSasSignatureValues configureServiceSASSignatureValues(
- FileServiceSasSignatureValues fileServiceSASSignatureValues, String accountName) {
-
- // Set canonical name
- fileServiceSASSignatureValues.setCanonicalName(this.shareName, accountName);
-
- // Set resource
- fileServiceSASSignatureValues.setResource(Constants.UrlConstants.SAS_SHARE_CONSTANT);
-
- return fileServiceSASSignatureValues;
- }
-
private Response mapToShareInfoResponse(Response> response) {
String eTag = response.getHeaders().getValue("ETag");
OffsetDateTime lastModified =
diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClient.java
index 09705a2b319c..c1ce43c3600d 100644
--- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClient.java
+++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareClient.java
@@ -8,8 +8,6 @@
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.models.FileHTTPHeaders;
@@ -22,7 +20,6 @@
import reactor.core.publisher.Mono;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
@@ -783,75 +780,6 @@ public String getSnapshotId() {
return client.getSnapshotId();
}
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param permissions The {@code ShareSasPermission} permission for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(OffsetDateTime expiryTime, ShareSasPermission permissions) {
- return this.client.generateSAS(permissions, expiryTime);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier) {
- return this.client.generateSAS(identifier);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @param permissions The {@code ShareSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, ShareSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) {
- return this.client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.file.ShareClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String}
- *
- * For more information, see the
- * Azure Docs.
- *
- * @param identifier The {@code String} name of the access policy on the share this SAS references if any
- * @param permissions The {@code ShareSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param cacheControl An optional {@code String} cache-control header for the SAS.
- * @param contentDisposition An optional {@code String} content-disposition header for the SAS.
- * @param contentEncoding An optional {@code String} content-encoding header for the SAS.
- * @param contentLanguage An optional {@code String} content-language header for the SAS.
- * @param contentType An optional {@code String} content-type header for the SAS.
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, ShareSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange, String cacheControl,
- String contentDisposition, String contentEncoding, String contentLanguage, String contentType) {
- return this.client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol,
- ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- }
-
/**
* Get share name from share client.
*
diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java
index 7b6ca74aad84..caf32d80748a 100644
--- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java
+++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileAsyncJavaDocCodeSamples.java
@@ -2,9 +2,6 @@
// Licensed under the MIT License.
package com.azure.storage.file;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.models.FileHTTPHeaders;
import com.azure.storage.file.models.FileProperties;
@@ -641,36 +638,6 @@ public void forceCloseHandlesAsync() {
// END: com.azure.storage.file.fileAsyncClient.forceCloseHandles#string
}
- /**
- * Generates a code sample for using {@link FileAsyncClient#generateSAS(String, FileSasPermission, OffsetDateTime,
- * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateSASAsync() {
- FileAsyncClient fileAsyncClient = createAsyncClientWithSASToken();
- // BEGIN: com.azure.storage.file.fileAsyncClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- String identifier = "identifier";
- FileSasPermission permissions = new FileSasPermission()
- .setReadPermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setWritePermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
- String sas = fileAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol,
- ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- // END: com.azure.storage.file.fileAsyncClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
/**
* Generates a code sample for using {@link FileAsyncClient#getShareSnapshotId()}
*/
diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java
index 2abd06a843d5..767c6836d4cd 100644
--- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java
+++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileJavaDocCodeSamples.java
@@ -4,9 +4,6 @@
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.models.FileCopyInfo;
import com.azure.storage.file.models.FileDownloadInfo;
@@ -595,36 +592,6 @@ public void forceCloseHandles() {
// END: com.azure.storage.file.fileClient.forceCloseHandles#string-duration-context
}
- /**
- * Generates a code sample for using {@link FileClient#generateSAS(String, FileSasPermission, OffsetDateTime,
- * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateSAS() {
- FileClient fileClient = createClientWithSASToken();
- // BEGIN: com.azure.storage.file.FileClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- String identifier = "identifier";
- FileSasPermission permissions = new FileSasPermission()
- .setReadPermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setWritePermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
- String sas = fileClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol,
- ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- // END: com.azure.storage.file.FileClient.generateSAS#String-FileSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
/**
* Generates a code sample for using {@link FileClient#getShareSnapshotId()}
*/
diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceAsyncJavaDocCodeSamples.java
index b03788231226..d6f511c97ace 100644
--- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceAsyncJavaDocCodeSamples.java
+++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceAsyncJavaDocCodeSamples.java
@@ -2,12 +2,6 @@
// Licensed under the MIT License.
package com.azure.storage.file;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.models.FileServiceProperties;
import com.azure.storage.file.models.ListSharesOptions;
@@ -266,42 +260,4 @@ public void clearPropertiesAsync() {
});
// END: com.azure.storage.file.fileServiceAsyncClient.setPropertiesWithResponse#fileServiceProperties.clearCORS
}
-
- /**
- * Generates a code sample for using {@link FileServiceAsyncClient#generateAccountSAS(AccountSASService,
- * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)}
- */
- public void generateAccountSASAsync() {
- FileServiceAsyncClient fileServiceAsyncClient = createAsyncClientWithSASToken();
- // BEGIN: com.azure.storage.file.FileServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- AccountSASService service = new AccountSASService()
- .setBlob(true)
- .setFile(true)
- .setQueue(true)
- .setTable(true);
- AccountSASResourceType resourceType = new AccountSASResourceType()
- .setContainer(true)
- .setObject(true)
- .setService(true);
- AccountSASPermission permission = new AccountSASPermission()
- .setReadPermission(true)
- .setAddPermission(true)
- .setCreatePermission(true)
- .setWritePermission(true)
- .setDeletePermission(true)
- .setListPermission(true)
- .setProcessMessages(true)
- .setUpdatePermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- String sas = fileServiceAsyncClient.generateAccountSAS(service, resourceType, permission, expiryTime, startTime,
- version, ipRange, sasProtocol);
- // END: com.azure.storage.file.FileServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- }
}
diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceJavaDocCodeSamples.java
index 72294a00ae7b..77f5aa0dbd59 100644
--- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceJavaDocCodeSamples.java
+++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/FileServiceJavaDocCodeSamples.java
@@ -4,12 +4,6 @@
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.models.FileServiceProperties;
import com.azure.storage.file.models.ListSharesOptions;
@@ -257,44 +251,4 @@ public void clearProperties() {
System.out.printf("Setting File service properties completed with status code %d", response.getStatusCode());
// END: com.azure.storage.file.fileServiceClient.setPropertiesWithResponse#fileServiceProperties-Context.clearCORS
}
-
- /**
- * Generates a code sample for using {@link FileServiceClient#generateAccountSAS(AccountSASService,
- * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)}
- */
- public void generateAccountSAS() {
- FileServiceClient fileServiceClient = createClientWithSASToken();
- // BEGIN: com.azure.storage.file.FileServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- AccountSASService service = new AccountSASService()
- .setBlob(true)
- .setFile(true)
- .setQueue(true)
- .setTable(true);
- AccountSASResourceType resourceType = new AccountSASResourceType()
- .setContainer(true)
- .setObject(true)
- .setService(true);
- AccountSASPermission permission = new AccountSASPermission()
- .setReadPermission(true)
- .setAddPermission(true)
- .setCreatePermission(true)
- .setWritePermission(true)
- .setDeletePermission(true)
- .setListPermission(true)
- .setProcessMessages(true)
- .setUpdatePermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- String sas = fileServiceClient.generateAccountSAS(service, resourceType, permission, expiryTime, startTime,
- version, ipRange, sasProtocol);
- // END: com.azure.storage.file.FileServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- }
-
-
}
diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareAsyncJavaDocCodeSamples.java
index 6b17608efeb2..d74a8b5bd6c4 100644
--- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareAsyncJavaDocCodeSamples.java
+++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareAsyncJavaDocCodeSamples.java
@@ -2,9 +2,6 @@
// Licensed under the MIT License.
package com.azure.storage.file;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.models.AccessPolicy;
import com.azure.storage.file.models.FileHTTPHeaders;
@@ -520,37 +517,6 @@ public void getSnapshotIdAsync() {
// END: com.azure.storage.file.shareAsyncClient.getSnapshotId
}
- /**
- * Generates a code sample for using {@link ShareAsyncClient#generateSAS(String, ShareSasPermission, OffsetDateTime,
- * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateSASAsync() {
- ShareAsyncClient shareAsyncClient = createAsyncClientWithSASToken();
- // BEGIN: com.azure.storage.file.shareAsyncClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- String identifier = "identifier";
- ShareSasPermission permissions = new ShareSasPermission()
- .setReadPermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setWritePermission(true)
- .setListPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
- String sas = shareAsyncClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol,
- ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- // END: com.azure.storage.file.shareAsyncClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
/**
* Generates a code sample for using {@link ShareAsyncClient#getShareName()}
*/
diff --git a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareJavaDocCodeSamples.java b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareJavaDocCodeSamples.java
index 7b5a659e235a..813b5591e541 100644
--- a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareJavaDocCodeSamples.java
+++ b/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file/ShareJavaDocCodeSamples.java
@@ -4,9 +4,6 @@
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.file.models.AccessPolicy;
import com.azure.storage.file.models.FileHTTPHeaders;
@@ -510,37 +507,6 @@ public void getSnapshotId() {
// END: com.azure.storage.file.shareClient.getSnapshotId
}
- /**
- * Generates a code sample for using {@link ShareClient#generateSAS(String, ShareSasPermission, OffsetDateTime,
- * OffsetDateTime, String, SASProtocol, IpRange, String, String, String, String, String)}
- */
- public void generateSAS() {
- ShareClient shareClient = createClientWithSASToken();
- // BEGIN: com.azure.storage.file.ShareClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- String identifier = "identifier";
- ShareSasPermission permissions = new ShareSasPermission()
- .setReadPermission(true)
- .setCreatePermission(true)
- .setDeletePermission(true)
- .setWritePermission(true)
- .setListPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String cacheControl = "cache";
- String contentDisposition = "disposition";
- String contentEncoding = "encoding";
- String contentLanguage = "language";
- String contentType = "type";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
- String sas = shareClient.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol,
- ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType);
- // END: com.azure.storage.file.ShareClient.generateSAS#String-ShareSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange-String-String-String-String-String
- }
-
/**
* Generates a code sample for using {@link ShareClient#getShareName()}
*/
diff --git a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/APISpec.groovy b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/APISpec.groovy
index 1b8d9972f75b..9f7ef550b3aa 100644
--- a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/APISpec.groovy
+++ b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/APISpec.groovy
@@ -10,9 +10,8 @@ import com.azure.core.http.policy.HttpLogDetailLevel
import com.azure.core.test.InterceptorManager
import com.azure.core.test.TestMode
import com.azure.core.test.utils.TestResourceNamer
-import com.azure.core.util.Configuration;
+import com.azure.core.util.Configuration
import com.azure.core.util.logging.ClientLogger
-
import com.azure.storage.file.FileClientBuilder
import com.azure.storage.file.FileServiceAsyncClient
import com.azure.storage.file.FileServiceClient
@@ -41,7 +40,7 @@ class APISpec extends Specification {
// Test name for test method name.
def methodName
def testMode = getTestMode()
- def connectionString
+ String connectionString
// If debugging is enabled, recordings cannot run as there can only be one proxy at a time.
static boolean enableDebugging = false
diff --git a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy
index d32dcbbc78d6..5ab6d3ea6d95 100644
--- a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy
+++ b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAPITests.groovy
@@ -393,7 +393,14 @@ class FileAPITests extends APISpec {
def destinationOffset = 0
primaryFileClient.upload(ByteBuffer.wrap(data.getBytes()), data.length())
- def sasToken = primaryFileClient.generateSAS(getUTCNow().plusDays(1), new FileSasPermission().setReadPermission(true))
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sasToken = new FileServiceSasSignatureValues()
+ .setExpiryTime(getUTCNow().plusDays(1))
+ .setPermissions(new FileSasPermission().setReadPermission(true).toString())
+ .setCanonicalName(primaryFileClient.getShareName(), primaryFileClient.getFilePath(), credential.getAccountName())
+ .setResource(Constants.UrlConstants.SAS_FILE_CONSTANT)
+ .generateSASQueryParameters(credential)
+ .encode()
when:
FileClient client = fileBuilderHelper(interceptorManager, shareName, "destination")
diff --git a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy
index 4201c3e21914..896539f3858b 100644
--- a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy
+++ b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileAsyncAPITests.groovy
@@ -5,6 +5,7 @@ package com.azure.storage.file
import com.azure.core.exception.HttpResponseException
import com.azure.core.exception.UnexpectedLengthException
+import com.azure.storage.common.Constants
import com.azure.storage.common.credentials.SharedKeyCredential
import com.azure.storage.file.models.FileHTTPHeaders
import com.azure.storage.file.models.FileRange
@@ -385,7 +386,14 @@ class FileAsyncAPITests extends APISpec {
def destinationOffset = 0
primaryFileAsyncClient.upload(Flux.just(ByteBuffer.wrap(data.getBytes())), data.length()).block()
- def sasToken = primaryFileAsyncClient.generateSAS(new FileSasPermission().setReadPermission(true), getUTCNow().plusDays(1))
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sasToken = new FileServiceSasSignatureValues()
+ .setExpiryTime(getUTCNow().plusDays(1))
+ .setPermissions(new FileSasPermission().setReadPermission(true).toString())
+ .setCanonicalName(primaryFileAsyncClient.getShareName(), primaryFileAsyncClient.getFilePath(), credential.getAccountName())
+ .setResource(Constants.UrlConstants.SAS_FILE_CONSTANT)
+ .generateSASQueryParameters(credential)
+ .encode()
when:
FileAsyncClient client = fileBuilderHelper(interceptorManager, shareName, "destination")
diff --git a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileSASTests.groovy b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileSASTests.groovy
index e1237bf73d92..131c41664c06 100644
--- a/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileSASTests.groovy
+++ b/sdk/storage/azure-storage-file/src/test/java/com/azure/storage/file/FileSASTests.groovy
@@ -3,10 +3,11 @@ package com.azure.storage.file
import com.azure.storage.common.AccountSASPermission
import com.azure.storage.common.AccountSASResourceType
import com.azure.storage.common.AccountSASService
+import com.azure.storage.common.AccountSASSignatureValues
import com.azure.storage.common.Constants
import com.azure.storage.common.IpRange
import com.azure.storage.common.SASProtocol
-
+import com.azure.storage.common.credentials.SharedKeyCredential
import com.azure.storage.file.models.AccessPolicy
import com.azure.storage.file.models.SignedIdentifier
import com.azure.storage.file.models.StorageException
@@ -136,15 +137,17 @@ class FileSASTests extends APISpec {
def "serviceSASSignatureValues canonicalizedResource"() {
setup:
- def fileName = primaryFileClient.getFilePath()
+ def filePath = primaryFileClient.getFilePath()
def shareName = primaryFileClient.getShareName()
def accountName = "account"
when:
- def serviceSASSignatureValues = primaryFileClient.fileAsyncClient.configureServiceSASSignatureValues(new FileServiceSasSignatureValues(), accountName)
+ def serviceSASSignatureValues = new FileServiceSasSignatureValues()
+ .setCanonicalName(shareName, filePath, accountName)
+ .setResource(Constants.UrlConstants.SAS_FILE_CONSTANT)
then:
- serviceSASSignatureValues.getCanonicalName() == "/file/" + accountName + "/" + shareName + "/" + fileName
+ serviceSASSignatureValues.getCanonicalName() == "/file/" + accountName + "/" + shareName + "/" + filePath
}
def "FileSAS network test download upload"() {
@@ -171,7 +174,22 @@ class FileSASTests extends APISpec {
def contentType = "type"
when:
- def sas = primaryFileClient.generateSAS(null, permissions, expiryTime, startTime, null, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType)
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sas = new FileServiceSasSignatureValues()
+ .setPermissions(permissions.toString())
+ .setExpiryTime(expiryTime)
+ .setStartTime(startTime)
+ .setProtocol(sasProtocol)
+ .setIpRange(ipRange)
+ .setCacheControl(cacheControl)
+ .setContentDisposition(contentDisposition)
+ .setContentEncoding(contentEncoding)
+ .setContentLanguage(contentLanguage)
+ .setContentType(contentType)
+ .setCanonicalName(primaryFileClient.getShareName(), primaryFileClient.getFilePath(), credential.getAccountName())
+ .setResource(Constants.UrlConstants.SAS_FILE_CONSTANT)
+ .generateSASQueryParameters(credential)
+ .encode()
then:
sas != null
@@ -218,7 +236,22 @@ class FileSASTests extends APISpec {
def contentType = "type"
when:
- def sas = primaryFileClient.generateSAS(null, permissions, expiryTime, startTime, null, sasProtocol, ipRange, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType)
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sas = new FileServiceSasSignatureValues()
+ .setPermissions(permissions.toString())
+ .setExpiryTime(expiryTime)
+ .setStartTime(startTime)
+ .setProtocol(sasProtocol)
+ .setIpRange(ipRange)
+ .setCacheControl(cacheControl)
+ .setContentDisposition(contentDisposition)
+ .setContentEncoding(contentEncoding)
+ .setContentLanguage(contentLanguage)
+ .setContentType(contentType)
+ .setCanonicalName(primaryFileClient.getShareName(), primaryFileClient.getFilePath(), credential.getAccountName())
+ .setResource(Constants.UrlConstants.SAS_FILE_CONSTANT)
+ .generateSASQueryParameters(credential)
+ .encode()
def client = fileBuilderHelper(interceptorManager, shareName, filePath)
.endpoint(primaryFileClient.getFileUrl())
@@ -257,7 +290,13 @@ class FileSASTests extends APISpec {
OffsetDateTime expiryTime = getUTCNow().plusDays(1)
when:
- String sasWithId = primaryShareClient.generateSAS(identifier.getId())
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sasWithId = new FileServiceSasSignatureValues()
+ .setIdentifier(identifier.getId())
+ .setCanonicalName(primaryShareClient.getShareName(), credential.getAccountName())
+ .setResource(Constants.UrlConstants.SAS_SHARE_CONSTANT)
+ .generateSASQueryParameters(credential)
+ .encode()
ShareClient client1 = shareBuilderHelper(interceptorManager, primaryShareClient.getShareName())
.endpoint(primaryShareClient.getShareUrl())
@@ -267,7 +306,13 @@ class FileSASTests extends APISpec {
client1.createDirectory("dir")
client1.deleteDirectory("dir")
- String sasWithPermissions = primaryShareClient.generateSAS(expiryTime, permissions)
+ def sasWithPermissions = new FileServiceSasSignatureValues()
+ .setPermissions(permissions.toString())
+ .setExpiryTime(expiryTime)
+ .setCanonicalName(primaryShareClient.getShareName(), credential.getAccountName())
+ .setResource(Constants.UrlConstants.SAS_SHARE_CONSTANT)
+ .generateSASQueryParameters(credential)
+ .encode()
def client2 = shareBuilderHelper(interceptorManager, primaryShareClient.getShareName())
.endpoint(primaryFileClient.getFileUrl())
@@ -296,7 +341,8 @@ class FileSASTests extends APISpec {
def expiryTime = getUTCNow().plusDays(1)
when:
- def sas = primaryFileServiceClient.generateAccountSAS(service, resourceType, permissions, expiryTime, null, null, null, null)
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sas = AccountSASSignatureValues.generateAccountSAS(credential, service, resourceType, permissions, expiryTime, null, null, null, null)
then:
sas != null
diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java
index ae2a82a1799b..2dddbacc2b52 100644
--- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java
+++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueAsyncClient.java
@@ -11,8 +11,6 @@
import com.azure.core.implementation.http.PagedResponseBase;
import com.azure.core.implementation.util.FluxUtil;
import com.azure.core.util.Context;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.queue.implementation.AzureQueueStorageImpl;
@@ -31,7 +29,6 @@
import reactor.core.publisher.Mono;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.time.temporal.ChronoUnit;
import java.util.List;
import java.util.Map;
@@ -744,73 +741,6 @@ Mono> deleteMessageWithResponse(String messageId, String popRecei
.map(response -> new SimpleResponse<>(response, null));
}
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param permissions The {@code QueueSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredential} is null
- */
- public String generateSAS(QueueSasPermission permissions, OffsetDateTime expiryTime) {
- return this.generateSAS(null, permissions, expiryTime, null /* startTime */, /* identifier */ null /*
- version */, null /* sasProtocol */, null /* ipRange */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the queue this SAS references if any
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredential} is null
- */
- public String generateSAS(String identifier) {
- return this.generateSAS(identifier, null /* permissions */, null /* expiryTime */, null /* startTime */,
- null /* version */, null /* sasProtocol */, null /* ipRange */);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.queue.queueAsyncClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange}
- *
- * For more information, see the
- * Azure Docs.
- *
- * @param identifier The {@code String} name of the access policy on the queue this SAS references if any
- * @param permissions The {@code QueueSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredential} is null
- */
- public String generateSAS(String identifier, QueueSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) {
-
- QueueServiceSasSignatureValues queueServiceSASSignatureValues = new QueueServiceSasSignatureValues(version,
- sasProtocol, startTime, expiryTime, permissions == null ? null : permissions.toString(), ipRange,
- identifier);
-
- SharedKeyCredential sharedKeyCredential =
- Utility.getSharedKeyCredential(this.client.getHttpPipeline());
-
- Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);
-
- // Set canonical name
- QueueServiceSasSignatureValues values = queueServiceSASSignatureValues
- .setCanonicalName(this.queueName, sharedKeyCredential.getAccountName());
-
- QueueServiceSasQueryParameters queueServiceSasQueryParameters = values
- .generateSASQueryParameters(sharedKeyCredential);
-
- return queueServiceSasQueryParameters.encode();
- }
-
/**
* Get the queue name of the client.
*
diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java
index 3c6a2c1743ef..445ac4e52cc0 100644
--- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java
+++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueClient.java
@@ -6,8 +6,6 @@
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.queue.models.DequeuedMessage;
@@ -20,7 +18,6 @@
import reactor.core.publisher.Mono;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
@@ -655,52 +652,6 @@ public Response deleteMessageWithResponse(String messageId, String popRece
return Utility.blockWithOptionalTimeout(response, timeout);
}
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param permissions The {@code QueueSasPermission} permission for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(OffsetDateTime expiryTime, QueueSasPermission permissions) {
- return this.client.generateSAS(permissions, expiryTime);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * @param identifier The {@code String} name of the access policy on the queue this SAS references if any
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier) {
- return this.client.generateSAS(identifier);
- }
-
- /**
- * Generates a SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.queue.queueClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange}
- *
- * For more information, see the
- * Azure Docs.
- *
- * @param identifier The {@code String} name of the access policy on the queue this SAS references if any
- * @param permissions The {@code QueueSasPermission} permission for the SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the SAS
- * @param startTime An optional {@code OffsetDateTime} start time for the SAS
- * @param version An optional {@code String} version for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @return A string that represents the SAS token
- */
- public String generateSAS(String identifier, QueueSasPermission permissions, OffsetDateTime expiryTime,
- OffsetDateTime startTime, String version, SASProtocol sasProtocol, IpRange ipRange) {
- return this.client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol,
- ipRange);
- }
-
/**
* Get the queue name of the client.
*
diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java
index fa5e57fa2fe1..055ef8b15f6f 100644
--- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java
+++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceAsyncClient.java
@@ -11,17 +11,11 @@
import com.azure.core.implementation.util.FluxUtil;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.AccountSASSignatureValues;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.queue.implementation.AzureQueueStorageImpl;
-import com.azure.storage.queue.models.CorsRule;
import com.azure.storage.queue.implementation.models.ListQueuesIncludeType;
+import com.azure.storage.queue.models.CorsRule;
import com.azure.storage.queue.models.QueueItem;
import com.azure.storage.queue.models.QueuesSegmentOptions;
import com.azure.storage.queue.models.StorageException;
@@ -30,7 +24,6 @@
import reactor.core.publisher.Mono;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -423,53 +416,4 @@ Mono> getStatisticsWithResponse(Context context) {
return postProcessResponse(client.services().getStatisticsWithRestResponseAsync(context))
.map(response -> new SimpleResponse<>(response, response.getValue()));
}
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredential} is null
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime) {
- return this.generateAccountSAS(accountSASService, accountSASResourceType, accountSASPermission, expiryTime,
- null /* startTime */, null /* version */, null /* ipRange */, null /* sasProtocol */);
- }
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.queue.queueServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol}
- *
- * For more information, see the
- * Azure Docs.
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @param startTime The {@code OffsetDateTime} start time for the account SAS
- * @param version The {@code String} version for the account SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @return A string that represents the SAS token
- * @throws NullPointerException If {@code sharedKeyCredential} is null
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime,
- String version, IpRange ipRange, SASProtocol sasProtocol) {
-
- SharedKeyCredential sharedKeyCredential = Utility.getSharedKeyCredential(this.client.getHttpPipeline());
- Utility.assertNotNull("sharedKeyCredential", sharedKeyCredential);
-
- return AccountSASSignatureValues.generateAccountSAS(sharedKeyCredential, accountSASService,
- accountSASResourceType, accountSASPermission, expiryTime, startTime, version, ipRange, sasProtocol);
-
- }
}
diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java
index 126e685eae17..d0ea25c75901 100644
--- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java
+++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceClient.java
@@ -7,11 +7,6 @@
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.Utility;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.queue.models.CorsRule;
@@ -23,7 +18,6 @@
import reactor.core.publisher.Mono;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.util.Map;
/**
@@ -389,47 +383,4 @@ public Response getStatisticsWithResponse(Duration timeout,
Mono> response = client.getStatisticsWithResponse(context);
return Utility.blockWithOptionalTimeout(response, timeout);
}
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @return A string that represents the SAS token
- */
- public String generateAccountSAS(AccountSASService accountSASService,
- AccountSASResourceType accountSASResourceType, AccountSASPermission accountSASPermission,
- OffsetDateTime expiryTime) {
- return this.client.generateAccountSAS(accountSASService, accountSASResourceType, accountSASPermission,
- expiryTime);
- }
-
- /**
- * Generates an account SAS token with the specified parameters
- *
- * Code Samples
- *
- * {@codesnippet com.azure.storage.queue.queueServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol}
- *
- * For more information, see the
- * Azure Docs.
- *
- * @param accountSASService The {@code AccountSASService} services for the account SAS
- * @param accountSASResourceType An optional {@code AccountSASResourceType} resources for the account SAS
- * @param accountSASPermission The {@code AccountSASPermission} permission for the account SAS
- * @param expiryTime The {@code OffsetDateTime} expiry time for the account SAS
- * @param startTime The {@code OffsetDateTime} start time for the account SAS
- * @param version The {@code String} version for the account SAS
- * @param ipRange An optional {@code IpRange} ip address range for the SAS
- * @param sasProtocol An optional {@code SASProtocol} protocol for the SAS
- * @return A string that represents the SAS token
- */
- public String generateAccountSAS(AccountSASService accountSASService, AccountSASResourceType accountSASResourceType,
- AccountSASPermission accountSASPermission, OffsetDateTime expiryTime, OffsetDateTime startTime,
- String version, IpRange ipRange, SASProtocol sasProtocol) {
- return this.client.generateAccountSAS(accountSASService, accountSASResourceType, accountSASPermission,
- expiryTime, startTime, version, ipRange, sasProtocol);
- }
}
diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasSignatureValues.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasSignatureValues.java
index b4e93307c9b2..9d6d16a4a3c8 100644
--- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasSignatureValues.java
+++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceSasSignatureValues.java
@@ -28,7 +28,7 @@
* here
* for additional samples.
*/
-final class QueueServiceSasSignatureValues {
+public final class QueueServiceSasSignatureValues {
private String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
diff --git a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueAsyncJavaDocCodeSamples.java
index f3aae43bd054..cf6b3e4479e0 100644
--- a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueAsyncJavaDocCodeSamples.java
+++ b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueAsyncJavaDocCodeSamples.java
@@ -2,9 +2,6 @@
// Licensed under the MIT License.
package com.azure.storage.queue;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.queue.models.AccessPolicy;
import com.azure.storage.queue.models.QueueProperties;
@@ -483,31 +480,6 @@ public void clearMessagesAsync() {
// END: com.azure.storage.queue.queueAsyncClient.clearMessages
}
- /**
- * Code snippet for {@link QueueAsyncClient#generateSAS(String, QueueSasPermission, OffsetDateTime, OffsetDateTime,
- * String, SASProtocol, IpRange)}
- */
- public void generateSASCodeSnippets() {
- // BEGIN: com.azure.storage.queue.queueAsyncClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange
- QueueSasPermission permissions = new QueueSasPermission()
- .setReadPermission(true)
- .setAddPermission(true)
- .setUpdatePermission(true)
- .setProcessPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String identifier = "";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- // Note either "identifier", or "expiryTime and permissions" are required to be set
- String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange);
- // END: com.azure.storage.queue.queueAsyncClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange
- }
-
/**
* Generates a code sample for using {@link QueueAsyncClient#getQueueName()}
*/
diff --git a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueJavaDocCodeSamples.java b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueJavaDocCodeSamples.java
index bb32debcb231..f69c08be8d64 100644
--- a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueJavaDocCodeSamples.java
+++ b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueJavaDocCodeSamples.java
@@ -4,9 +4,6 @@
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.queue.models.AccessPolicy;
import com.azure.storage.queue.models.DequeuedMessage;
@@ -442,31 +439,6 @@ public void clearMessagesWithResponse() {
// END: com.azure.storage.queue.queueClient.clearMessagesWithResponse#duration-context
}
- /**
- * Code snippet for {@link QueueClient#generateSAS(String, QueueSasPermission, OffsetDateTime, OffsetDateTime,
- * String, SASProtocol, IpRange)}
- */
- public void generateSASCodeSnippets() {
- // BEGIN: com.azure.storage.queue.queueClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange
- QueueSasPermission permissions = new QueueSasPermission()
- .setReadPermission(true)
- .setAddPermission(true)
- .setUpdatePermission(true)
- .setProcessPermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String identifier = "";
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- // Note either "identifier", or "expiryTime and permissions" are required to be set
- String sas = client.generateSAS(identifier, permissions, expiryTime, startTime, version, sasProtocol, ipRange);
- // END: com.azure.storage.queue.queueClient.generateSAS#String-QueueSasPermission-OffsetDateTime-OffsetDateTime-String-SASProtocol-IpRange
- }
-
/**
* Generates a code sample for using {@link QueueClient#getQueueName()}
*/
diff --git a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceAsyncJavaDocCodeSamples.java
index b6bbb02aebbc..36998f48e588 100644
--- a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceAsyncJavaDocCodeSamples.java
+++ b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceAsyncJavaDocCodeSamples.java
@@ -2,18 +2,11 @@
// Licensed under the MIT License.
package com.azure.storage.queue;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.queue.models.QueuesSegmentOptions;
import com.azure.storage.queue.models.StorageServiceProperties;
import com.azure.storage.queue.models.StorageServiceStats;
-import java.time.OffsetDateTime;
import java.util.Collections;
import java.util.Map;
@@ -267,41 +260,4 @@ public void getStatisticsWithResponse() {
});
// END: com.azure.storage.queue.queueServiceAsyncClient.getStatisticsWithResponse
}
-
- /**
- * Generates a code sample for using {@link QueueServiceAsyncClient#generateAccountSAS(AccountSASService,
- * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)}
- */
- public void generateAccountSAS() {
- // BEGIN: com.azure.storage.queue.queueServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- AccountSASService service = new AccountSASService()
- .setBlob(true)
- .setFile(true)
- .setQueue(true)
- .setTable(true);
- AccountSASResourceType resourceType = new AccountSASResourceType()
- .setContainer(true)
- .setObject(true)
- .setService(true);
- AccountSASPermission permission = new AccountSASPermission()
- .setReadPermission(true)
- .setAddPermission(true)
- .setCreatePermission(true)
- .setWritePermission(true)
- .setDeletePermission(true)
- .setListPermission(true)
- .setProcessMessages(true)
- .setUpdatePermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- String sas = client.generateAccountSAS(service, resourceType, permission, expiryTime, startTime, version,
- ipRange, sasProtocol);
- // END: com.azure.storage.queue.queueServiceAsyncClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- }
}
diff --git a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceJavaDocCodeSamples.java b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceJavaDocCodeSamples.java
index b9a7838fd4a9..2a91874c6bd9 100644
--- a/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceJavaDocCodeSamples.java
+++ b/sdk/storage/azure-storage-queue/src/samples/java/com/azure/storage/queue/QueueServiceJavaDocCodeSamples.java
@@ -4,19 +4,12 @@
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
-import com.azure.storage.common.AccountSASPermission;
-import com.azure.storage.common.AccountSASResourceType;
-import com.azure.storage.common.AccountSASService;
-import com.azure.storage.common.Constants;
-import com.azure.storage.common.IpRange;
-import com.azure.storage.common.SASProtocol;
import com.azure.storage.common.credentials.SharedKeyCredential;
import com.azure.storage.queue.models.QueuesSegmentOptions;
import com.azure.storage.queue.models.StorageServiceProperties;
import com.azure.storage.queue.models.StorageServiceStats;
import java.time.Duration;
-import java.time.OffsetDateTime;
import java.util.Collections;
import java.util.Map;
@@ -257,41 +250,4 @@ public void getStatisticsWithResponse() {
stats.getGeoReplication().getStatus(), stats.getGeoReplication().getLastSyncTime());
// END: com.azure.storage.queue.queueServiceClient.getStatisticsWithResponse#duration-context
}
-
- /**
- * Generates a code sample for using {@link QueueServiceClient#generateAccountSAS(AccountSASService,
- * AccountSASResourceType, AccountSASPermission, OffsetDateTime, OffsetDateTime, String, IpRange, SASProtocol)}
- */
- public void generateAccountSAS() {
- // BEGIN: com.azure.storage.queue.queueServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- AccountSASService service = new AccountSASService()
- .setBlob(true)
- .setFile(true)
- .setQueue(true)
- .setTable(true);
- AccountSASResourceType resourceType = new AccountSASResourceType()
- .setContainer(true)
- .setObject(true)
- .setService(true);
- AccountSASPermission permission = new AccountSASPermission()
- .setReadPermission(true)
- .setAddPermission(true)
- .setCreatePermission(true)
- .setWritePermission(true)
- .setDeletePermission(true)
- .setListPermission(true)
- .setProcessMessages(true)
- .setUpdatePermission(true);
- OffsetDateTime startTime = OffsetDateTime.now().minusDays(1);
- OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
- IpRange ipRange = new IpRange()
- .setIpMin("0.0.0.0")
- .setIpMax("255.255.255.255");
- SASProtocol sasProtocol = SASProtocol.HTTPS_HTTP;
- String version = Constants.HeaderConstants.TARGET_STORAGE_VERSION;
-
- String sas = client.generateAccountSAS(service, resourceType, permission, expiryTime, startTime, version,
- ipRange, sasProtocol);
- // END: com.azure.storage.queue.queueServiceClient.generateAccountSAS#AccountSASService-AccountSASResourceType-AccountSASPermission-OffsetDateTime-OffsetDateTime-String-IpRange-SASProtocol
- }
}
diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/APISpec.groovy b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/APISpec.groovy
index d5dbd5bf8502..9e66ea59896c 100644
--- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/APISpec.groovy
+++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/APISpec.groovy
@@ -4,25 +4,23 @@
package com.azure.storage.queue
import com.azure.core.http.HttpClient
-import com.azure.core.http.ProxyOptions
import com.azure.core.test.InterceptorManager
import com.azure.core.test.TestMode
import com.azure.core.test.utils.TestResourceNamer
-import com.azure.core.util.Context
import com.azure.core.util.Configuration
+import com.azure.core.util.Context
import com.azure.core.util.logging.ClientLogger
import com.azure.storage.queue.models.QueuesSegmentOptions
import spock.lang.Specification
import java.time.Duration
import java.time.OffsetDateTime
-import java.util.function.Supplier
class APISpec extends Specification {
// Field common used for all APIs.
def logger = new ClientLogger(APISpec.class)
def AZURE_TEST_MODE = "AZURE_TEST_MODE"
- def interceptorManager
+ InterceptorManager interceptorManager
TestResourceNamer testResourceName
// Clients for API tests
@@ -31,9 +29,9 @@ class APISpec extends Specification {
// Test name for test method name.
- def methodName
+ String methodName
def testMode = getTestMode()
- def connectionString
+ String connectionString
// If debugging is enabled, recordings cannot run as there can only be one proxy at a time.
static boolean enableDebugging = false
@@ -141,15 +139,6 @@ class APISpec extends Specification {
}
static HttpClient getHttpClient() {
- if (enableDebugging) {
- return HttpClient.createDefault().setProxy(new Supplier() {
- @Override
- ProxyOptions get() {
- return new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("localhost", 8888))
- }
- })
- } else {
- return HttpClient.createDefault()
- }
+ return HttpClient.createDefault()
}
}
diff --git a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueSASTests.groovy b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueSASTests.groovy
index b5b82d6d3f73..3a63224a208a 100644
--- a/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueSASTests.groovy
+++ b/sdk/storage/azure-storage-queue/src/test/java/com/azure/storage/queue/QueueSASTests.groovy
@@ -3,9 +3,10 @@ package com.azure.storage.queue
import com.azure.storage.common.AccountSASPermission
import com.azure.storage.common.AccountSASResourceType
import com.azure.storage.common.AccountSASService
+import com.azure.storage.common.AccountSASSignatureValues
import com.azure.storage.common.IpRange
import com.azure.storage.common.SASProtocol
-
+import com.azure.storage.common.credentials.SharedKeyCredential
import com.azure.storage.queue.models.AccessPolicy
import com.azure.storage.queue.models.EnqueuedMessage
import com.azure.storage.queue.models.SignedIdentifier
@@ -80,7 +81,7 @@ class QueueSASTests extends APISpec {
def "queueServiceSASSignatureValues canonicalizedResource"() {
setup:
- def queueName = queueClient.client.queueName
+ def queueName = queueClient.getQueueName()
def accountName = "account"
when:
@@ -108,7 +109,16 @@ class QueueSASTests extends APISpec {
def sasProtocol = SASProtocol.HTTPS_HTTP
when:
- def sasPermissions = queueClient.generateSAS(null, permissions, expiryTime, startTime, null, sasProtocol, ipRange)
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sasPermissions = new QueueServiceSasSignatureValues()
+ .setPermissions(permissions.toString())
+ .setExpiryTime(expiryTime)
+ .setStartTime(startTime)
+ .setProtocol(sasProtocol)
+ .setIpRange(ipRange)
+ .setCanonicalName(queueClient.getQueueName(), credential.getAccountName())
+ .generateSASQueryParameters(credential)
+ .encode()
def clientPermissions = queueBuilderHelper(interceptorManager)
.endpoint(queueClient.getQueueUrl())
@@ -149,7 +159,16 @@ class QueueSASTests extends APISpec {
def sasProtocol = SASProtocol.HTTPS_HTTP
when:
- def sasPermissions = queueClient.generateSAS(null, permissions, expiryTime, startTime, null, sasProtocol, ipRange)
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sasPermissions = new QueueServiceSasSignatureValues()
+ .setPermissions(permissions.toString())
+ .setExpiryTime(expiryTime)
+ .setStartTime(startTime)
+ .setProtocol(sasProtocol)
+ .setIpRange(ipRange)
+ .setCanonicalName(queueClient.getQueueName(), credential.getAccountName())
+ .generateSASQueryParameters(credential)
+ .encode()
def clientPermissions = queueBuilderHelper(interceptorManager)
.endpoint(queueClient.getQueueUrl())
@@ -192,7 +211,12 @@ class QueueSASTests extends APISpec {
queueClient.setAccessPolicy(Arrays.asList(identifier))
when:
- def sasIdentifier = queueClient.generateSAS(identifier.getId())
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sasIdentifier = new QueueServiceSasSignatureValues()
+ .setIdentifier(identifier.getId())
+ .setCanonicalName(queueClient.getQueueName(), credential.getAccountName())
+ .generateSASQueryParameters(credential)
+ .encode()
def clientBuilder = queueBuilderHelper(interceptorManager)
def clientIdentifier = clientBuilder
@@ -224,7 +248,8 @@ class QueueSASTests extends APISpec {
def expiryTime = getUTCNow().plusDays(1)
when:
- def sas = primaryQueueServiceClient.generateAccountSAS(service, resourceType, permissions, expiryTime, null, null, null, null)
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sas = AccountSASSignatureValues.generateAccountSAS(credential, service, resourceType, permissions, expiryTime, null, null, null, null)
def scBuilder = queueServiceBuilderHelper(interceptorManager)
scBuilder.endpoint(primaryQueueServiceClient.getQueueServiceUrl())
@@ -255,7 +280,8 @@ class QueueSASTests extends APISpec {
def expiryTime = getUTCNow().plusDays(1)
when:
- def sas = primaryQueueServiceClient.generateAccountSAS(service, resourceType, permissions, expiryTime, null, null, null, null)
+ def credential = SharedKeyCredential.fromConnectionString(connectionString)
+ def sas = AccountSASSignatureValues.generateAccountSAS(credential, service, resourceType, permissions, expiryTime, null, null, null, null)
def scBuilder = queueServiceBuilderHelper(interceptorManager)
scBuilder.endpoint(primaryQueueServiceClient.getQueueServiceUrl())