Skip to content
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

Don't load ForwardedPorts from the .tsh/profile #26823

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions api/profile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ type Profile struct {
// SiteName is equivalent to the --cluster flag
SiteName string `yaml:"cluster,omitempty"`

// ForwardedPorts is the list of ports to forward to the target node.
ForwardedPorts []string `yaml:"forward_ports,omitempty"`

// DynamicForwardedPorts is a list of ports to use for dynamic port
// forwarding (SOCKS5).
DynamicForwardedPorts []string `yaml:"dynamic_forward_ports,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion api/profile/profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func TestProfileBasics(t *testing.T) {
WebProxyAddr: "proxy:3088",
SSHProxyAddr: "proxy:3023",
Username: "testuser",
ForwardedPorts: []string{"8000:example.com:8000"},
DynamicForwardedPorts: []string{"localhost:8080"},
Dir: dir,
SiteName: "example.com",
Expand Down
6 changes: 0 additions & 6 deletions lib/client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,6 @@ func (c *Config) LoadProfile(ps ProfileStore, proxyAddr string) error {
return trace.BadParameter("unable to parse mfa mode in user profile: %v.", err)
}

c.LocalForwardPorts, err = ParsePortForwardSpec(profile.ForwardedPorts)
if err != nil {
log.Warnf("Unable to parse port forwarding in user profile: %v.", err)
}

c.DynamicForwardedPorts, err = ParseDynamicPortForwardSpec(profile.DynamicForwardedPorts)
if err != nil {
log.Warnf("Unable to parse dynamic port forwarding in user profile: %v.", err)
Expand Down Expand Up @@ -663,7 +658,6 @@ func (c *Config) SaveProfile(makeCurrent bool) error {
PostgresProxyAddr: c.PostgresProxyAddr,
MySQLProxyAddr: c.MySQLProxyAddr,
MongoProxyAddr: c.MongoProxyAddr,
ForwardedPorts: c.LocalForwardPorts.String(),
SiteName: c.SiteName,
TLSRoutingEnabled: c.TLSRoutingEnabled,
TLSRoutingConnUpgradeRequired: c.TLSRoutingConnUpgradeRequired,
Expand Down