-
Notifications
You must be signed in to change notification settings - Fork 166
Add a VerifyByMailConcern to the IdP
#10880
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3cd250d
Add a `VerifyByMailConcern` to the IdP
jmhooper 1176544
typo
jmhooper 2d18a54
one more inclusion
jmhooper f6fadc3
introduce memoization to stop re-computing things
jmhooper b281d9c
fix a quick whoops
jmhooper 6d444ca
some progress on failing tests
jmhooper 4eb89ed
just a few more tests
jmhooper bbe0455
cleanup concern implementation
jmhooper 8f56e26
I am not good at copying and pasting
jmhooper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module Idv | ||
| module VerifyByMailConcern | ||
| def gpo_verify_by_mail_policy | ||
| @gpo_verify_by_mail_policy ||= Idv::GpoVerifyByMailPolicy.new(current_user) | ||
| end | ||
|
|
||
| def log_letter_requested_analytics(resend:) | ||
| analytics.idv_gpo_address_letter_requested( | ||
| resend: resend, | ||
| first_letter_requested_at: first_letter_requested_at, | ||
| hours_since_first_letter: hours_since_first_letter, | ||
| phone_step_attempts: phone_step_attempt_count, | ||
| **ab_test_analytics_buckets, | ||
| ) | ||
| end | ||
|
|
||
| def log_letter_enqueued_analytics(resend:) | ||
| analytics.idv_gpo_address_letter_enqueued( | ||
| enqueued_at: Time.zone.now, | ||
| resend: resend, | ||
| phone_step_attempts: phone_step_attempt_count, | ||
| first_letter_requested_at: first_letter_requested_at, | ||
| hours_since_first_letter: hours_since_first_letter, | ||
| **ab_test_analytics_buckets, | ||
| ) | ||
| end | ||
|
|
||
| def phone_step_attempt_count | ||
| @phone_step_attempt_count ||= RateLimiter.new( | ||
| user: current_user, | ||
| rate_limit_type: :proof_address, | ||
| ).attempts | ||
| end | ||
|
|
||
| def first_letter_requested_at | ||
| current_user.gpo_verification_pending_profile&.gpo_verification_pending_at | ||
| end | ||
|
|
||
| def hours_since_first_letter | ||
| if first_letter_requested_at.present? | ||
| (Time.zone.now - first_letter_requested_at).to_i.seconds.in_hours.to_i | ||
| else | ||
| 0 | ||
| end | ||
| end | ||
| end | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.