Skip to content

Commit

Permalink
chore: unexport UserPassAuthenticator.Users
Browse files Browse the repository at this point in the history
  • Loading branch information
haruue committed Feb 3, 2025
1 parent e1df8aa commit 7652ddc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extras/auth/userpass.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var _ server.Authenticator = &UserPassAuthenticator{}
// UserPassAuthenticator checks the provided auth string against a map of username/password pairs.
// The format of the auth string must be "username:password".
type UserPassAuthenticator struct {
Users map[string]string
users map[string]string
}

func NewUserPassAuthenticator(users map[string]string) *UserPassAuthenticator {
Expand All @@ -26,15 +26,15 @@ func NewUserPassAuthenticator(users map[string]string) *UserPassAuthenticator {
for user, pass := range users {
lcUsers[strings.ToLower(user)] = pass
}
return &UserPassAuthenticator{Users: lcUsers}
return &UserPassAuthenticator{users: lcUsers}
}

func (a *UserPassAuthenticator) Authenticate(addr net.Addr, auth string, tx uint64) (ok bool, id string) {
u, p, ok := splitUserPass(auth)
if !ok {
return false, ""
}
rp, ok := a.Users[u]
rp, ok := a.users[u]
if !ok || rp != p {
return false, ""
}
Expand Down

0 comments on commit 7652ddc

Please sign in to comment.