@azure/storage-blob 12.25.1-alpha.20241014.1 → 12.26.0-alpha.20241015.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -944,6 +944,39 @@ export class BlobClient extends StorageClient {
944
944
  }
945
945
  return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign;
946
946
  }
947
+ /**
948
+ *
949
+ * Generates a Blob Service Shared Access Signature (SAS) URI based on
950
+ * the client properties and parameters passed in. The SAS is signed by the input user delegation key.
951
+ *
952
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
953
+ *
954
+ * @param options - Optional parameters.
955
+ * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
956
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
957
+ */
958
+ generateUserDelegationSasUrl(options, userDelegationKey) {
959
+ return new Promise((resolve) => {
960
+ const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), userDelegationKey, this.accountName).toString();
961
+ resolve(appendToURLQuery(this.url, sas));
962
+ });
963
+ }
964
+ /**
965
+ * Only available for BlobClient constructed with a shared key credential.
966
+ *
967
+ * Generates string to sign for a Blob Service Shared Access Signature (SAS) URI based on
968
+ * the client properties and parameters passed in. The SAS is signed by the input user delegation key.
969
+ *
970
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
971
+ *
972
+ * @param options - Optional parameters.
973
+ * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
974
+ * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
975
+ */
976
+ /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
977
+ generateUserDelegationSasStringToSign(options, userDelegationKey) {
978
+ return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), userDelegationKey, this.accountName).stringToSign;
979
+ }
947
980
  /**
948
981
  * Delete the immutablility policy on the blob.
949
982
  *