29 lines
545 B
Go
29 lines
545 B
Go
package utils
|
|
|
|
const (
|
|
minUsername = "2"
|
|
maxUsername = "20"
|
|
minPassword = "6"
|
|
MinPassword = 6
|
|
maxPassword = "64"
|
|
MaxPassword = 64
|
|
|
|
LenHeaderXAuthorization = 36
|
|
LenUserId = 36
|
|
|
|
HeaderXAuthorization = "X-Authorization"
|
|
)
|
|
|
|
// commands sent to web clients
|
|
const (
|
|
SentInitUserSocketConnection = 1
|
|
SentCmdUpdateConnectedUsers = 2
|
|
)
|
|
|
|
var (
|
|
generalRules = map[string]string{
|
|
"Username": "required,min=" + minUsername + ",max=" + maxUsername,
|
|
"Password": "required", // length is checked later because sent in base64
|
|
}
|
|
)
|