fix(api): relax account password validation
This commit is contained in:
@@ -32,3 +32,19 @@ func TestInitPlatformAccessSeedsRootRole(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPlatformRootPassword(t *testing.T) {
|
||||
t.Run("accepts six character environment password", func(t *testing.T) {
|
||||
t.Setenv("HEQI_PLATFORM_ROOT_PASSWORD", "123456")
|
||||
if got := platformRootPassword(); got != "123456" {
|
||||
t.Fatalf("platformRootPassword() = %q, want environment password", got)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("falls back when environment password is too short", func(t *testing.T) {
|
||||
t.Setenv("HEQI_PLATFORM_ROOT_PASSWORD", "12345")
|
||||
if got := platformRootPassword(); got != PlatformRootPassword {
|
||||
t.Fatalf("platformRootPassword() = %q, want default password", got)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user