1package socks5
2
3// CredentialStore is used to support user/pass authentication
4type CredentialStore interface {
5	Valid(user, password string) bool
6}
7
8// StaticCredentials enables using a map directly as a credential store
9type StaticCredentials map[string]string
10
11func (s StaticCredentials) Valid(user, password string) bool {
12	pass, ok := s[user]
13	if !ok {
14		return false
15	}
16	return password == pass
17}
18