diff --git a/internal/cmd/commands/targetscmd/ssh_funcs.go b/internal/cmd/commands/targetscmd/ssh_funcs.go index ecc20f045d..48f8b4d5ac 100644 --- a/internal/cmd/commands/targetscmd/ssh_funcs.go +++ b/internal/cmd/commands/targetscmd/ssh_funcs.go @@ -14,6 +14,7 @@ func init() { extraSshActionsFlagsMapFunc = extraSshActionsFlagsMapFuncImpl extraSshFlagsFunc = extraSshFlagsFuncImpl extraSshFlagsHandlingFunc = extraSshFlagsHandlingFuncImpl + extraSshSynopsisFunc = extraSshSynopsisFuncImpl } func extraSshActionsFlagsMapFuncImpl() map[string][]string { @@ -152,3 +153,7 @@ func extraSshFlagsHandlingFuncImpl(c *SshCommand, _ *base.FlagSets, opts *[]targ return true } + +func extraSshSynopsisFuncImpl(_ *SshCommand) string { + return "Create a ssh-type target (HCP only)" +} diff --git a/internal/daemon/worker/handler.go b/internal/daemon/worker/handler.go index a7e344b48e..727531579d 100644 --- a/internal/daemon/worker/handler.go +++ b/internal/daemon/worker/handler.go @@ -184,7 +184,7 @@ func (w *Worker) handleProxy(listenerCfg *listenerutil.ListenerConfig, sessionMa endpointUrl, err := url.Parse(sess.GetEndpoint()) if err != nil { event.WriteError(ctx, op, err, event.WithInfoMsg("worker failed to parse target endpoint", "endpoint", sess.GetEndpoint())) - if err = conn.Close(websocket.StatusProtocolError, "unsupported-protocol"); err != nil { + if err = conn.Close(websocket.StatusProtocolError, "unable to parse endpoint"); err != nil { event.WriteError(ctx, op, err, event.WithInfoMsg("error closing client connection")) } return @@ -192,7 +192,7 @@ func (w *Worker) handleProxy(listenerCfg *listenerutil.ListenerConfig, sessionMa handleProxyFn, err := proxyHandlers.GetHandler(endpointUrl.Scheme) if err != nil { event.WriteError(ctx, op, err, event.WithInfoMsg("worker received request for unsupported protocol", "protocol", endpointUrl.Scheme)) - if err = conn.Close(websocket.StatusProtocolError, "unsupported-protocol"); err != nil { + if err = conn.Close(websocket.StatusProtocolError, fmt.Sprintf("worker does not support %q type", endpointUrl.Scheme)); err != nil { event.WriteError(ctx, op, err, event.WithInfoMsg("error closing client connection")) } return