Auth: You can now authenicate against api with username / password using basic auth, Closes #2218

This commit is contained in:
Torkel Ödegaard
2015-06-30 09:37:52 +02:00
parent d0e7d53c69
commit ae0f8c77d1
8 changed files with 126 additions and 0 deletions

View File

@ -13,4 +13,14 @@ func TestEncoding(t *testing.T) {
So(result, ShouldEqual, "Basic Z3JhZmFuYToxMjM0")
})
Convey("When decoding basic auth header", t, func() {
header := GetBasicAuthHeader("grafana", "1234")
username, password, err := DecodeBasicAuthHeader(header)
So(err, ShouldBeNil)
So(username, ShouldEqual, "grafana")
So(password, ShouldEqual, "1234")
})
}