Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/adapter/src/coord/command_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,17 @@ impl Coordinator {
}
if let Some(auth) = self.catalog().try_get_role_auth_by_id(&role.id) {
if let Some(hash) = &auth.password_hash {
let _ = match mz_auth::hash::scram256_verify(&password, hash) {
Ok(_) => tx.send(Ok(AuthResponse {
role_id: role.id,
superuser: role.attributes.superuser.unwrap_or(false),
})),
Err(_) => tx.send(Err(AdapterError::AuthenticationError(
AuthenticationError::InvalidCredentials,
))),
};
let hash = hash.clone();
let role_id = role.id;
let superuser = role.attributes.superuser.unwrap_or(false);
task::spawn(|| "auth-check-hash", async move {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how results look if we use spawn_blocking instead?

let _ = match mz_auth::hash::scram256_verify(&password, &hash) {
Ok(_) => tx.send(Ok(AuthResponse { role_id, superuser })),
Err(_) => tx.send(Err(AdapterError::AuthenticationError(
AuthenticationError::InvalidCredentials,
))),
};
});
return;
}
}
Expand Down