Closed max-arnold closed 11 years ago
I'd prefer to refactor the implementation to make it easy to customize the HTTP requests through subclassing.
That seems more future-proof and generally useful than implementing basic auth (and then digest auth, and then proxies, and then... the list is endless).
Do you have any ideas of how this could be designed? I can imagine the following:
my_model_transport = CustomTransport(options, ...)
my_model_storage = DistributedStorage(transport=my_model_transport)
class MyModel(models.Model):
image = ImageField(storage=my_model_storage, ...)
Haven't decided what to do with base_url which is passed from Storage instance to Transport.
Do the changes in https://github.com/aaugustin/django-resto/pull/6 address your needs?
Yes. Thanks a lot!
Cool. I've merged it and I'm going to release 1.1 shortly.
I'm unsure about this one, it was extracted from my private fork and is not used in production. Right now we maintain IP access list with list of servers which are allowed to modify files, but this becomes problematic with more and more servers added.
The patch is not finished - there is no way to specify headers in settings or via DistributedStorage instance. It does not break existing tests, but I haven't tested it after extraction from my fork.
It manually constructs Authorization header in order to avoid double HTTP requests.
What is your opinion on this feature?