Start working on #8: Support basic authentication for the dashboard

This commit is contained in:
TwinProduction committed 2020-10-14 19:22:58 -04:00
1 parent 70c9c4b87c
commit 9220a777bb
4 files changed
+117 -4

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
package security
import "testing"
func TestBasicConfig_IsValid(t *testing.T) {
basicConfig := &BasicConfig{
Username: "admin",
PasswordSha512Hash: Sha512("test"),
}
if !basicConfig.IsValid() {
t.Error("basicConfig should've been valid")
}
}
func TestBasicConfig_IsValidWhenPasswordIsInvalid(t *testing.T) {
basicConfig := &BasicConfig{
Username: "admin",
PasswordSha512Hash: "",
}
if basicConfig.IsValid() {
t.Error("basicConfig shouldn't have been valid")
}
}