Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand All @@ -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.")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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

Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.")

Expand Down