-
Notifications
You must be signed in to change notification settings - Fork 166
Document analytics methods in end-to-end sign-in flow #10736
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
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 |
|---|---|---|
|
|
@@ -3639,20 +3639,22 @@ def logout_initiated( | |
| # @param [Boolean] success Whether authentication was successful | ||
| # @param [Hash] errors Authentication error reasons, if unsuccessful | ||
| # @param [Hash] error_details Details for error that occurred in unsuccessful submission | ||
| # @param [String] context | ||
| # @param [Boolean] new_device | ||
| # @param [String] multi_factor_auth_method | ||
| # @param ["authentication","reauthentication","confirmation"] context User session context | ||
| # @param [Boolean] new_device Whether the user is authenticating from a new device | ||
| # @param [String] multi_factor_auth_method Authentication method used | ||
| # @param [DateTime] multi_factor_auth_method_created_at time auth method was created | ||
| # @param [Integer] auth_app_configuration_id | ||
| # @param [Integer] piv_cac_configuration_id | ||
| # @param [Integer] key_id | ||
| # @param [Integer] webauthn_configuration_id | ||
| # @param [Integer] phone_configuration_id | ||
| # @param [Boolean] confirmation_for_add_phone | ||
| # @param [String] area_code | ||
| # @param [String] country_code | ||
| # @param [Integer] auth_app_configuration_id Database ID of authentication app configuration | ||
| # @param [Integer] piv_cac_configuration_id Database ID of PIV/CAC configuration | ||
| # @param [Integer] key_id PIV/CAC key_id | ||
| # @param [Integer] webauthn_configuration_id Database ID of WebAuthn configuration | ||
| # @param [Integer] phone_configuration_id Database ID of phone configuration | ||
| # @param [Boolean] confirmation_for_add_phone Whether authenticating while adding phone | ||
| # @param [String] area_code Area code of phone number | ||
| # @param [String] country_code Country code associated with phone number | ||
| # @param [String] phone_fingerprint the hmac fingerprint of the phone number formatted as e164 | ||
| # @param [String] frontend_error Name of error that occurred in frontend during submission | ||
| # @param [Boolean] in_account_creation_flow Whether user is going through account creation flow | ||
| # @param [Integer] enabled_mfa_methods_count Number of MFAs associated with user | ||
| # Multi-Factor Authentication | ||
| def multi_factor_auth( | ||
| success:, | ||
|
|
@@ -3673,6 +3675,8 @@ def multi_factor_auth( | |
| country_code: nil, | ||
| phone_fingerprint: nil, | ||
| frontend_error: nil, | ||
| in_account_creation_flow: nil, | ||
| enabled_mfa_methods_count: nil, | ||
| **extra | ||
| ) | ||
| track_event( | ||
|
|
@@ -3696,6 +3700,8 @@ def multi_factor_auth( | |
| country_code: country_code, | ||
| phone_fingerprint: phone_fingerprint, | ||
| frontend_error:, | ||
| in_account_creation_flow:, | ||
| enabled_mfa_methods_count:, | ||
| **extra, | ||
| }.compact, | ||
| ) | ||
|
|
@@ -3764,24 +3770,39 @@ def multi_factor_auth_enter_backup_code_visit(context:, **extra) | |
| ) | ||
| end | ||
|
|
||
| # @param [String] context | ||
| # @param ["authentication","reauthentication","confirmation"] context User session context | ||
| # @param [String] multi_factor_auth_method | ||
| # @param [Boolean] confirmation_for_add_phone | ||
| # @param [Integer] phone_configuration_id | ||
| # @param [String] area_code Area code of phone number | ||
| # @param [String] country_code Abbreviated 2-letter country code associated with phone number | ||
| # @param [String] phone_fingerprint Fingerprint hash of phone number | ||
| # @param [Boolean] in_account_creation_flow Whether user is going through account creation flow | ||
| # @param [Integer] enabled_mfa_methods_count Number of MFAs associated with user | ||
| # Multi-Factor Authentication enter OTP visited | ||
| def multi_factor_auth_enter_otp_visit( | ||
| context:, | ||
| multi_factor_auth_method:, | ||
| confirmation_for_add_phone:, | ||
| phone_configuration_id:, | ||
| area_code:, | ||
| country_code:, | ||
| phone_fingerprint:, | ||
| in_account_creation_flow:, | ||
| enabled_mfa_methods_count:, | ||
| **extra | ||
| ) | ||
| track_event( | ||
| 'Multi-Factor Authentication: enter OTP visited', | ||
| context: context, | ||
| multi_factor_auth_method: multi_factor_auth_method, | ||
| confirmation_for_add_phone: confirmation_for_add_phone, | ||
| phone_configuration_id: phone_configuration_id, | ||
| context:, | ||
| multi_factor_auth_method:, | ||
| confirmation_for_add_phone:, | ||
| phone_configuration_id:, | ||
| area_code:, | ||
| country_code:, | ||
| phone_fingerprint:, | ||
| in_account_creation_flow:, | ||
| enabled_mfa_methods_count:, | ||
| **extra, | ||
| ) | ||
| end | ||
|
|
@@ -4059,17 +4080,23 @@ def oidc_logout_visited( | |
| end | ||
|
|
||
| # Tracks when a sucessful openid authorization request is returned | ||
| # @param [Boolean] success Whether form validations were succcessful | ||
| # @param [Boolean] user_sp_authorized Whether user granted consent during this authorization | ||
| # @param [String] client_id | ||
| # @param [String] code_digest hash of returned "code" param | ||
| def openid_connect_authorization_handoff( | ||
| success:, | ||
| user_sp_authorized:, | ||
| client_id:, | ||
| code_digest:, | ||
| **extra | ||
| ) | ||
| track_event( | ||
| 'OpenID Connect: authorization request handoff', | ||
| client_id: client_id, | ||
| code_digest: code_digest, | ||
| success:, | ||
| user_sp_authorized:, | ||
| client_id:, | ||
| code_digest:, | ||
| **extra, | ||
| ) | ||
| end | ||
|
|
@@ -4161,29 +4188,32 @@ def openid_connect_token(client_id:, user_id:, code_digest:, expires_in:, ial:, | |
| end | ||
|
|
||
| # Tracks when user makes an otp delivery selection | ||
| # @param [Boolean] success Whether the form was submitted successfully. | ||
| # @param [Hash] errors Errors resulting from form validation | ||
| # @param ["authentication","reauthentication","confirmation"] context User session context | ||
| # @param [String] otp_delivery_preference (sms or voice) | ||
| # @param [Boolean] resend | ||
| # @param [String] country_code | ||
| # @param [String] area_code | ||
| # @param ["authentication","reauthentication","confirmation"] context user session context | ||
| # @param [Hash] pii_like_keypaths | ||
| # @param [Boolean] resend True if the user re-requested a code | ||
| # @param [String] country_code Country code associated with phone number | ||
| # @param [String] area_code Area code of phone number | ||
| def otp_delivery_selection( | ||
| success:, | ||
| errors:, | ||
| context:, | ||
| otp_delivery_preference:, | ||
| resend:, | ||
| country_code:, | ||
| area_code:, | ||
| context:, | ||
| pii_like_keypaths:, | ||
| **extra | ||
| ) | ||
| track_event( | ||
| 'OTP: Delivery Selection', | ||
| otp_delivery_preference: otp_delivery_preference, | ||
| resend: resend, | ||
| country_code: country_code, | ||
| area_code: area_code, | ||
| context: context, | ||
| pii_like_keypaths: pii_like_keypaths, | ||
| success:, | ||
| errors:, | ||
| context:, | ||
| otp_delivery_preference:, | ||
| resend:, | ||
| country_code:, | ||
| area_code:, | ||
| **extra, | ||
| ) | ||
| end | ||
|
|
@@ -5182,14 +5212,15 @@ def user_registration_2fa_setup_visit( | |
| end | ||
|
|
||
| # User registration has been handed off to agency page | ||
| # @param [Boolean] ial2 | ||
| # @param [Integer] ialmax | ||
| # @param [String] service_provider_name | ||
| # @param [String] page_occurence | ||
| # @param [String] needs_completion_screen_reason | ||
| # @param [Boolean] ial2 Whether the user registration was for a verified identity | ||
| # @param [Integer] ialmax Whether the user registration was for an IALMax request | ||
| # @param [String] service_provider_name The friendly name of the service provider | ||
| # @param ['account-page','agency-page'] page_occurence Where the user concluded registration | ||
| # @param ['new_sp','new_attributes','reverified_after_consent'] needs_completion_screen_reason The | ||
| # reason for the consent screen being shown | ||
| # @param [Boolean] in_account_creation_flow Whether user is going through account creation | ||
| # @param [Array] sp_request_requested_attributes | ||
| # @param [Array] sp_session_requested_attributes | ||
| # @param [Array] sp_request_requested_attributes Attributes requested by the service provider | ||
| # @param [Array] sp_session_requested_attributes Attributes requested by the service provider | ||
|
Comment on lines
+5222
to
+5223
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. can we describe what the difference is between these two? I'm guessing one is per-request and the other is something else?
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. I looked into this a bit, and... I think they're effectively the same? I'll double-check though. And if they are the same, maybe I'll follow-up or create a ticket to remove one or the other.
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. I'm not seeing anything in the logs for the
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. I think the issue is that value reads from I can't imagine that |
||
| def user_registration_agency_handoff_page_visit( | ||
| ial2:, | ||
| service_provider_name:, | ||
|
|
@@ -5226,18 +5257,21 @@ def user_registration_cancellation(request_came_from:, **extra) | |
| end | ||
|
|
||
| # Tracks when user completes registration | ||
| # @param [Boolean] ial2 | ||
| # @param [Boolean] ialmax | ||
| # @param [String] service_provider_name | ||
| # @param [String] page_occurence | ||
| # @param [String] needs_completion_screen_reason | ||
| # @param [Array] sp_request_requested_attributes | ||
| # @param [Array] sp_session_requested_attributes | ||
| # @param [Boolean] ial2 Whether the user registration was for a verified identity | ||
| # @param [Boolean] ialmax Whether the user registration was for an IALMax request | ||
| # @param [String] service_provider_name The friendly name of the service provider | ||
| # @param ['account-page','agency-page'] page_occurence Where the user concluded registration | ||
| # @param ['new_sp','new_attributes','reverified_after_consent'] needs_completion_screen_reason The | ||
| # reason for the consent screen being shown | ||
| # @param [Array] sp_request_requested_attributes Attributes requested by the service provider | ||
| # @param [Array] sp_session_requested_attributes Attributes requested by the service provider | ||
|
Comment on lines
+5266
to
+5267
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. ditto about differentiation |
||
| # @param [Boolean] in_account_creation_flow Whether user is going through account creation flow | ||
| # @param [String, nil] disposable_email_domain Disposable email domain used for registration | ||
| def user_registration_complete( | ||
| ial2:, | ||
| service_provider_name:, | ||
| page_occurence:, | ||
| in_account_creation_flow:, | ||
| needs_completion_screen_reason:, | ||
| sp_session_requested_attributes:, | ||
| sp_request_requested_attributes: nil, | ||
|
|
@@ -5247,14 +5281,15 @@ def user_registration_complete( | |
| ) | ||
| track_event( | ||
| 'User registration: complete', | ||
| ial2: ial2, | ||
| ialmax: ialmax, | ||
| service_provider_name: service_provider_name, | ||
| page_occurence: page_occurence, | ||
| needs_completion_screen_reason: needs_completion_screen_reason, | ||
| sp_request_requested_attributes: sp_request_requested_attributes, | ||
| sp_session_requested_attributes: sp_session_requested_attributes, | ||
| disposable_email_domain: disposable_email_domain, | ||
| ial2:, | ||
| ialmax:, | ||
| service_provider_name:, | ||
| page_occurence:, | ||
| in_account_creation_flow:, | ||
| needs_completion_screen_reason:, | ||
| sp_request_requested_attributes:, | ||
| sp_session_requested_attributes:, | ||
| disposable_email_domain:, | ||
| **extra, | ||
| ) | ||
| end | ||
|
|
||
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.
it doesn't matter but I notice we are using double quotes for other string values, single quotes here
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.
Ah I think I saw another method where we used single quotes which is why I used them here, so we're clearly a big mess of inconsistency 🙃
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.
If you're referring to lines like:
Those were copied from other methods, hence the internal inconsistency.
I may follow-up to do a bulk normalization, though I feel like it's inevitable we'll regress to having some inconsistency, unless we care to enforce it somehow.
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.
I took a look at rubocop-yard but unfortunately, it doesn't appear to handle string literals at all. Either way, a task for another time