From e1a72fcd54a5887ba5e2599a799e7518d86f5fd3 Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Sun, 17 Oct 2021 21:01:28 -0400 Subject: [PATCH] Replace github.com/howeyc/gopass with golang.org/x/term gopass is no longer maintained, and the suggested replacement for getting passwords from terminals is x/term. --- cmd/ofx/command.go | 5 +++-- go.mod | 4 +--- go.sum | 15 ++++----------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/cmd/ofx/command.go b/cmd/ofx/command.go index c983ddb..1151732 100644 --- a/cmd/ofx/command.go +++ b/cmd/ofx/command.go @@ -3,7 +3,8 @@ package main import ( "flag" "fmt" - "github.com/howeyc/gopass" + "golang.org/x/term" + "os" ) type command struct { @@ -55,7 +56,7 @@ func checkServerFlags() bool { if ret && len(password) == 0 { fmt.Printf("Password for %s: ", username) - pass, err := gopass.GetPasswd() + pass, err := term.ReadPassword(int(os.Stdin.Fd())) if err != nil { fmt.Printf("Error reading password: %s\n", err) ret = false diff --git a/go.mod b/go.mod index 4aa6fe9..2b9d66a 100644 --- a/go.mod +++ b/go.mod @@ -2,9 +2,7 @@ module github.com/aclindsa/ofxgo require ( github.com/aclindsa/xml v0.0.0-20201125035057-bbd5c9ec99ac - github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c - golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 // indirect - golang.org/x/sys v0.0.0-20201006155630-ac719f4daadf // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 golang.org/x/text v0.3.7 ) diff --git a/go.sum b/go.sum index 8b47021..658778f 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,9 @@ github.com/aclindsa/xml v0.0.0-20201125035057-bbd5c9ec99ac h1:xCNSfPWpcx3Sdz/+aB/Re4L8oA6Y4kRRRuTh1CHCDEw= github.com/aclindsa/xml v0.0.0-20201125035057-bbd5c9ec99ac/go.mod h1:GjqOUT8xlg5+T19lFv6yAGNrtMKkZ839Gt4e16mBXlY= -github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c h1:aY2hhxLhjEAbfXOx2nRJxCXezC6CO2V/yN+OCr1srtk= -github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201006155630-ac719f4daadf h1:Bg47KQy0JhTHuf4sLiQwTMKwUMfSDwgSGatrxGR7nLM= -golang.org/x/sys v0.0.0-20201006155630-ac719f4daadf/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=