For authentication for StaticFiles
: Is get_current_user
without Depends
in an arbitrary function possible?
#1379
juergendrachta
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to protect static files with help of FastAPI Users and the following method (idea taken from fastapi/fastapi#858)
But for doing so, I either need to
current_user
from within a function, which digests the currentRequest
object (reads the token from the Header, checks against the FastAPI User Backend, etc),Depends(current_user)
outside a FastAPI's decorator,I inspected the signature of
current_user
, but as it relies on severalDepends
objects, I wouldn't know how to use it directly.Any help is very welcome! ;-) Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions