feat: rename fingerprint to token

This commit is contained in:
Tien Do Nam
2025-02-24 21:13:55 +01:00
parent 6770614617
commit 2e15f0ad33
3 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -194,7 +194,7 @@ async fn webrtc_test() -> Result<()> {
version: "2.3".to_string(),
device_model: Some("test".to_string()),
device_type: Some(DeviceType::Desktop),
fingerprint: "test".to_string(),
token: "test".to_string(),
};
let connection =
webrtc::signaling::SignalingConnection::connect("wss://public.localsend.org/v1/ws", &info)
+7 -7
View File
@@ -95,9 +95,9 @@ pub struct ClientInfo {
#[serde(skip_serializing_if = "Option::is_none")]
pub device_type: Option<DeviceType>,
/// A fingerprint generated by the client.
/// A token generated by the client.
/// Used to merge the same peers detected on different channels (LAN, WebRTC, etc.).
pub fingerprint: String,
pub token: String,
}
impl ClientInfo {
@@ -108,7 +108,7 @@ impl ClientInfo {
version: info.version,
device_model: info.device_model,
device_type: info.device_type,
fingerprint: info.fingerprint,
token: info.token,
}
}
}
@@ -135,7 +135,7 @@ pub struct ClientInfoWithoutId {
/// A fingerprint generated by the client.
/// Used to merge the same peers detected on different channels (LAN, WebRTC, etc.).
pub fingerprint: String,
pub token: String,
}
impl From<ClientInfo> for ClientInfoWithoutId {
@@ -145,7 +145,7 @@ impl From<ClientInfo> for ClientInfoWithoutId {
version: info.version,
device_model: info.device_model,
device_type: info.device_type,
fingerprint: info.fingerprint,
token: info.token,
}
}
}
@@ -427,7 +427,7 @@ mod tests {
version: "2.3".to_string(),
device_model: Some("Dell".to_string()),
device_type: Some(DeviceType::Desktop),
fingerprint: "123".to_string(),
token: "123".to_string(),
},
peers: vec![],
};
@@ -464,7 +464,7 @@ mod tests {
version: "2.3".to_string(),
device_model: None,
device_type: Some(DeviceType::Desktop),
fingerprint: "123".to_string(),
token: "123".to_string(),
},
session_id: "456".to_string(),
sdp: "my-sdp".to_string(),
+1
View File
@@ -469,6 +469,7 @@ dependencies = [
"base64",
"bytes",
"futures-util",
"rand",
"serde",
"serde_json",
"thiserror",