mirror of
https://github.com/apernet/hysteria.git
synced 2025-04-02 03:57:38 +03:00
chore: unexport UserPassAuthenticator.Users
This commit is contained in:
parent
e1df8aa4e2
commit
7652ddcd99
1 changed files with 3 additions and 3 deletions
|
@ -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 {
|
||||
|
@ -26,7 +26,7 @@ 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) {
|
||||
|
@ -34,7 +34,7 @@ func (a *UserPassAuthenticator) Authenticate(addr net.Addr, auth string, tx uint
|
|||
if !ok {
|
||||
return false, ""
|
||||
}
|
||||
rp, ok := a.Users[u]
|
||||
rp, ok := a.users[u]
|
||||
if !ok || rp != p {
|
||||
return false, ""
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue