Skip to content

Commit

Permalink
feat: put 30 seconds as default client time out
Browse files Browse the repository at this point in the history
  • Loading branch information
gitahernandez committed Feb 27, 2024
1 parent cc75ea8 commit 6a83871
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/utils/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type UserInputValidaton struct {
ClientId string `validate:"required,min=36,max=36"`
ClientSecret string `validate:"required,min=36,max=64"`
ApiUrl string `validate:"required,http_url"`
ClientTimeOutinSeconds int `validate:"gte=1,lte=301"`
ClientTimeOutinSeconds int `validate:"gte=1,lte=300"`
Separator string `validate:"required,min=1,max=1"`
VerifyCa bool `validate:"required"`
}
Expand All @@ -26,6 +26,10 @@ var validate *validator.Validate
// ValidateInputs is responsible for validating end-user inputs.
func ValidateInputs(clientId string, clientSecret string, apiUrl string, clientTimeOutinSeconds int, separator *string, verifyCa bool, logger logging.Logger, certificate string, certificate_key string) error {

if clientTimeOutinSeconds == 0 {
clientTimeOutinSeconds = 30
}

validate = validator.New(validator.WithRequiredStructEnabled())

userInput := &UserInputValidaton{
Expand Down

0 comments on commit 6a83871

Please sign in to comment.