admin-dashboard-backend/modules/utils/globals.go

46 lines
1.1 KiB
Go

package utils
const (
minUsername = "2"
maxUsername = "20"
minPassword = "6"
MinPassword = 6
maxPassword = "64"
MaxPassword = 64
LenHeaderXAuthorization = 36
lenHeaderXAuthorization = "36"
LenUserId = 36
HeaderXAuthorization = "X-Authorization"
)
// commands sent to web clients
const (
SentCmdInitUserSocketConnection = 1
SentCmdUpdateConnectedUsers = 2
SentCmdNewGroupTaskStarted = 3
SentCmdNewGroupTaskStep = 4
SentCmdUpdateGroupTaskStep = 5
SentCmdUpdateGroupTask = 6
SentCmdReloadingGroupTasks = 7
SendCmdGroupTasksReloaded = 8
SendCmdUpdateUserSessions = 9
)
// commands received from web clients
const (
ReceivedCmdStartGroupTasks = 1
ReceivedCmdTaskFailedTryAgainRunTaskStep = 2
ReceivedCmdTaskContinueTaskStep = 3
ReceivedCmdReloadGroupTasks = 4
)
var (
generalRules = map[string]string{
"Username": "required,min=" + minUsername + ",max=" + maxUsername,
"Password": "required", // length is checked later because sent in base64
"SessionId": "required,len" + lenHeaderXAuthorization,
}
)