Skip to content

Conversation

@garmr-ulfr
Copy link
Collaborator

@garmr-ulfr garmr-ulfr commented Dec 19, 2025

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 ClientContextInjector for 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

  • Added a clientContextTracker field to the tunnel struct, and initialized it during tunnel setup using a new newClientContextInjector function. This injector gathers user and platform info for outbound connections and registers itself for tracking. (vpn/tunnel.go) [1] [2] [3]
  • Updated the options reload logic to dynamically merge new outbound tags into the ClientContextInjector match bounds, ensuring accurate context tracking for new connections. (vpn/tunnel.go)

Dependency updates

  • Updated the github.com/getlantern/lantern-box dependency to a newer version in go.mod, ensuring compatibility with client context tracking features. (go.mod)
  • Added necessary imports for clientcontext and user modules to support the new tracking functionality. (vpn/tunnel.go)

Test stub enhancements

  • Added an IsPro() method to mockUserInfo and UserStub test 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]

@garmr-ulfr garmr-ulfr force-pushed the client-info-tracker branch from 950d238 to a530669 Compare January 6, 2026 16:11
@garmr-ulfr garmr-ulfr marked this pull request as ready for review January 6, 2026 20:41
Copilot AI review requested due to automatic review settings January 6, 2026 20:41
Copy link
Contributor

Copilot AI left a 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 ClientContextInjector to track client context in outbound connections
  • Updated lantern-box dependency 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.

@garmr-ulfr garmr-ulfr changed the title inject client info into tracker Breaking change: inject client info into tracker Jan 6, 2026
Copy link
Contributor

@WendelHime WendelHime left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants