Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cea36b26
Commit
cea36b26
authored
Sep 14, 2021
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DRY up throttle settings validations
parent
a8c5790d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
79 deletions
+22
-79
app/models/application_setting.rb
app/models/application_setting.rb
+22
-79
No files found.
app/models/application_setting.rb
View file @
cea36b26
...
...
@@ -468,85 +468,28 @@ class ApplicationSetting < ApplicationRecord
length:
{
maximum:
255
,
message:
_
(
'is too long (maximum is %{count} characters)'
)
},
allow_blank:
true
validates
:throttle_unauthenticated_api_requests_per_period
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_unauthenticated_api_period_in_seconds
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_unauthenticated_requests_per_period
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_unauthenticated_period_in_seconds
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_unauthenticated_packages_api_requests_per_period
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_unauthenticated_packages_api_period_in_seconds
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_unauthenticated_files_api_requests_per_period
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_unauthenticated_files_api_period_in_seconds
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_authenticated_api_requests_per_period
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_authenticated_api_period_in_seconds
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_authenticated_git_lfs_requests_per_period
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_authenticated_git_lfs_period_in_seconds
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_authenticated_web_requests_per_period
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_authenticated_web_period_in_seconds
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_authenticated_packages_api_requests_per_period
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_authenticated_packages_api_period_in_seconds
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_authenticated_files_api_requests_per_period
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_authenticated_files_api_period_in_seconds
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_protected_paths_requests_per_period
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
validates
:throttle_protected_paths_period_in_seconds
,
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
}
with_options
(
presence:
true
,
numericality:
{
only_integer:
true
,
greater_than:
0
})
do
validates
:throttle_unauthenticated_api_requests_per_period
validates
:throttle_unauthenticated_api_period_in_seconds
validates
:throttle_unauthenticated_requests_per_period
validates
:throttle_unauthenticated_period_in_seconds
validates
:throttle_unauthenticated_packages_api_requests_per_period
validates
:throttle_unauthenticated_packages_api_period_in_seconds
validates
:throttle_unauthenticated_files_api_requests_per_period
validates
:throttle_unauthenticated_files_api_period_in_seconds
validates
:throttle_authenticated_api_requests_per_period
validates
:throttle_authenticated_api_period_in_seconds
validates
:throttle_authenticated_git_lfs_requests_per_period
validates
:throttle_authenticated_git_lfs_period_in_seconds
validates
:throttle_authenticated_web_requests_per_period
validates
:throttle_authenticated_web_period_in_seconds
validates
:throttle_authenticated_packages_api_requests_per_period
validates
:throttle_authenticated_packages_api_period_in_seconds
validates
:throttle_authenticated_files_api_requests_per_period
validates
:throttle_authenticated_files_api_period_in_seconds
validates
:throttle_protected_paths_requests_per_period
validates
:throttle_protected_paths_period_in_seconds
end
validates
:notes_create_limit
,
numericality:
{
only_integer:
true
,
greater_than_or_equal_to:
0
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment