diff --git a/commit_and_push.sh b/commit_and_push.sh new file mode 100755 index 0000000..554786f --- /dev/null +++ b/commit_and_push.sh @@ -0,0 +1,7 @@ +git add * + +read -p "Commit message: " commit_message + +git commit -m "$commit_message" + +git push -u origin main \ No newline at end of file diff --git a/modules/utils/globals.go b/modules/utils/globals.go index 04aedbe..1e52169 100644 --- a/modules/utils/globals.go +++ b/modules/utils/globals.go @@ -17,6 +17,8 @@ const ( MaxEquipmentDocumentationTitleLength = "60" MaxEquipmentDocumentationNoteLength = 2000 MaxNoficationTitleLength = "255" + MinUserApiKeyNameLength = 2 + MaxUserApiKeyNameLength = 30 LenHeaderXAuthorization = 36 lenHeaderXAuthorization = "36" diff --git a/socketclients/socketclients.go b/socketclients/socketclients.go index 9a950a3..6e0e260 100644 --- a/socketclients/socketclients.go +++ b/socketclients/socketclients.go @@ -993,6 +993,10 @@ func GetUserApiKeys(userId string) []structs.UserApiKey { } func CreateNewUserApiKey(userId string, apiName string) { + if len(apiName) < utils.MinUserApiKeyNameLength || len(apiName) > utils.MaxUserApiKeyNameLength { + return + } + token, err := rsutils.GenerateSession() if err != nil {