summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSimão Gomes Viana <devel@superboring.dev>2021-03-29 20:39:08 +0200
committerGitHub <noreply@github.com>2021-03-29 12:39:08 -0600
commit1c8ea0082822fbc13cb6b86443b908f6a068f385 (patch)
tree154befc93b40dcc4b9e5229c62fb1fbd2b7190e0 /modules
parentd63d5ae1ceba4591f2837dff7a9e102dff7e89f2 (diff)
go.mod: Migrate to golang.org/x/term (#4073)
golang.org/x/crypto/ssh/terminal is deprecated in favor of golang.org/x/term See https://github.com/caddyserver/caddy/pull/4073/checks?check_run_id=2152150495 Error: SA1019: package golang.org/x/crypto/ssh/terminal is deprecated: this package moved to golang.org/x/term. (staticcheck) See https://github.com/caddyserver/caddy/pull/4073/checks?check_run_id=2152228516 Error: SA1019: package golang.org/x/crypto/ssh/terminal is deprecated: this package moved to golang.org/x/term. (staticcheck) Test: go test -count=1 './...'
Diffstat (limited to 'modules')
-rw-r--r--modules/caddyhttp/caddyauth/command.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/caddyhttp/caddyauth/command.go b/modules/caddyhttp/caddyauth/command.go
index a2ae755..597681b 100644
--- a/modules/caddyhttp/caddyauth/command.go
+++ b/modules/caddyhttp/caddyauth/command.go
@@ -25,7 +25,7 @@ import (
"github.com/caddyserver/caddy/v2"
caddycmd "github.com/caddyserver/caddy/v2/cmd"
- "golang.org/x/crypto/ssh/terminal"
+ "golang.org/x/term"
)
func init() {
@@ -67,27 +67,27 @@ func cmdHashPassword(fs caddycmd.Flags) (int, error) {
if len(plaintext) == 0 {
fd := int(os.Stdin.Fd())
- if terminal.IsTerminal(fd) {
+ if term.IsTerminal(fd) {
// ensure the terminal state is restored on SIGINT
- state, _ := terminal.GetState(fd)
+ state, _ := term.GetState(fd)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
<-c
- _ = terminal.Restore(fd, state)
+ _ = term.Restore(fd, state)
os.Exit(caddy.ExitCodeFailedStartup)
}()
defer signal.Stop(c)
fmt.Fprint(os.Stderr, "Enter password: ")
- plaintext, err = terminal.ReadPassword(fd)
+ plaintext, err = term.ReadPassword(fd)
fmt.Fprintln(os.Stderr)
if err != nil {
return caddy.ExitCodeFailedStartup, err
}
fmt.Fprint(os.Stderr, "Confirm password: ")
- confirmation, err := terminal.ReadPassword(fd)
+ confirmation, err := term.ReadPassword(fd)
fmt.Fprintln(os.Stderr)
if err != nil {
return caddy.ExitCodeFailedStartup, err