mirror of
https://github.com/localsend/localsend.git
synced 2026-08-07 07:14:52 +00:00
feat: rename fingerprint to token
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Generated
+1
@@ -469,6 +469,7 @@ dependencies = [
|
||||
"base64",
|
||||
"bytes",
|
||||
"futures-util",
|
||||
"rand",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
|
||||
Reference in New Issue
Block a user