Added basic auth to data source edit/create, add support for basic auth in data source proxy code, Closes #1510

This commit is contained in:
Torkel Ödegaard
2015-03-02 09:58:35 +01:00
parent ea1164322b
commit 9710771f16
13 changed files with 156 additions and 84 deletions
+6
View File
@@ -5,6 +5,7 @@ import (
"crypto/md5"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"fmt"
"hash"
@@ -74,3 +75,8 @@ func PBKDF2(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte
}
return dk[:keyLen]
}
func GetBasicAuthHeader(user string, password string) string {
var userAndPass = user + ":" + password
return "Basic " + base64.StdEncoding.EncodeToString([]byte(userAndPass))
}