Skip to content

Conversation

@weirongw23-msft
Copy link
Member

No description provided.

@weirongw23-msft weirongw23-msft marked this pull request as ready for review December 10, 2025 10:40
self._add_query(QueryStringConstants.SIGNED_REQUEST_HEADERS, "\n")
return
serialized = [str(k) + ":" + str(v) for k, v in request_headers.items()]
self._add_query(QueryStringConstants.SIGNED_REQUEST_HEADERS, "\n".join(serialized) + "\n")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the spec, request headers should have a trailing \n in addition to the \n separator for different signed values, and request query parameters should have a prefix \n (opposite to request headers).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it needs one at the end?

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Dec 10, 2025
@github-actions
Copy link

github-actions bot commented Dec 10, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-storage-blob
azure-storage-file-datalake
azure-storage-file-share
azure-storage-queue

@weirongw23-msft
Copy link
Member Author

We still have to figure out the HttpPipelinePolicy to use for tests.

As for the changelogs, I'm thinking: "Added support to specify request headers and query parameter values in generate_x_sas "

def add_request_headers(self, request_headers):
if not request_headers:
return
serialized = [str(k) + ":" + str(v) for k, v in request_headers.items()]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This is already a Dict[str, str] right? So, you shouldn't need the str on the key and value.

self._add_query(QueryStringConstants.SIGNED_REQUEST_HEADERS, "\n")
return
serialized = [str(k) + ":" + str(v) for k, v in request_headers.items()]
self._add_query(QueryStringConstants.SIGNED_REQUEST_HEADERS, "\n".join(serialized) + "\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it needs one at the end?

issued to the user specified in this value.
:param Dict[str, str] request_headers:
If specified, both the correct request header(s) and corresponding values must be present,
or the request will fail.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this description a little better? As is it doesn't make a lot of sense. Something like "Specifies a set of headers and their corresponding values that must be present in the request when using this SAS.". Somethng similar for query params.

This is internal doc, so it doesn't matter as much but please change the public docs on the public SAS functions. I didn't mention it before because we were just trying to get the API views done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants