added length check for api name
parent
9a8530dbfd
commit
ea36bcf963
|
@ -0,0 +1,7 @@
|
||||||
|
git add *
|
||||||
|
|
||||||
|
read -p "Commit message: " commit_message
|
||||||
|
|
||||||
|
git commit -m "$commit_message"
|
||||||
|
|
||||||
|
git push -u origin main
|
|
@ -17,6 +17,8 @@ const (
|
||||||
MaxEquipmentDocumentationTitleLength = "60"
|
MaxEquipmentDocumentationTitleLength = "60"
|
||||||
MaxEquipmentDocumentationNoteLength = 2000
|
MaxEquipmentDocumentationNoteLength = 2000
|
||||||
MaxNoficationTitleLength = "255"
|
MaxNoficationTitleLength = "255"
|
||||||
|
MinUserApiKeyNameLength = 2
|
||||||
|
MaxUserApiKeyNameLength = 30
|
||||||
|
|
||||||
LenHeaderXAuthorization = 36
|
LenHeaderXAuthorization = 36
|
||||||
lenHeaderXAuthorization = "36"
|
lenHeaderXAuthorization = "36"
|
||||||
|
|
|
@ -993,6 +993,10 @@ func GetUserApiKeys(userId string) []structs.UserApiKey {
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateNewUserApiKey(userId string, apiName string) {
|
func CreateNewUserApiKey(userId string, apiName string) {
|
||||||
|
if len(apiName) < utils.MinUserApiKeyNameLength || len(apiName) > utils.MaxUserApiKeyNameLength {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
token, err := rsutils.GenerateSession()
|
token, err := rsutils.GenerateSession()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue