mirror of
https://github.com/v0l/zap-stream-core.git
synced 2025-06-22 14:28:05 +00:00
Implement fingerprint-based viewer token generation using IP + user agent hashing (#4)
* Initial plan for issue * Implement fingerprint-based viewer token generation Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> * Fix bech32 encoding and add comprehensive tests Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> * Remove bech32 HRP and move dependencies to workspace Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
This commit is contained in:
@ -38,7 +38,7 @@ nostr-sdk = { version = "0.38.0" }
|
||||
fedimint-tonic-lnd = { version = "0.2.0", default-features = false, features = ["invoicesrpc", "versionrpc"] }
|
||||
reqwest = { version = "0.12.9", features = ["stream", "json"] }
|
||||
base64 = { version = "0.22.1" }
|
||||
sha2 = { version = "0.10.8" }
|
||||
sha2.workspace = true
|
||||
pretty_env_logger = "0.5.0"
|
||||
clap = { version = "4.5.16", features = ["derive"] }
|
||||
futures-util = "0.3.31"
|
||||
|
@ -71,8 +71,8 @@ impl HttpServer {
|
||||
api.track_viewer(token, stream_id, &client_ip, user_agent.clone());
|
||||
token.clone()
|
||||
} else {
|
||||
// Generate new viewer token
|
||||
let token = ViewerTracker::generate_viewer_token();
|
||||
// Generate new viewer token based on IP and user agent fingerprint
|
||||
let token = ViewerTracker::generate_viewer_token(&client_ip, user_agent.as_deref());
|
||||
api.track_viewer(&token, stream_id, &client_ip, user_agent);
|
||||
token
|
||||
};
|
||||
|
Reference in New Issue
Block a user