mirror of
https://github.com/grafana/grafana.git
synced 2025-01-07 14:43:42 -06:00
test: adds tests for password encodiing
This commit is contained in:
parent
5b38c230db
commit
d4e8e22fda
@ -7,7 +7,6 @@ import (
|
||||
)
|
||||
|
||||
func TestEncoding(t *testing.T) {
|
||||
|
||||
Convey("When generating base64 header", t, func() {
|
||||
result := GetBasicAuthHeader("grafana", "1234")
|
||||
|
||||
@ -23,4 +22,8 @@ func TestEncoding(t *testing.T) {
|
||||
So(password, ShouldEqual, "1234")
|
||||
})
|
||||
|
||||
Convey("When encoding password", t, func() {
|
||||
encodedPassword := EncodePassword("iamgod", "pepper")
|
||||
So(encodedPassword, ShouldEqual, "e59c568621e57756495a468f47c74e07c911b037084dd464bb2ed72410970dc849cabd71b48c394faf08a5405dae53741ce9")
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user