mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #83546 from Asalle/fix-golint-passwordfile
Fix golint in staging/src/k8s.io/apiserver/plugin/pkg/authenticator/password/passwordfile
This commit is contained in:
commit
7c1dfd1b83
@ -380,7 +380,6 @@ staging/src/k8s.io/apiserver/pkg/util/proxy
|
|||||||
staging/src/k8s.io/apiserver/pkg/util/webhook
|
staging/src/k8s.io/apiserver/pkg/util/webhook
|
||||||
staging/src/k8s.io/apiserver/pkg/util/wsstream
|
staging/src/k8s.io/apiserver/pkg/util/wsstream
|
||||||
staging/src/k8s.io/apiserver/plugin/pkg/audit/log
|
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/oidc
|
||||||
staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/tokentest
|
staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/tokentest
|
||||||
staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook
|
staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook
|
||||||
|
@ -31,6 +31,7 @@ import (
|
|||||||
"k8s.io/apiserver/pkg/authentication/user"
|
"k8s.io/apiserver/pkg/authentication/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// PasswordAuthenticator authenticates users by password
|
||||||
type PasswordAuthenticator struct {
|
type PasswordAuthenticator struct {
|
||||||
users map[string]*userPasswordInfo
|
users map[string]*userPasswordInfo
|
||||||
}
|
}
|
||||||
@ -81,6 +82,7 @@ func NewCSV(path string) (*PasswordAuthenticator, error) {
|
|||||||
return &PasswordAuthenticator{users}, nil
|
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) {
|
func (a *PasswordAuthenticator) AuthenticatePassword(ctx context.Context, username, password string) (*authenticator.Response, bool, error) {
|
||||||
user, ok := a.users[username]
|
user, ok := a.users[username]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user