-
Notifications
You must be signed in to change notification settings - Fork 285
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
feat(auth): refresh route and auth router refactor #4458
Conversation
6f4058e
to
3aa7a93
Compare
03a5ad0
to
dc21f70
Compare
7857c9b
to
c64ef86
Compare
c64ef86
to
fa2ef19
Compare
password_is_valid = partial( | ||
is_valid_password, password=password, salt=salt, password_hash=password_hash | ||
) | ||
if not await loop.run_in_executor(None, password_is_valid): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinda confused by this. Why do you need to run in the loop here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
computing the password hash is by design an expensive operation to mitigate against brute-force attacks. this is an optimization to run the computation in a background thread and yield control of the event loop while it is being computed.
Co-authored-by: Mikyo King <mikyo@arize.com>
Co-authored-by: Dustin Ngo <dustin@arize.com>
resolves #4433