Auth: Enhance password validation.
Increase minimum length to 20.
Check for digits, lower/upper case and special characters.
Change-Id: I7837780716487843f01ed2af97fcf30505d27ef7
diff --git a/core/auth/ui/api_test.go b/core/auth/ui/api_test.go
new file mode 100644
index 0000000..90e64be
--- /dev/null
+++ b/core/auth/ui/api_test.go
@@ -0,0 +1,19 @@
+package main
+
+import (
+ "testing"
+)
+
+func TestPasswordInvalid(t *testing.T) {
+ errs := validatePassword("foobar")
+ if len(errs) != 2 {
+ t.Fatal(errs)
+ }
+}
+
+func TestPasswordValid(t *testing.T) {
+ errs := validatePassword("foBa2r-gdkjS1-SA0120")
+ if len(errs) != 0 {
+ t.Fatal(errs)
+ }
+}