Skip to content

Commit

Permalink
Fix misc typos (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
bretello authored Dec 21, 2024
1 parent cf67295 commit 1b56c44
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/upterm/command/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func validateShareRequiredFlags(c *cobra.Command, args []string) error {
} else {
u, err := url.Parse(flagServer)
if err != nil {
result = multierror.Append(result, fmt.Errorf("error pasring server URL: %w", err))
result = multierror.Append(result, fmt.Errorf("error parsing server URL: %w", err))
}

if u != nil {
Expand Down
4 changes: 2 additions & 2 deletions host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type hostKeyCallback struct {
func (cb hostKeyCallback) checkHostKey(hostname string, remote net.Addr, key ssh.PublicKey) error {
if err := cb.HostKeyCallback(hostname, remote, key); err != nil {
kerr, ok := err.(*knownhosts.KeyError)
// Return err if it's neither key error or no authrorities hostname error
// Return err if it's neither key error or no authorities hostname error
if !ok && !strings.HasPrefix(err.Error(), errNoAuthoritiesHostname) {
return err
}
Expand Down Expand Up @@ -186,7 +186,7 @@ func (c *Host) Run(ctx context.Context) error {

logger := c.Logger.WithField("server", u)

logger.Info("Etablishing reverse tunnel")
logger.Info("Establishing reverse tunnel")
rt := internal.ReverseTunnel{
Host: u,
Signers: c.Signers,
Expand Down
2 changes: 1 addition & 1 deletion host/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (e *errDescryptingPrivateKey) Error() string {
return fmt.Sprintf("error decrypting private key %s", e.file)
}

// Signers return signers based on the folllowing conditions:
// Signers return signers based on the following conditions:
// If SSH agent is running and has keys, it returns signers from SSH agent, otherwise return signers from private keys;
// If neither works, it generates a signer on the fly.
func Signers(privateKeys []string) ([]ssh.Signer, func(), error) {
Expand Down
2 changes: 1 addition & 1 deletion server/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (g *UserCertSigner) SignCert(signer ssh.Signer) (ssh.Signer, error) {
},
}

// TODO: use differnt key to sign
// TODO: use different key to sign
if err := cert.SignCert(rand.Reader, signer); err != nil {
return nil, fmt.Errorf("error signing host cert: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func Start(opt Opt) error {

network := networks.Get(opt.Network)
if network == nil {
return fmt.Errorf("unsupport network provider %q", opt.Network)
return fmt.Errorf("unsupported network provider %q", opt.Network)
}

opts := parseNetworkOpt(opt.NetworkOpts)
Expand Down Expand Up @@ -267,7 +267,7 @@ func (s *Server) ServeWithContext(ctx context.Context, sshln net.Listener, wsln
// If sshln is not nil, always dial to SSHProxy.
// So Host/Client -> WSProxy -> SSHProxy -> sshd/Session
// This makes sure that SSHProxy terminates all SSH requests
// which provides a consistent authentication machanism.
// which provides a consistent authentication mechanism.
cd = sshProxyDialer{
sshProxyAddr: sshln.Addr().String(),
Logger: s.Logger.WithField("com", "ws-sshproxy-dialer"),
Expand Down
2 changes: 1 addition & 1 deletion server/sshd.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (s *sshd) Serve(ln net.Listener) error {

return true
},
ChannelHandlers: make(map[string]ssh.ChannelHandler), // disallow channl requests, e.g. shell
ChannelHandlers: make(map[string]ssh.ChannelHandler), // disallow channel requests, e.g. shell
RequestHandlers: map[string]ssh.RequestHandler{
streamlocalForwardChannelType: sh.Handler,
cancelStreamlocalForwardChannelType: sh.Handler,
Expand Down
2 changes: 1 addition & 1 deletion server/sshd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ func Test_sshd_DisallowSession(t *testing.T) {

_, err = client.NewSession()
if err == nil || !strings.Contains(err.Error(), "unsupported channel type") {
t.Fatalf("expect unsupported channle type error but got %v", err)
t.Fatalf("expect unsupported channel type error but got %v", err)
}
}
2 changes: 1 addition & 1 deletion server/sshproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func Test_sshProxy_dialUpstream(t *testing.T) {
}
_, err = client.NewSession()
if err == nil || !strings.Contains(err.Error(), "unsupported channel type") {
t.Fatalf("expect unsupported channle type error but got %v", err)
t.Fatalf("expect unsupported channel type error but got %v", err)
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions ws/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// NewSSHClient creates a ssh client via ws.
// The url must include username as session id and password as encoded node address.
// isUptermClient indicates whehter the client is host client or client client.
// isUptermClient indicates whether the client is host client or client client.
func NewSSHClient(u *url.URL, config *ssh.ClientConfig, isUptermClient bool) (*ssh.Client, error) {
conn, err := NewWSConn(u, isUptermClient)
if err != nil {
Expand All @@ -30,7 +30,7 @@ func NewSSHClient(u *url.URL, config *ssh.ClientConfig, isUptermClient bool) (*s

// NewWSConn creates a ws net.Conn.
// The url must include username as session id and password as encoded node address.
// isUptermClient indicates whehter the client is host client or client client.
// isUptermClient indicates whether the client is host client or client client.
func NewWSConn(u *url.URL, isUptermClient bool) (net.Conn, error) {
u, _ = url.Parse(u.String()) // clone
user := u.User
Expand Down

0 comments on commit 1b56c44

Please sign in to comment.