Skip to content
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

LG-14100 Include identity-verified status in account reset delete event #11236

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

kevinsmaster5
Copy link
Contributor

@kevinsmaster5 kevinsmaster5 commented Sep 13, 2024

🎫 Ticket

Link to the relevant ticket:
LG-14100

🛠 Summary of changes

Add Identity Verified details to 'Account Reset: delete' event.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

Reduce wait time for Account Reset: delete by setting in your local application.yml
account_reset_wait_period_days: 0

  • In a console window run make watch_events
  • With an unverified, verified, pending account go through the process to delete an account by way of the link on the Select your authentication method screen in sign in.
  • When the deletion process completes observe relevant values are posted to the event_properties block.
    identity_verified:
    profile_idv_level: (if applicable)

👀 Screenshots

Screenshot 2024-09-19 at 10 50 19 AM (2)

@kevinsmaster5 kevinsmaster5 force-pushed the kmas-lg-14100-include-identity-verified-reset-delete branch from c74daee to b6d2df6 Compare September 16, 2024 12:10
@kevinsmaster5 kevinsmaster5 marked this pull request as ready for review September 16, 2024 14:14
@kevinsmaster5 kevinsmaster5 requested review from a team September 16, 2024 19:15
def extra_analytics_attributes
{
user_id: user.uuid,
email: user.email_addresses.take&.email,
account_age_in_days: account_age,
account_confirmed_at: user.confirmed_at,
mfa_method_counts: mfa_method_counts,
proofing_components: profile_components,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate to switch it up at this point, but I'm thinking it may be better off to just use (or at least start with using) the Profile#idv_level value (mentioned in Slack). Looking at some real-world logging, proofing components alone can't tell us if the user was proofed with biometric. Conversely, idv_level can't tell us if they proofed with GPO, but I think it's probably more pertinent to the event that we know "legacy" vs. with biometric vs in-person.

Plus, strings are a bit easier to work with than a hash 😅

Suggested change
proofing_components: profile_components,
profile_idv_level: user.active_profile&.idv_level,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That worked great. Thanks also to @matthinz for the suggestion.

@@ -209,6 +217,7 @@
:with_pii,
idv_level: :unsupervised_with_selfie,
user: user,
proofing_components: { document_check: 'mock', document_type: 'biometric' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my previous comment, these aren't really accurate to the proofing components of a biometric proofed profile in the real-world. Maybe we can just revert the proofing_components changes in this file

@kevinsmaster5 kevinsmaster5 requested a review from a team September 19, 2024 17:15
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with the one suggestion!

Comment on lines 152 to 172
it 'logs info about user with a verified by mail account' do
user = create(:user, :proofed_with_gpo)
create_account_reset_request_for(user)
grant_request(user)
session[:granted_token] = AccountResetRequest.first.granted_token

delete :delete

expect(@analytics).to have_logged_event(
'Account Reset: delete',
user_id: user.uuid,
success: true,
errors: {},
mfa_method_counts: { phone: 1 },
profile_idv_level: 'legacy_unsupervised',
identity_verified: true,
account_age_in_days: 0,
account_confirmed_at: user.confirmed_at,
)
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could drop this since we're not expecting anything distinguishable from GPO anymore.

Suggested change
it 'logs info about user with a verified by mail account' do
user = create(:user, :proofed_with_gpo)
create_account_reset_request_for(user)
grant_request(user)
session[:granted_token] = AccountResetRequest.first.granted_token
delete :delete
expect(@analytics).to have_logged_event(
'Account Reset: delete',
user_id: user.uuid,
success: true,
errors: {},
mfa_method_counts: { phone: 1 },
profile_idv_level: 'legacy_unsupervised',
identity_verified: true,
account_age_in_days: 0,
account_confirmed_at: user.confirmed_at,
)
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants