-
Notifications
You must be signed in to change notification settings - Fork 166
LG-10170 rename Throttle to RateLimiter #8706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e25a074
c53b60e
3f9eb15
2758c87
556d4b0
98f36ca
52bf730
2af9ed5
0eb095d
f0c3bc3
703cc71
9314d7b
56cb31b
f0490e8
503826b
458bd4b
414f1eb
c40e086
fbdccc0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,8 @@ def index | |
| !gpo_mail.mail_spammed? && | ||
| !gpo_mail.profile_too_old? | ||
|
|
||
| if throttle.throttled? | ||
| render_throttled | ||
| if rate_limiter.limited? | ||
| render_rate_limited | ||
| elsif pii_locked? | ||
| redirect_to capture_password_url | ||
| else | ||
|
|
@@ -34,9 +34,9 @@ def pii | |
| def create | ||
| @gpo_verify_form = build_gpo_verify_form | ||
|
|
||
| throttle.increment! | ||
| if throttle.throttled? | ||
| render_throttled | ||
| rate_limiter.increment! | ||
| if rate_limiter.limited? | ||
| render_rate_limited | ||
| return | ||
| end | ||
|
|
||
|
|
@@ -85,20 +85,20 @@ def prepare_for_personal_key | |
| idv_session.address_confirmed! | ||
| end | ||
|
|
||
| def throttle | ||
| @throttle ||= Throttle.new( | ||
| def rate_limiter | ||
| @rate_limiter ||= RateLimiter.new( | ||
| user: current_user, | ||
| throttle_type: :verify_gpo_key, | ||
| rate_limit_type: :verify_gpo_key, | ||
| ) | ||
| end | ||
|
|
||
| def render_throttled | ||
| def render_rate_limited | ||
| irs_attempts_api_tracker.idv_gpo_verification_rate_limited | ||
| analytics.throttler_rate_limit_triggered( | ||
| throttle_type: :verify_gpo_key, | ||
| ) | ||
|
|
||
| @expires_at = throttle.expires_at | ||
| @expires_at = rate_limiter.expires_at | ||
| render :throttled | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be changed in follow up ticket/PR?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I was avoiding changing anything route-related. Could this be changed by changing just the name of the template file? I still think it should be in a followup PR. |
||
| end | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice to get rid of this 🥳