Skip to content

Commit

Permalink
minor cleanup based on make check
Browse files Browse the repository at this point in the history
  • Loading branch information
bpiraeus committed Mar 14, 2022
1 parent 9e5c5af commit 7291b04
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
5 changes: 2 additions & 3 deletions api/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func Authorize(username string, password string) (ok bool) {
default:
return false
}
if ok != true {
if !ok {
return false
}
}
Expand Down Expand Up @@ -67,7 +67,7 @@ func getGroups(c *gin.Context, username string) {

var groups []string
config := context.Config()
dn := fmt.Sprintf("%s", config.Auth.LdapDN)
dn := config.Auth.LdapDN
session := sessions.Default(c)
// connect to ldap server
server := fmt.Sprintf("%s", config.Auth.Server)
Expand All @@ -94,7 +94,6 @@ func getGroups(c *gin.Context, username string) {
groups = append(groups, fmt.Sprintf("%s,", value))
}
session.Set("Groups", groups)
return
}

func checkGroup(c *gin.Context, ldgroup string) bool {
Expand Down
4 changes: 2 additions & 2 deletions console/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package console
import (
"syscall"

"golang.org/x/crypto/ssh/terminal"
"golang.org/x/term"
)

// RunningOnTerminal checks whether stdout is terminal
func RunningOnTerminal() bool {
return terminal.IsTerminal(syscall.Stdout)
return term.IsTerminal(syscall.Stdout)
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ require (
golang.org/x/crypto v0.0.0-20220313003712-b769efc7c000
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
Expand Down
4 changes: 2 additions & 2 deletions pgp/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"golang.org/x/crypto/openpgp/clearsign"
openpgp_errors "golang.org/x/crypto/openpgp/errors"
"golang.org/x/crypto/openpgp/packet"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/term"
)

// Test interface
Expand Down Expand Up @@ -174,7 +174,7 @@ func (g *GoSigner) Init() error {
for attempt := 0; attempt < 3; attempt++ {
fmt.Print("\nEnter passphrase: ")
var bytePassphrase []byte
bytePassphrase, err = terminal.ReadPassword(int(syscall.Stdin))
bytePassphrase, err = term.ReadPassword(int(syscall.Stdin))
if err != nil {
return errors.Wrap(err, "error reading passphare")
}
Expand Down

0 comments on commit 7291b04

Please sign in to comment.