-
-
Notifications
You must be signed in to change notification settings - Fork 854
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
Add Azure parameters
as kwargs for storage.url
#1071
Conversation
@jschneier any chance this can be accepted and released any time soon?Thank you. |
storages/backends/azure_storage.py
Outdated
name = self._get_valid_path(name) | ||
params = parameters.copy() if parameters else {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to copy, if it is used read only.
params = parameters.copy() if parameters else {} | |
params = parameters or {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to follow S3 example:
https://github.com/jschneier/django-storages/blob/master/storages/backends/s3boto3.py#L574-L577
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there the dict is augmented before using it. Here it is not.
644f6ad
to
493adb7
Compare
How come we only want to run this |
Good question! |
reading trough the docs expire is set to None by default which means it never expires. Any reason why it is not possible create token_sas when expire is not set? |
I see, it boils down to public and private access https://django-storages.readthedocs.io/en/latest/backends/azure.html#private-vs-public-access; tldr in private access there is always an expiration set, and in public access i guess one does not need any credentials. |
I think the name |
Take this with a grain of salt, I am not expert in this area at all, but here is my understanding -
To hopefully answer your question - apparently there is a limitation and it is not possible to send any headers in a public container since they are passed in the credentials which are used in the SAS token which is used only in private containers. |
That is quite the limitation! Thanks for the info. In that case we should add a disclaimer to the docs, and include the |
493adb7
to
0975da4
Compare
I tried to add some docs, let me know how can I improve it! Here are the links that I used:
I didn't added the second one, because it is too big |
docs/backends/azure.rst
Outdated
|
||
The difference between public and private URLs is that private includes the SAS token. | ||
With private URLs you can override certain properties stored for the blob by specifying | ||
query parameters as part of the shared access signature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add These properties include the cache-control, content-type, content-encoding, content-language, and content-disposition properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0975da4
to
8d6972b
Compare
It enables using kwargs, such as `content_type` https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/storage/azure-storage-blob/azure/storage/blob/_shared_access_signature.py#L482-L574
It enables using kwargs, such as
content_type
,content_disposition
, ..., when generating a shared access signature for a blobhttps://github.com/Azure/azure-sdk-for-python/blob/main/sdk/storage/azure-storage-blob/azure/storage/blob/_shared_access_signature.py#L482-L574