HTTP 403 on QueueClient if SAS uri is used without start date
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 393
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 36
Description
### Which service(blob, file, queue, table) does this issue concern?
Queue
### Which version of the Azurite was used?
Azurite-Queue/3.12.0
### Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
DockerHub
### What's the Node.js version?
Unknown
### What problem was encountered?
HTTP 403 for calls on QueueClient if SAS uri is used for initialization.
### Steps to reproduce the issue?
var incomingQueueClient = new QueueClient("UseDevelopmentStorage=true", "test-queue", new QueueClientOptions() { MessageEncoding = QueueMessageEncoding.Base64 });
await incomingQueueClient.CreateIfNotExistsAsync();
var builder = new QueueSasBuilder
{
//StartsOn = DateTimeOffset.UtcNow.AddDays(-1),
ExpiresOn = DateTimeOffset.UtcNow.AddDays(2)
};
builder.SetPermissions(QueueSasPermissions.All);
var sasUri = incomingQueueClient.GenerateSasUri(builder);
var sasGeneratedQueue = new QueueClient(sasUri, new QueueClientOptions() { MessageEncoding = QueueMessageEncoding.Base64 });
await sasGeneratedQueue.ReceiveMessagesAsync(12); // this calls fails with HTTP 403
### Have you found a mitigation/solution?
If you set a start for the SAS builder the call is successfull.
The problem is the if statement here that expects a start and expiry date. https://github.com/Azure/Azurite/blob/dbe5b715b94c52c1084e260ba312c88d3eb6c3d5/src/queue/authentication/QueueSASAuthenticator.ts#L329.
But the documentation of Azure allows to omit the start date.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.