frp/vendor/github.com/armon/go-socks5/credentials.go

18 lines
403 B
Go
Raw Normal View History

2017-07-01 10:09:09 +02:00
package socks5
// CredentialStore is used to support user/pass authentication
type CredentialStore interface {
Valid(user, password string) bool
}
// StaticCredentials enables using a map directly as a credential store
type StaticCredentials map[string]string
func (s StaticCredentials) Valid(user, password string) bool {
pass, ok := s[user]
if !ok {
return false
}
return password == pass
}