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:
Copilot
2025-06-07 16:27:37 +01:00
committed by GitHub
parent 6f276d7e72
commit e097b9caf1
5 changed files with 95 additions and 6 deletions

View File

@ -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
};