-
Notifications
You must be signed in to change notification settings - Fork 114
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
RSDK-10257 - Early return if tunnel destination port not allowed #4856
base: main
Are you sure you want to change the base?
Conversation
@@ -1368,6 +1368,21 @@ func RobotsPartTunnelAction(c *cli.Context, args robotsPartTunnelArgs) error { | |||
} | |||
|
|||
func tunnelTraffic(ctx *cli.Context, robotClient *client.RobotClient, local, dest int) error { | |||
// don't block tunnel attempt if ListTunnels fails in any way - it may be unimplemented. | |||
// TODO: early return if ListTunnels fails. |
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.
maybe do in a month
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.
You don't want to this in actual robotClient.Tunnel
? That way both the CLI and anyone trying to programmatically use robotClient.Tunnel
both encounter early errors?
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.
issue is robotClient.Tunnel
isn't called until the first connection is made. if robotClient.Tunnel
is called, it'd error out immediately even without this change
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.
Ah gotcha thanks for the explanation 🙏🏻 .
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
cli/client.go
Outdated
} | ||
} | ||
if !allowed { | ||
return errors.Errorf("tunneling to destination port %v not allowed", dest) |
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.
Could add a small message about ensuring traffic_tunnel_endpoints
is set correctly on your machine.
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.
updated!
maybe merge next week to allow for the rollout of config changes first.
example output