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
23 changes: 14 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,20 @@ 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_blocking(
|| "auth-check-hash",
move || {
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