-
Notifications
You must be signed in to change notification settings - Fork 0
Breaking change: inject client info into tracker #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
950d238 to
a530669
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces a client context tracking mechanism that injects user and platform information into VPN tunnel connections. The implementation adds a ClientContextInjector that collects user metadata (device ID, account type, country code) and registers it with the router for outbound connection tracking.
- Added
ClientContextInjectorto track client context in outbound connections - Updated
lantern-boxdependency to support client context tracking features - Enhanced test stubs with
IsPro()method to support new user account type checking
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vpn/tunnel.go | Implements client context tracking by adding clientContextTracker field, initializing ClientContextInjector, and updating match bounds during options reload |
| go.mod | Updates lantern-box dependency to version with client context tracking support |
| go.sum | Adds checksums for new lantern-box dependency versions |
| config/config_test.go | Adds IsPro() method to UserStub test type |
| api/user_test.go | Adds IsPro() method to mockUserInfo test type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WendelHime
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, left one suggestion
This pull request introduces a new client context tracking mechanism in the VPN tunnel, improves dependency management, and updates test stubs to support the new functionality. The main focus is on integrating a
ClientContextInjectorfor tracking user context in outbound connections, with supporting changes in dependency injection and configuration reload logic.Warning
Data cap tracking must be enabled on on the servers before we merge this or the client will fail to connect.
Client context tracking integration
clientContextTrackerfield to thetunnelstruct, and initialized it during tunnel setup using a newnewClientContextInjectorfunction. This injector gathers user and platform info for outbound connections and registers itself for tracking. (vpn/tunnel.go) [1] [2] [3]ClientContextInjectormatch bounds, ensuring accurate context tracking for new connections. (vpn/tunnel.go)Dependency updates
github.com/getlantern/lantern-boxdependency to a newer version ingo.mod, ensuring compatibility with client context tracking features. (go.mod)clientcontextandusermodules to support the new tracking functionality. (vpn/tunnel.go)Test stub enhancements
IsPro()method tomockUserInfoandUserStubtest types to support the new client context tracking logic that relies on user account type information. (api/user_test.go,config/config_test.go) [1] [2]