meteozond/djangodav — pull request #14 by chrisv2 (2014-05-16 14:47:50+00:00)
Title: Fix restframework auth

Rest Framework uses its own request wrapper, so we must fake it to make SessionAuthentication() to work at all. Also, every authentication in authentications should be actually used, which was not the case before.

With this change, the following is possible:

class RestAuthDavView(RestAuthViewMixIn, DavView):
authentications = (RestSessionAuthentication(), RestBasicAuthentication(),)

- if a session is available, session is used to authenticate (useful for ajax client)
- if no session is available, require basic authentication (for external client)