You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to block all access using Basic HTTP Authentication, but wish to avoid accidentally forgetting any routes.
I thought that perhaps it could be implemented through a Fairing, but I cannot see how that would work given that "Fairings cannot respond to an incoming request directly."
I saw that I can get an Outcome from a request guard with request.guard::<BasicAuthentication>().await, but I do not see how it could be used.
I also know that it's possible to block data by modifying the response in on_response with something like response.set_status(Status::Unauthorized) but this still generates a response, requires erasing its content and more generally, seems like it would cause unintended consequences.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to block all access using Basic HTTP Authentication, but wish to avoid accidentally forgetting any routes.
I thought that perhaps it could be implemented through a Fairing, but I cannot see how that would work given that "Fairings cannot respond to an incoming request directly."
I saw that I can get an Outcome from a request guard with
request.guard::<BasicAuthentication>().await
, but I do not see how it could be used.I also know that it's possible to block data by modifying the response in
on_response
with something likeresponse.set_status(Status::Unauthorized)
but this still generates a response, requires erasing its content and more generally, seems like it would cause unintended consequences.I am using v0.5-rc.
Beta Was this translation helpful? Give feedback.
All reactions