Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Fix file share SAS list scoping
Browse files Browse the repository at this point in the history
- Resolves #88
  • Loading branch information
alfpark committed Oct 16, 2018
1 parent f92a142 commit bac93b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion blobxfer/operations/azure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def _credential_allows_container_list(self):
for part in sasparts:
tmp = part.split('=')
if tmp[0] == 'sr':
caccess = 'c' in tmp[1]
caccess = 'c' in tmp[1] or 's' in tmp[1]
break
elif tmp[0] == 'si':
# assume sas policies allow container list
Expand Down
12 changes: 12 additions & 0 deletions tests/test_blobxfer_operations_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ def test_credential_allows_container_list():
assert a._credential_allows_container_list()
assert a.can_list_container_objects

a = azops.StorageAccount(
'name', '?sv=0&sr=s&sp=l&sig=2', 'core.windows.net', 10, to,
None)
assert a._credential_allows_container_list()
assert a.can_list_container_objects

a = azops.StorageAccount(
'name', '?sv=0&sr=f&sp=rl&sig=2', 'core.windows.net', 10, to,
None)
assert not a._credential_allows_container_list()
assert not a.can_list_container_objects

a = azops.StorageAccount(
'name', '?sv=0&si=policy&sig=2', 'core.windows.net', 10, to, None)
assert a._credential_allows_container_list()
Expand Down

0 comments on commit bac93b4

Please sign in to comment.