Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data-tables] SAS options do not appear in generated SAS, rendering it useless #25252

Closed
6 tasks
craxal opened this issue Mar 14, 2023 · 4 comments
Closed
6 tasks
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Tables

Comments

@craxal
Copy link
Member

craxal commented Mar 14, 2023

  • Package Name: @azure/data-tables
  • Package Version: 13.1.1
  • Operating system: N/A
  • nodejs
    • version: N/A
  • browser
    • name/version: N/A
  • typescript
    • version: N/A
  • Is the bug related to documentation in

Describe the bug
The following SAS query parameters do not appear in the generated SAS when the corresponding options are passed to generateBlobSASQueryParameters() or generateHnsSASQueryParameters()` in @azure/storage-blob or @azure/storage-data-lake:

  • Cache control (rscc)
  • Content disposition (rscd)
  • Content encoding (rsce)
  • Content language (rscl)
  • Content type (rsct)

The following SAS query parameters do not appear in the generated SAS when the corresponding options are passed to generateTableSas():

  • Start partition key (startPk)
  • Start row key (startRk)
  • End partition key (endPk)
  • End row key (endRk)

Looking at the code, the options are used to generated the signature. However, because they are not also included in the SAS URL, the generated SAS is effectively useless.

This occurs even if the version is high enough for the parameters to be included.

To Reproduce
Steps to reproduce the behavior:

  1. Call generateTableSas() with at least one of the above options (for example, startPartitionKey: "00".

Expected behavior
The generated SAS should have the corresponding query parameter (for example, startPk=00

Screenshots
image

Additional context
We are attempting to expose these extra parameters to Storage Explorer so users can generate SAS with them.

The lack of key parameters for tables has caused a regression in Storage Explorer. This needs to be addressed ASAP.

@ghost ghost added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Mar 14, 2023
@craxal craxal changed the title Table SAS options do not appear in generated SAS, rendering it useless SAS options do not appear in generated SAS, rendering it useless Mar 14, 2023
@jeremymeng jeremymeng added Client This issue points to a problem in the data-plane of the library. Tables labels Mar 15, 2023
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Mar 15, 2023
@jeremymeng jeremymeng changed the title SAS options do not appear in generated SAS, rendering it useless [data-tables] SAS options do not appear in generated SAS, rendering it useless Mar 15, 2023
@jeremymeng
Copy link
Contributor

I split the blob and file-datalake part into #25256 as they may be addressed separately.

@EmmaZhu
Copy link
Contributor

EmmaZhu commented Mar 15, 2023

Hi @craxal ,

About the issue in blob SDK, which interface do you use to generate blob SAS? The @azure/storage-blob SDK doesn’t have an interface with name of “generateBlobSas()”

I tried with this function generateBlobSASQueryParameters, the SAS generated includes the required properties in query string and usable. The generated SAS looks like:

?sv=2016-05-31&spr=https%2Chttp&st=2023-03-15T01%3A43%3A20Z&se=2023-03-16T01%3A48%3A20Z&sip=0.0.0.0-255.255.255.255&sr=b&sp=racwd&sig=***&rscc=cache-control-override&rscd=content-disposition-override&rsce=content-encoding-override&rscl=content-language-override&rsct=content-type-override

@craxal
Copy link
Member Author

craxal commented Mar 17, 2023

@EmmaZhu Yes, we're using generateBlobSASQueryParameters. It seems I can no longer reproduce the issue. I think we can close #25256.

ghost pushed a commit that referenced this issue Mar 23, 2023
### Packages impacted by this PR
@azure/data-tables

### Issues associated with this PR
#25252

### Describe the problem that is addressed by this PR
We accept startPartitionKey, startRowKey, endPartitionKey and endRowKey parameters when generating table sas token. However internally we are ignoring those provided values.

### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
To fix this problem we simply need to plumb the values through

### Are there test cases added in this PR? _(If not, why?)_
YES

### Provide a list of related PRs _(if any)_
N/A
@joheredi
Copy link
Member

Fixed with #25293

@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Tables
Projects
None yet
Development

No branches or pull requests

4 participants