mirror of
https://github.com/rclone/rclone.git
synced 2025-08-10 06:07:46 +02:00
lib/http: Factor password hash salt into options with default
This commit is contained in:
committed by
Nick Craig-Wood
parent
b1cb41f8da
commit
023e32de05
@ -85,9 +85,9 @@ func HtPasswdAuth(path, realm string) httplib.Middleware {
|
||||
}
|
||||
|
||||
// SingleAuth instantiates middleware that authenticates for a single user
|
||||
func SingleAuth(user, pass, realm string) httplib.Middleware {
|
||||
func SingleAuth(user, pass, realm, salt string) httplib.Middleware {
|
||||
fs.Infof(nil, "Using --user %s --pass XXXX as authenticated user", user)
|
||||
pass = string(auth.MD5Crypt([]byte(pass), []byte("dlPL2MqE"), []byte("$1$")))
|
||||
pass = string(auth.MD5Crypt([]byte(pass), []byte(salt), []byte("$1$")))
|
||||
secretProvider := func(u, r string) string {
|
||||
if user == u {
|
||||
return pass
|
||||
|
Reference in New Issue
Block a user