diff --git a/cmd/cli/login.go b/cmd/cli/login.go index 06724b7fd20633ea323035171f764bad132aa509..1ac74cf86560f51d5ab13aff06438bffba0ef49a 100644 --- a/cmd/cli/login.go +++ b/cmd/cli/login.go @@ -24,7 +24,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" pb "isula.org/isula-build/api/services" "isula.org/isula-build/util" @@ -233,7 +233,7 @@ func getPassword(c *cobra.Command) error { } } else { r := func() ([]byte, error) { - return terminal.ReadPassword(0) + return term.ReadPassword(0) } if err := getPassFromInput(r); err != nil { return err diff --git a/go.mod b/go.mod index dbf9426a73428d458d36b5c88d081ab23ddcc52a..03f8f065f4a39e5bb9ec1d3c9b6ed30dabd31d6f 100644 --- a/go.mod +++ b/go.mod @@ -30,9 +30,10 @@ require ( github.com/spf13/cobra v1.2.1 github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect - golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 + golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 + golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 google.golang.org/grpc v1.42.0 gotest.tools/v3 v3.0.3 ) diff --git a/util/cipher.go b/util/cipher.go index fa0559aed31aa326f66b840befa27d7a7f7017be..c6fa555f2a5ddcef555fe864a35e076f5dc2d403 100644 --- a/util/cipher.go +++ b/util/cipher.go @@ -30,6 +30,7 @@ import ( "path/filepath" "github.com/pkg/errors" + constant "isula.org/isula-build" ) diff --git a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go deleted file mode 100644 index a4d1919a9e7d649e59e68747af9053b77f6e94da..0000000000000000000000000000000000000000 --- a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package terminal provides support functions for dealing with terminals, as -// commonly found on UNIX systems. -// -// Deprecated: this package moved to golang.org/x/term. -package terminal - -import ( - "io" - - "golang.org/x/term" -) - -// EscapeCodes contains escape sequences that can be written to the terminal in -// order to achieve different styles of text. -type EscapeCodes = term.EscapeCodes - -// Terminal contains the state for running a VT100 terminal that is capable of -// reading lines of input. -type Terminal = term.Terminal - -// NewTerminal runs a VT100 terminal on the given ReadWriter. If the ReadWriter is -// a local terminal, that terminal must first have been put into raw mode. -// prompt is a string that is written at the start of each input line (i.e. -// "> "). -func NewTerminal(c io.ReadWriter, prompt string) *Terminal { - return term.NewTerminal(c, prompt) -} - -// ErrPasteIndicator may be returned from ReadLine as the error, in addition -// to valid line data. It indicates that bracketed paste mode is enabled and -// that the returned line consists only of pasted data. Programs may wish to -// interpret pasted data more literally than typed data. -var ErrPasteIndicator = term.ErrPasteIndicator - -// State contains the state of a terminal. -type State = term.State - -// IsTerminal returns whether the given file descriptor is a terminal. -func IsTerminal(fd int) bool { - return term.IsTerminal(fd) -} - -// ReadPassword reads a line of input from a terminal without local echo. This -// is commonly used for inputting passwords and other sensitive data. The slice -// returned does not include the \n. -func ReadPassword(fd int) ([]byte, error) { - return term.ReadPassword(fd) -} - -// MakeRaw puts the terminal connected to the given file descriptor into raw -// mode and returns the previous state of the terminal so that it can be -// restored. -func MakeRaw(fd int) (*State, error) { - return term.MakeRaw(fd) -} - -// Restore restores the terminal connected to the given file descriptor to a -// previous state. -func Restore(fd int, oldState *State) error { - return term.Restore(fd, oldState) -} - -// GetState returns the current state of a terminal which may be useful to -// restore the terminal after a signal. -func GetState(fd int) (*State, error) { - return term.GetState(fd) -} - -// GetSize returns the dimensions of the given terminal. -func GetSize(fd int) (width, height int, err error) { - return term.GetSize(fd) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index ec0b7371e60e20556ac84e9744d7f3da18dfe19a..66a20fca980de372c3e2d9d8818f7a5bbbe819d2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -413,7 +413,6 @@ golang.org/x/crypto/openpgp/errors golang.org/x/crypto/openpgp/packet golang.org/x/crypto/openpgp/s2k golang.org/x/crypto/pbkdf2 -golang.org/x/crypto/ssh/terminal # golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 golang.org/x/net/context golang.org/x/net/http/httpguts @@ -436,6 +435,7 @@ golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows # golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 +## explicit golang.org/x/term # golang.org/x/text v0.3.7 golang.org/x/text/secure/bidirule