diff --git a/sdk/storage/azure-storage-file/azure/storage/file/file_client.py b/sdk/storage/azure-storage-file/azure/storage/file/file_client.py index f1c6c422e621..9af4d7a859e5 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/file_client.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/file_client.py @@ -328,6 +328,8 @@ def generate_shared_access_signature( :keyword str content_type: Response header value for Content-Type when resource is accessed using this shared access signature. + :keyword str protocol: + Specifies the protocol permitted for a request made. The default value is https. :return: A Shared Access Signature (sas) token. :rtype: str """ @@ -337,6 +339,7 @@ def generate_shared_access_signature( content_encoding = kwargs.pop('content_encoding', None) content_language = kwargs.pop('content_language', None) content_type = kwargs.pop('content_type', None) + if not hasattr(self.credential, 'account_key') or not self.credential.account_key: raise ValueError("No account SAS key available.") sas = FileSharedAccessSignature(self.credential.account_name, self.credential.account_key) diff --git a/sdk/storage/azure-storage-file/azure/storage/file/file_service_client.py b/sdk/storage/azure-storage-file/azure/storage/file/file_service_client.py index cb7f623fe9a3..e349527fa0f4 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/file_service_client.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/file_service_client.py @@ -143,7 +143,7 @@ def generate_shared_access_signature( expiry, # type: Optional[Union[datetime, str]] start=None, # type: Optional[Union[datetime, str]] ip=None, # type: Optional[str] - protocol=None # type: Optional[str] + **kwargs # type: Any ): # type: (...) -> str """Generates a shared access signature for the file service. @@ -179,7 +179,7 @@ def generate_shared_access_signature( or address range specified on the SAS token, the request is not authenticated. For example, specifying sip=168.1.5.65 or sip=168.1.5.60-168.1.5.70 on the SAS restricts the request to those IP addresses. - :param str protocol: + :keyword str protocol: Specifies the protocol permitted for a request made. The default value is https. :return: A Shared Access Signature (sas) token. :rtype: str @@ -193,6 +193,7 @@ def generate_shared_access_signature( :dedent: 8 :caption: Generate a sas token. """ + protocol = kwargs.pop('protocol', None) if not hasattr(self.credential, 'account_key') and not self.credential.account_key: raise ValueError("No account SAS key available.") diff --git a/sdk/storage/azure-storage-file/azure/storage/file/share_client.py b/sdk/storage/azure-storage-file/azure/storage/file/share_client.py index fbaedb3e7f04..29618ef0cf7a 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/share_client.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/share_client.py @@ -258,6 +258,8 @@ def generate_shared_access_signature( :keyword str content_type: Response header value for Content-Type when resource is accessed using this shared access signature. + :keyword str protocol: + Specifies the protocol permitted for a request made. The default value is https. :return: A Shared Access Signature (sas) token. :rtype: str """ diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/queue_client.py b/sdk/storage/azure-storage-queue/azure/storage/queue/queue_client.py index baacaa7066ba..ea8411414352 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/queue_client.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/queue_client.py @@ -192,7 +192,7 @@ def generate_shared_access_signature( start=None, # type: Optional[Union[datetime, str]] policy_id=None, # type: Optional[str] ip=None, # type: Optional[str] - protocol=None # type: Optional[str] + **kwargs # type: Any ): # type: (...) -> str """Generates a shared access signature for the queue. @@ -228,9 +228,8 @@ def generate_shared_access_signature( or address range specified on the SAS token, the request is not authenticated. For example, specifying sip='168.1.5.65' or sip='168.1.5.60-168.1.5.70' on the SAS restricts the request to those IP addresses. - :param str protocol: - Specifies the protocol permitted for a request made. The default value - is https,http. + :keyword str protocol: + Specifies the protocol permitted for a request made. The default value is https. :return: A Shared Access Signature (sas) token. :rtype: str @@ -243,6 +242,7 @@ def generate_shared_access_signature( :dedent: 12 :caption: Generate a sas token. """ + protocol = kwargs.pop('protocol', None) if not hasattr(self.credential, 'account_key') and not self.credential.account_key: raise ValueError("No account SAS key available.") sas = QueueSharedAccessSignature( diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/queue_service_client.py b/sdk/storage/azure-storage-queue/azure/storage/queue/queue_service_client.py index e74d3054b27f..86f6ea6c6d67 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/queue_service_client.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/queue_service_client.py @@ -155,7 +155,7 @@ def generate_shared_access_signature( expiry, # type: Optional[Union[datetime, str]] start=None, # type: Optional[Union[datetime, str]] ip=None, # type: Optional[str] - protocol=None # type: Optional[str] + **kwargs # type: Any ): # type: (...) -> str """Generates a shared access signature for the queue service. @@ -187,12 +187,12 @@ def generate_shared_access_signature( or address range specified on the SAS token, the request is not authenticated. For example, specifying sip=168.1.5.65 or sip=168.1.5.60-168.1.5.70 on the SAS restricts the request to those IP addresses. - :param str protocol: - Specifies the protocol permitted for a request made. The default value - is https,http. + :keyword str protocol: + Specifies the protocol permitted for a request made. The default value is https. :return: A Shared Access Signature (sas) token. :rtype: str """ + protocol = kwargs.pop('protocol', None) if not hasattr(self.credential, 'account_key') and not self.credential.account_key: raise ValueError("No account SAS key available.")