Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Mastodon
Commits
5140f31c
Unverified
Commit
5140f31c
authored
2 weeks ago
by
Claire
Committed by
GitHub
2 weeks ago
Browse files
Options
Downloads
Patches
Plain Diff
Merge commit from fork
parent
b1a584d2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/initializers/rack_attack.rb
+9
-1
9 additions, 1 deletion
config/initializers/rack_attack.rb
with
9 additions
and
1 deletion
config/initializers/rack_attack.rb
+
9
−
1
View file @
5140f31c
...
...
@@ -122,7 +122,7 @@ class Rack::Attack
end
throttle
(
'throttle_email_confirmations/ip'
,
limit:
25
,
period:
5
.
minutes
)
do
|
req
|
req
.
throttleable_remote_ip
if
req
.
post?
&&
(
req
.
path_matches?
(
'/auth/confirmation'
)
||
req
.
path
==
'/api/v1/emails/confirmations'
)
req
.
throttleable_remote_ip
if
(
req
.
post?
&&
(
req
.
path_matches?
(
'/auth/confirmation'
)
||
req
.
path
==
'/api/v1/emails/confirmations'
)
)
||
((
req
.
put?
||
req
.
patch?
)
&&
req
.
path_matches?
(
'/auth/setup'
))
end
throttle
(
'throttle_email_confirmations/email'
,
limit:
5
,
period:
30
.
minutes
)
do
|
req
|
...
...
@@ -133,6 +133,14 @@ class Rack::Attack
end
end
throttle
(
'throttle_auth_setup/email'
,
limit:
5
,
period:
10
.
minutes
)
do
|
req
|
req
.
params
.
dig
(
'user'
,
'email'
).
presence
if
(
req
.
put?
||
req
.
patch?
)
&&
req
.
path_matches?
(
'/auth/setup'
)
end
throttle
(
'throttle_auth_setup/account'
,
limit:
5
,
period:
10
.
minutes
)
do
|
req
|
req
.
warden_user_id
if
(
req
.
put?
||
req
.
patch?
)
&&
req
.
path_matches?
(
'/auth/setup'
)
end
throttle
(
'throttle_login_attempts/ip'
,
limit:
25
,
period:
5
.
minutes
)
do
|
req
|
req
.
throttleable_remote_ip
if
req
.
post?
&&
req
.
path_matches?
(
'/auth/sign_in'
)
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment