Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const (

// Whether or not users should have the option to launch private servers on GCP.
GCP = "private.gcp"

// Whether or not the client should run the unbounded widget proxy.
UNBOUNDED = "unbounded"
)

type ServerLocation struct {
Expand Down Expand Up @@ -58,6 +61,15 @@ type RuleSet struct {
DownloadDetour string `json:"download_detour,omitempty"`
}

type UnboundedConfig struct {
DiscoverySrv string `json:"discovery_srv,omitempty"`
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field name DiscoverySrv uses the abbreviation "Srv" which is inconsistent with the rest of the codebase. Other fields use full words rather than abbreviations (e.g., ServerLocation, Servers, StunServers in config/types.pb.go). Consider renaming this to DiscoveryServer for consistency, unless "Srv" has a specific technical meaning in the unbounded widget proxy context.

Copilot uses AI. Check for mistakes.
DiscoveryEndpoint string `json:"discovery_endpoint,omitempty"`
EgressAddr string `json:"egress_addr,omitempty"`
EgressEndpoint string `json:"egress_endpoint,omitempty"`
CTableSize int `json:"ctable_size,omitempty"`
PTableSize int `json:"ptable_size,omitempty"`
Comment on lines +64 to +70
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UnboundedConfig struct lacks documentation. Following the pattern established in the codebase (e.g., RuleSet at lines 54-62), the struct fields should have inline comments explaining their purpose, especially for fields that may not be self-explanatory like CTableSize and PTableSize. Consider adding comments that explain what "discovery", "egress", and the table sizes represent in the context of the unbounded widget proxy.

Suggested change
type UnboundedConfig struct {
DiscoverySrv string `json:"discovery_srv,omitempty"`
DiscoveryEndpoint string `json:"discovery_endpoint,omitempty"`
EgressAddr string `json:"egress_addr,omitempty"`
EgressEndpoint string `json:"egress_endpoint,omitempty"`
CTableSize int `json:"ctable_size,omitempty"`
PTableSize int `json:"ptable_size,omitempty"`
// UnboundedConfig configures the client-side unbounded widget proxy.
type UnboundedConfig struct {
// DiscoverySrv is the DNS SRV record used to discover unbounded widget proxy
// backends when SRV-based service discovery is enabled.
DiscoverySrv string `json:"discovery_srv,omitempty"`
// DiscoveryEndpoint is the HTTP(S) endpoint used to discover unbounded widget
// proxy backends when not relying on SRV records.
DiscoveryEndpoint string `json:"discovery_endpoint,omitempty"`
// EgressAddr is the local or remote address that the unbounded widget proxy
// should use for sending egress traffic (for example, a bound IP/port).
EgressAddr string `json:"egress_addr,omitempty"`
// EgressEndpoint is the HTTP(S) endpoint through which the unbounded widget
// proxy sends its egress traffic once a backend has been selected.
EgressEndpoint string `json:"egress_endpoint,omitempty"`
// CTableSize controls the size of the connection table used by the unbounded
// widget proxy to track active or recently active connections.
CTableSize int `json:"ctable_size,omitempty"`
// PTableSize controls the size of the path/table used by the unbounded widget
// proxy to maintain per-path or per-peer state.
PTableSize int `json:"ptable_size,omitempty"`

Copilot uses AI. Check for mistakes.
}

type ConfigResponse struct {
Country string `json:"country,omitempty"`
IP string `json:"ip,omitempty"`
Expand All @@ -68,6 +80,14 @@ type ConfigResponse struct {
Options O.Options `json:"options,omitempty"`
SmartRouting SmartRoutingRules `json:"smart_routing,omitempty"`
AdBlock AdBlockRules `json:"ad_block,omitempty"`

// BanditURLOverrides maps outbound tags to per-proxy callback URLs for
// the bandit Thompson sampling system. When set, these override the
// default MutableURLTest URL for each specific outbound, allowing the
// server to detect which proxies successfully connected.
BanditURLOverrides map[string]string `json:"bandit_url_overrides,omitempty"`
Comment on lines +84 to +88
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BanditURLOverrides field is not mentioned in the PR description. The PR description states it "Adds UnboundedConfig struct" and "Adds Unbounded field to ConfigResponse", but does not mention this bandit-related field. If this field is intentional and part of this PR, please update the PR description to include it. If it was added unintentionally, it should be removed.

Copilot uses AI. Check for mistakes.

Unbounded *UnboundedConfig `json:"unbounded,omitempty"`
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added Unbounded field in ConfigResponse lacks test coverage. The existing tests (TestConfigResponseSerialization) cover serialization of ConfigResponse fields, but don't include the new Unbounded field. Consider adding a test case that includes an UnboundedConfig instance to ensure proper JSON serialization and deserialization of all fields including DiscoverySrv, DiscoveryEndpoint, EgressAddr, EgressEndpoint, CTableSize, and PTableSize.

Copilot uses AI. Check for mistakes.
}

type ConfigRequest struct {
Expand All @@ -83,4 +103,5 @@ type ConfigRequest struct {
Locale string `json:"locale,omitempty"`
Protocols []string `json:"protocols,omitempty"`
MetricsOptedIn bool `json:"metrics_opted_in,omitempty"`
Version string `json:"version,omitempty"`
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Version field added to ConfigRequest is not mentioned in the PR description. The PR description only mentions additions related to UnboundedConfig. If this field is intentional and part of this PR, please update the PR description to include it. If it was added unintentionally, it should be removed.

Copilot uses AI. Check for mistakes.
}