mirror of https://github.com/fatedier/frp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
403 B
18 lines
403 B
8 years ago
|
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
|
||
|
}
|