Skip to content

Commit

Permalink
Dont load ForwardedPorts from profile, only recieve them from the cli (
Browse files Browse the repository at this point in the history
  • Loading branch information
lxea committed Jun 2, 2023
1 parent d80549b commit 6821608
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions api/profile/profile.go
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
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
Expand Up @@ -637,11 +637,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 @@ -669,7 +664,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

0 comments on commit 6821608

Please sign in to comment.