.github
alerting
client
config
controller
core
docs
example
jsonpath
k8s
k8stest
metric
pattern
security
handler.go
handler_test.go
security.go
security_test.go
sha512.go
sha512_test.go
storage
util
vendor
watchdog
web
.dockerignore
.gitattributes
.gitignore
Dockerfile
LICENSE.md
Makefile
README.md
config.yaml
go.mod
go.sum
main.go
24 lines
504 B
Go
24 lines
504 B
Go
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")
|
|
}
|
|
}
|