Azure / Azure/azure-storage-python

Storage SAS Token from API does not match Azure Portal

Offen
#621 4 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @xiafu-msft Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
343
Forks
243
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Which service(blob, file, queue) does this issue concern?
Requirement is for `blob` only

### Which version of the SDK was used? Please provide the output of `pip freeze`.
`azure-storage-blob==1.4.0`

### What problem was encountered?
When comparing the output of `azure.storage.blob.BlockBlobService.generate_account_shared_access_signature()` with the same parameters, the SAS token generated does not match what the Azure Portal generates.

`bbs_acct_token = bbs.generate_account_shared_access_signature(
ResourceTypes.CONTAINER + ResourceTypes.OBJECT,
AccountPermissions.READ + AccountPermissions.WRITE + AccountPermissions.LIST \
# + AccountPermissions.CREATE,
,datetime.utcnow() + timedelta(hours=1))`

Generates: `se=2019-07-28T16%3A07%3A27Z&sp=&sv=2017-04-17&ss=b&srt=co&sig=%2BTO1J2/zNIYlvhEonRkFRTZPkNvm...`

*There seems to be an issue with the `sp=` value - am expecting `rwl` but there is nothing.

From the Azure Portal (using the same parameters) the SAS Token looks like:

`?sv=2018-03-28&ss=b&srt=co&sp=rwdlac&se=2019-07-28T22:45:47Z&st=2019-07-28T14:45:47Z&spr=https&sig=PMu3KnDRV7VzOig1ewVP2T4TU0qowmEn...`

### Have you found a mitigation/solution?
No - the requirement is to generate the token thru the storage API

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.