File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -544,15 +544,20 @@ impl Coordinator {
544544 }
545545 if let Some ( auth) = self . catalog ( ) . try_get_role_auth_by_id ( & role. id ) {
546546 if let Some ( hash) = & auth. password_hash {
547- let _ = match mz_auth:: hash:: scram256_verify ( & password, hash) {
548- Ok ( _) => tx. send ( Ok ( AuthResponse {
549- role_id : role. id ,
550- superuser : role. attributes . superuser . unwrap_or ( false ) ,
551- } ) ) ,
552- Err ( _) => tx. send ( Err ( AdapterError :: AuthenticationError (
553- AuthenticationError :: InvalidCredentials ,
554- ) ) ) ,
555- } ;
547+ let hash = hash. clone ( ) ;
548+ let role_id = role. id ;
549+ let superuser = role. attributes . superuser . unwrap_or ( false ) ;
550+ task:: spawn_blocking (
551+ || "auth-check-hash" ,
552+ move || {
553+ let _ = match mz_auth:: hash:: scram256_verify ( & password, & hash) {
554+ Ok ( _) => tx. send ( Ok ( AuthResponse { role_id, superuser } ) ) ,
555+ Err ( _) => tx. send ( Err ( AdapterError :: AuthenticationError (
556+ AuthenticationError :: InvalidCredentials ,
557+ ) ) ) ,
558+ } ;
559+ } ,
560+ ) ;
556561 return ;
557562 }
558563 }
You can’t perform that action at this time.
0 commit comments