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

Fix misc typos #315

Merged
merged 1 commit into from
Dec 21, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading