From 49207027c6469068c6fc509b162a43b6ba409a62 Mon Sep 17 00:00:00 2001 From: Asalle Date: Sun, 6 Oct 2019 17:23:18 +0200 Subject: [PATCH] Fix golint errors in staging/src/k8s.io/apiserver/plugin/pkg/authenticator/password --- hack/.golint_failures | 1 - .../pkg/authenticator/password/passwordfile/passwordfile.go | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/.golint_failures b/hack/.golint_failures index d768862ee26..4a7aaff2f3a 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -417,7 +417,6 @@ staging/src/k8s.io/apiserver/pkg/util/proxy staging/src/k8s.io/apiserver/pkg/util/webhook staging/src/k8s.io/apiserver/pkg/util/wsstream staging/src/k8s.io/apiserver/plugin/pkg/audit/log -staging/src/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/tokentest staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook diff --git a/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile/passwordfile.go b/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile/passwordfile.go index be5504bec0e..e17a5eb0de8 100644 --- a/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile/passwordfile.go +++ b/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile/passwordfile.go @@ -31,6 +31,7 @@ import ( "k8s.io/apiserver/pkg/authentication/user" ) +// PasswordAuthenticator authenticates users by password type PasswordAuthenticator struct { users map[string]*userPasswordInfo } @@ -81,6 +82,7 @@ func NewCSV(path string) (*PasswordAuthenticator, error) { return &PasswordAuthenticator{users}, nil } +// AuthenticatePassword returns user info if authentication is successful, nil otherwise func (a *PasswordAuthenticator) AuthenticatePassword(ctx context.Context, username, password string) (*authenticator.Response, bool, error) { user, ok := a.users[username] if !ok {