Skip to content
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

Adding DRF support out of the box #39

Open
timur-orudzhov opened this issue Nov 8, 2019 · 3 comments
Open

Adding DRF support out of the box #39

timur-orudzhov opened this issue Nov 8, 2019 · 3 comments

Comments

@timur-orudzhov
Copy link

@vdboor Thanks for the great package!

It's not an issue actually, but a feature request. Do you consider adding DRF support shortly? Problem with that implementation that DRF has own auth system – https://www.django-rest-framework.org/api-guide/authentication/#setting-the-authentication-scheme.

Best regards!

@vdboor
Copy link
Member

vdboor commented Nov 19, 2019

You're welcome! :-)

I think you can already work with DRF. The authentication can be disabled (i.e. overwritten in the view). The DRF authentication is nothing more but a nice layer to set the proper request.user object. Your authentication function can check that, or be disabled when the view already handles this. The https://github.com/edoburu/django-private-storage#retrieving-files-by-object-id example also does that.

@timur-orudzhov
Copy link
Author

@vdboor thanks for the reply!

@digitalw
Copy link

digitalw commented Apr 6, 2021

Hi i am using DRF and graphql_jwt.backends.JSONWebTokenBackend and a custom can_access_file(self, private_file): method. However,private_file.request.user is always AnonymousUser . Is there anything I am missing?

Thanks.

Solved by #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants