Skip to content

Commit 64ab466

Browse files
committed
refactor(cubesql): Use correct naming for checkSqlAuth
1 parent 07c74d8 commit 64ab466

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

packages/cubejs-backend-native/src/auth.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ use crate::channel::call_js_with_channel_as_callback;
1717
#[derive(Debug)]
1818
pub struct NodeBridgeAuthService {
1919
channel: Arc<Channel>,
20-
check_auth: Arc<Root<JsFunction>>,
20+
check_sql_auth: Arc<Root<JsFunction>>,
2121
}
2222

2323
impl 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?;

packages/cubejs-backend-native/src/node_export.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ impl SQLInterface {
4848

4949
fn register_interface<C: NodeConfiguration>(mut cx: FunctionContext) -> JsResult<JsPromise> {
5050
let options = cx.argument::<JsObject>(0)?;
51-
let check_auth = options
52-
.get::<JsFunction, _, _>(&mut cx, "checkAuth")?
51+
let check_sql_auth = options
52+
.get::<JsFunction, _, _>(&mut cx, "checkSqlAuth")?
5353
.root(&mut cx);
5454
let transport_sql_api_load = options
5555
.get::<JsFunction, _, _>(&mut cx, "sqlApiLoad")?
@@ -101,7 +101,7 @@ fn register_interface<C: NodeConfiguration>(mut cx: FunctionContext) -> JsResult
101101
transport_sql_generator,
102102
transport_can_switch_user_for_session,
103103
);
104-
let auth_service = NodeBridgeAuthService::new(cx.channel(), check_auth);
104+
let auth_service = NodeBridgeAuthService::new(cx.channel(), check_sql_auth);
105105

106106
std::thread::spawn(move || {
107107
let config = C::new(NodeConfigurationFactoryOptions {

0 commit comments

Comments
 (0)