@@ -17,14 +17,14 @@ use crate::channel::call_js_with_channel_as_callback;
1717#[ derive( Debug ) ]
1818pub struct NodeBridgeAuthService {
1919 channel : Arc < Channel > ,
20- check_auth : Arc < Root < JsFunction > > ,
20+ check_sql_auth : Arc < Root < JsFunction > > ,
2121}
2222
2323impl NodeBridgeAuthService {
24- pub fn new ( channel : Channel , check_auth : Root < JsFunction > ) -> Self {
24+ pub fn new ( channel : Channel , check_sql_auth : Root < JsFunction > ) -> Self {
2525 Self {
2626 channel : Arc :: new ( channel) ,
27- check_auth : Arc :: new ( check_auth ) ,
27+ check_sql_auth : Arc :: new ( check_sql_auth ) ,
2828 }
2929 }
3030}
@@ -36,14 +36,14 @@ pub struct TransportRequest {
3636}
3737
3838#[ derive( Debug , Serialize ) ]
39- struct CheckAuthRequest {
39+ struct CheckSQLAuthRequest {
4040 request : TransportRequest ,
4141 user : Option < String > ,
4242 password : Option < String > ,
4343}
4444
4545#[ derive( Debug , Deserialize ) ]
46- struct CheckAuthResponse {
46+ struct CheckSQLAuthResponse {
4747 password : Option < String > ,
4848 superuser : bool ,
4949 #[ serde( rename = "securityContext" , skip_serializing_if = "Option::is_none" ) ]
@@ -76,17 +76,17 @@ impl SqlAuthService for NodeBridgeAuthService {
7676
7777 let request_id = Uuid :: new_v4 ( ) . to_string ( ) ;
7878
79- let extra = serde_json:: to_string ( & CheckAuthRequest {
79+ let extra = serde_json:: to_string ( & CheckSQLAuthRequest {
8080 request : TransportRequest {
8181 id : format ! ( "{}-span-1" , request_id) ,
8282 meta : None ,
8383 } ,
8484 user : user. clone ( ) ,
8585 password : password. clone ( ) ,
8686 } ) ?;
87- let response: CheckAuthResponse = call_js_with_channel_as_callback (
87+ let response: CheckSQLAuthResponse = call_js_with_channel_as_callback (
8888 self . channel . clone ( ) ,
89- self . check_auth . clone ( ) ,
89+ self . check_sql_auth . clone ( ) ,
9090 Some ( extra) ,
9191 )
9292 . await ?;
0 commit comments