Comments (4)
@nobiehl thanks for reporting! Confirmed as bug. Azurite wrongly expects a value for start and expiry date. While I see in the spec that start date is optional (set to immediate) , expiry date seems to be required. Your request is, however, valid when executed against Azure Storage.
So what is the semantics of a missing expiry date? Infinite validity? Any ideas?
from azurite.
@arafato I couldn't find any specific information about the duration, if no expiry date is provided. But I figured out that if no expiry is provided when creating a policy the validity of the creates SAS tokens seem to be infinity. From my point of view it seems plausible. I tested it with the sorage account emulator, on azure and even on Azurite.
Here is my test script:
#!/bin/bash
# docker run --rm -p 10001:10001 -d arafato/azurite:2.6.5
ADD_DATE=false
if [ ! -z ${1} ]; then
# set to true when using azurite
ADD_DATE=true
fi
export AZURE_STORAGE_CONNECTION_STRING=\
'QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;'\
'DefaultEndpointsProtocol=http;'\
'AccountName=devstoreaccount1;'\
'AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;'
QUEUE_NAME="test-queue-1"
POLICY_NAME_WRITE="test-write"
PERMISSIONS_WRITE='a'
POLICY_NAME_READ="test-read"
PERMISSIONS_READ="rp"
MESSAGE='{"name":"klaus"}'
START=$(date "+%Y-%m-%d")
EXPIRY=$(date "+%Y-%m-%d" -d "$end_date+1 day")
DELETED=$(az storage queue delete --name ${QUEUE_NAME} --query deleted 2>&-)
if [ "${DELETED}" == "true" ]; then
echo "Waiting until the queue is deleted ..."
sleep 30
fi
az storage queue create --name ${QUEUE_NAME}
# WRITE MESSAGE POLICY
CREATE_POLICY_WRITE="az storage queue policy create --name ${POLICY_NAME_WRITE} --queue-name ${QUEUE_NAME} --permissions ${PERMISSIONS_WRITE}"
CREATE_POLICY_READ="az storage queue policy create --name ${POLICY_NAME_READ} --queue-name ${QUEUE_NAME} --permissions ${PERMISSIONS_READ}"
if [ "${ADD_DATE}" = "true" ]; then
CREATE_POLICY_WRITE="$CREATE_POLICY_WRITE --start ${START} --expiry ${EXPIRY}"
CREATE_POLICY_READ="$CREATE_POLICY_READ --start ${START} --expiry ${EXPIRY}"
fi
( # RUN
set -x
${CREATE_POLICY_WRITE}
${CREATE_POLICY_READ}
)
# READ MESSAGE AND PROCESS MESSAGES POLICY
az storage queue policy create --name ${POLICY_NAME_READ} --queue-name ${QUEUE_NAME} --permissions "${PERMISSIONS_READ}"
SAS_WRITE=$(az storage queue generate-sas --name ${QUEUE_NAME} --policy-name ${POLICY_NAME_WRITE})
SAS_READ=$(az storage queue generate-sas --name ${QUEUE_NAME} --policy-name ${POLICY_NAME_READ})
# ADD A MESSAGE
az storage message put --queue-name "${QUEUE_NAME}" --content "${MESSAGE}" --sas-token "${SAS_WRITE//'"'/}"
# GET MESSAGE
CONTENT=$(az storage message get --queue-name "${QUEUE_NAME}" --sas-token "${SAS_READ//'"'/}")
MESSAGE_ID=$(echo ${CONTENT} | jq -r .[0].id)
POP_RECEIPT=$(echo ${CONTENT} | jq -r .[0].popReceipt)
# DELET MESSAGE
az storage message delete --queue-name "${QUEUE_NAME}" --sas-token ${SAS_READ//'"'/} --id ${MESSAGE_ID} --pop-receipt ${POP_RECEIPT}
from azurite.
@nobiehl thanks for reporting this and the detailed repro steps.
I'm picking up where @arafato left off, and I'll add this to the list that we are working on addressing.
We're currently reviewing all the security issues raised in the projects dependencies, and deciding on how to address those, once that is complete, I hope to catch up on the outstanding issues.
from azurite.
Issue is resolved, but we want to ensure that we have behavioral parity with Azure storage for the case of malformed XML.
Creating a new issue for that.
from azurite.
Related Issues (20)
- stageBlock API does not return Content-MD5 HOT 1
- [FeatureRequest] VsCode Command for checking if azurite blob service is running or start service only if service is not running HOT 1
- TableClient.CreateQueryFilter(predicate) treating long data type filter as string type. HOT 2
- 403 error when trying to use `UserDelegationKey` HOT 4
- Copy Blob From URL (Sync) does not support `x-ms-copy-source-tag-option` HOT 1
- SQL Server 2022 Polybase with Azurite - file in use?
- VS Code "azurite.blobHost" config doesn't seem to work HOT 3
- Blob Tag Support HOT 2
- Upload From Url API is not implement yet? HOT 5
- Is there a web portal to check the received objects? HOT 2
- Azurite cannot handle encoded blob names HOT 5
- Generating blob SAS tokens is failing with the NuGet package of version 12.20.0 and Azurite 3.30.0 HOT 24
- Cannot create a blob container from Azure Java client 12.26.0 HOT 3
- Cannot Create/Delete a table with Azurite and WindowsAzure.Storage SDK HOT 3
- XStore C++ tests are failing because Azurite returns wrong md5 HOT 16
- Azurite doesn't match Azure when downloading byte range from empty blob HOT 2
- SAS download returns 403 HOT 7
- Batch blob requests fail when multipart boundary contains '=' HOT 4
- Update mysql2 version HOT 5
- Metadata Vanishing HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azurite.