diff --git a/sshpiperd/challenger/authy/authyid.go b/sshpiperd/challenger/authy/authyid.go index d0234b4d..61df9558 100644 --- a/sshpiperd/challenger/authy/authyid.go +++ b/sshpiperd/challenger/authy/authyid.go @@ -7,7 +7,7 @@ import ( "strings" ) -func (a authyClient) findAuthyId(user string) (string, error) { +func (a authyClient) findAuthyID(user string) (string, error) { // TODO a better way to handle large database file, err := os.Open(a.Config.File) diff --git a/sshpiperd/challenger/authy/authyid_test.go b/sshpiperd/challenger/authy/authyid_test.go index 63779fd9..f0d5ffed 100644 --- a/sshpiperd/challenger/authy/authyid_test.go +++ b/sshpiperd/challenger/authy/authyid_test.go @@ -25,7 +25,7 @@ hook 789 `), os.ModePerm) { - id, err := a.findAuthyId("piper") + id, err := a.findAuthyID("piper") if err != nil { t.Fatalf("findId failed %v", err) } @@ -36,7 +36,7 @@ hook 789 } { - id, err := a.findAuthyId("hook") + id, err := a.findAuthyID("hook") if err != nil { t.Fatalf("findId failed %v", err) } diff --git a/sshpiperd/challenger/authy/handler.go b/sshpiperd/challenger/authy/handler.go index aaf0c386..17f4b7bb 100644 --- a/sshpiperd/challenger/authy/handler.go +++ b/sshpiperd/challenger/authy/handler.go @@ -15,7 +15,7 @@ type authyClient struct { Config struct { APIKey string `long:"challenger-authy-apikey" description:"Authy API Key" env:"SSHPIPERD_CHALLENGER_AUTHY_APIKEY" ini-name:"challenger-authy-apikey"` Method string `long:"challenger-authy-method" default:"token" description:"Authy authentication method" env:"SSHPIPERD_CHALLENGER_AUTHY_METHOD" ini-name:"challenger-authy-method" choice:"token" choice:"onetouch"` - File string `long:"challenger-authy-idfile" description:"Path to a file with ssh_name [space] authy_id per line (first line win if duplicate)" env:"SSHPIPERD_CHALLENGER_AUTHY_IDFILE" ini-name:"challenger-authy-idfile"` + File string `long:"challenger-authy-idfile" description:"Path to a file with ssh_name [space] authy_id per line (first line win if duplicate)" env:"SSHPIPERD_CHALLENGER_AUTHY_IDFILE" ini-name:"challenger-authy-idfile"` } authyAPI *authy.Authy @@ -32,7 +32,7 @@ func (a *authyClient) Init(logger *log.Logger) error { func (a *authyClient) challenge(conn ssh.ConnMetadata, client ssh.KeyboardInteractiveChallenge) (ssh.AdditionalChallengeContext, error) { user := conn.User() - authyId, err := a.findAuthyId(user) + authyID, err := a.findAuthyID(user) if err != nil { return nil, err @@ -46,7 +46,7 @@ func (a *authyClient) challenge(conn ssh.ConnMetadata, client ssh.KeyboardIntera return nil, err } - verification, err := a.authyAPI.VerifyToken(authyId, ans[0], url.Values{}) + verification, err := a.authyAPI.VerifyToken(authyID, ans[0], url.Values{}) if err != nil { return nil, err } @@ -67,7 +67,7 @@ func (a *authyClient) challenge(conn ssh.ConnMetadata, client ssh.KeyboardIntera "ClientIP": conn.RemoteAddr().String(), } - approvalRequest, err := a.authyAPI.SendApprovalRequest(authyId, "Log to SSH server", details, url.Values{}) + approvalRequest, err := a.authyAPI.SendApprovalRequest(authyID, "Log to SSH server", details, url.Values{}) if err != nil { return nil, err } @@ -92,5 +92,3 @@ func (a *authyClient) challenge(conn ssh.ConnMetadata, client ssh.KeyboardIntera return nil, fmt.Errorf("unsupported authy method") } } - -