Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
820 changes: 476 additions & 344 deletions app/services/analytics_events.rb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
user_id: user.uuid,
success: true,
errors: {},
error_details: nil,
mfa_method_counts: { backup_codes: 10, webauthn: 2, phone: 2 },
pii_like_keypaths: [[:mfa_method_counts, :phone]],
account_age_in_days: 0,
Expand Down
5 changes: 5 additions & 0 deletions spec/controllers/idv/by_mail/enter_code_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
'IdV: enter verify by mail code submitted',
success: true,
errors: {},
error_details: nil,
pending_in_person_enrollment: false,
fraud_check_failed: false,
enqueued_at: pending_profile.gpo_confirmation_codes.last.code_sent_at,
Expand Down Expand Up @@ -243,6 +244,7 @@
'IdV: enter verify by mail code submitted',
success: true,
errors: {},
error_details: nil,
pending_in_person_enrollment: true,
fraud_check_failed: false,
enqueued_at: pending_profile.gpo_confirmation_codes.last.code_sent_at,
Expand Down Expand Up @@ -271,6 +273,7 @@
'IdV: enter verify by mail code submitted',
success: true,
errors: {},
error_details: nil,
pending_in_person_enrollment: false,
fraud_check_failed: true,
enqueued_at: pending_profile.gpo_confirmation_codes.last.code_sent_at,
Expand Down Expand Up @@ -299,6 +302,7 @@
'IdV: enter verify by mail code submitted',
success: true,
errors: {},
error_details: nil,
pending_in_person_enrollment: false,
fraud_check_failed: true,
enqueued_at: user.pending_profile.gpo_confirmation_codes.last.code_sent_at,
Expand Down Expand Up @@ -332,6 +336,7 @@
'IdV: enter verify by mail code submitted',
success: true,
errors: {},
error_details: nil,
pending_in_person_enrollment: false,
fraud_check_failed: true,
enqueued_at: user.pending_profile.gpo_confirmation_codes.last.code_sent_at,
Expand Down
8 changes: 8 additions & 0 deletions spec/controllers/idv/image_uploads_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@
'IdV: doc auth image upload form submitted',
success: true,
errors: {},
error_details: nil,
user_id: user.uuid,
submit_attempts: 1,
remaining_submit_attempts: IdentityConfig.store.doc_auth_max_attempts - 1,
Expand Down Expand Up @@ -406,6 +407,7 @@
'IdV: doc auth image upload vendor pii validation',
success: true,
errors: {},
error_details: nil,
attention_with_barcode: false,
user_id: user.uuid,
submit_attempts: 1,
Expand Down Expand Up @@ -488,6 +490,7 @@
'IdV: doc auth image upload form submitted',
success: true,
errors: {},
error_details: nil,
user_id: user.uuid,
submit_attempts: 1,
remaining_submit_attempts: IdentityConfig.store.doc_auth_max_attempts - 1,
Expand Down Expand Up @@ -585,6 +588,7 @@
'IdV: doc auth image upload form submitted',
success: true,
errors: {},
error_details: nil,
user_id: user.uuid,
submit_attempts: 1,
remaining_submit_attempts: IdentityConfig.store.doc_auth_max_attempts - 1,
Expand Down Expand Up @@ -682,6 +686,7 @@
'IdV: doc auth image upload form submitted',
success: true,
errors: {},
error_details: nil,
user_id: user.uuid,
submit_attempts: 1,
remaining_submit_attempts: IdentityConfig.store.doc_auth_max_attempts - 1,
Expand Down Expand Up @@ -776,6 +781,7 @@
'IdV: doc auth image upload form submitted',
success: true,
errors: {},
error_details: nil,
user_id: user.uuid,
submit_attempts: 1,
remaining_submit_attempts: IdentityConfig.store.doc_auth_max_attempts - 1,
Expand Down Expand Up @@ -894,6 +900,7 @@
'IdV: doc auth image upload form submitted',
success: true,
errors: {},
error_details: nil,
user_id: user.uuid,
submit_attempts: 1,
remaining_submit_attempts: IdentityConfig.store.doc_auth_max_attempts - 1,
Expand Down Expand Up @@ -984,6 +991,7 @@
'IdV: doc auth image upload form submitted',
success: true,
errors: {},
error_details: nil,
user_id: user.uuid,
submit_attempts: 1,
remaining_submit_attempts: IdentityConfig.store.doc_auth_max_attempts - 1,
Expand Down
1 change: 1 addition & 0 deletions spec/controllers/idv/in_person/state_id_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
{
success: true,
errors: {},
error_details: nil,
analytics_id: 'In Person Proofing',
flow_path: 'standard',
step: 'state_id',
Expand Down
1 change: 1 addition & 0 deletions spec/controllers/idv/otp_verification_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
expected_result = {
success: true,
errors: {},
error_details: nil,
code_expired: false,
code_matches: true,
otp_delivery_preference: :sms,
Expand Down
2 changes: 2 additions & 0 deletions spec/controllers/idv/phone_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@
result = {
success: true,
errors: {},
error_details: nil,
area_code: '703',
country_code: 'US',
carrier: 'Test Mobile Carrier',
Expand Down Expand Up @@ -444,6 +445,7 @@
new_phone_added: true,
hybrid_handoff_phone_used: false,
errors: {},
error_details: nil,
phone_fingerprint: Pii::Fingerprinter.fingerprint(proofing_phone.e164),
country_code: proofing_phone.country,
area_code: proofing_phone.area_code,
Expand Down
16 changes: 15 additions & 1 deletion spec/controllers/openid_connect/authorization_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# rubocop:disable Layout/LineLength
require 'rails_helper'

RSpec.describe OpenidConnect::AuthorizationController, allowed_extra_analytics: [:*] do
RSpec.describe OpenidConnect::AuthorizationController do
include WebAuthnHelper
before do
# All the tests here were written prior to the interstitial
Expand Down Expand Up @@ -133,6 +133,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: true,
user_fully_authenticated: true,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/1',
Expand Down Expand Up @@ -189,6 +190,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: true,
user_fully_authenticated: true,
acr_values: '',
Expand Down Expand Up @@ -386,6 +388,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: false,
user_fully_authenticated: true,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/2',
Expand Down Expand Up @@ -762,6 +765,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: false,
user_fully_authenticated: true,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/0',
Expand Down Expand Up @@ -855,6 +859,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: false,
user_fully_authenticated: true,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/0',
Expand Down Expand Up @@ -951,6 +956,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: false,
user_fully_authenticated: true,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/0',
Expand Down Expand Up @@ -1118,6 +1124,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: true,
user_fully_authenticated: true,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/1',
Expand Down Expand Up @@ -1176,6 +1183,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: true,
user_fully_authenticated: true,
acr_values: '',
Expand Down Expand Up @@ -1374,6 +1382,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: false,
user_fully_authenticated: true,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/2',
Expand Down Expand Up @@ -1752,6 +1761,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: false,
user_fully_authenticated: true,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/0',
Expand Down Expand Up @@ -1845,6 +1855,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: false,
user_fully_authenticated: true,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/0',
Expand Down Expand Up @@ -1941,6 +1952,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: false,
user_fully_authenticated: true,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/0',
Expand Down Expand Up @@ -2490,6 +2502,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: true,
user_fully_authenticated: false,
acr_values: 'http://idmanagement.gov/ns/assurance/ial/1',
Expand Down Expand Up @@ -2623,6 +2636,7 @@
referer: nil,
allow_prompt_login: true,
errors: {},
error_details: nil,
unauthorized_scope: true,
user_fully_authenticated: false,
acr_values: '',
Expand Down
3 changes: 2 additions & 1 deletion spec/controllers/openid_connect/user_info_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

RSpec.describe OpenidConnect::UserInfoController, allowed_extra_analytics: [:*] do
RSpec.describe OpenidConnect::UserInfoController do
let(:json_response) { JSON.parse(response.body).with_indifferent_access }

describe '#show' do
Expand Down Expand Up @@ -133,6 +133,7 @@
client_id: identity.service_provider,
ial: identity.ial,
errors: {},
error_details: nil,
)

action
Expand Down
1 change: 1 addition & 0 deletions spec/controllers/risc/security_events_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
event_type: event_type,
error_code: nil,
errors: {},
error_details: nil,
jti: jti,
success: true,
user_id: user.uuid)
Expand Down
12 changes: 12 additions & 0 deletions spec/controllers/saml_idp_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ def name_id_version(format_urn)
with('SAML Auth', {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_PERSISTENT,
authn_context: [Saml::Idp::Constants::IAL2_AUTHN_CONTEXT_CLASSREF],
authn_context_comparison: 'exact',
Expand Down Expand Up @@ -940,6 +941,7 @@ def name_id_version(format_urn)
with('SAML Auth', {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_PERSISTENT,
authn_context: ['http://idmanagement.gov/ns/assurance/ial/1'],
authn_context_comparison: 'minimum',
Expand Down Expand Up @@ -1515,6 +1517,7 @@ def name_id_version(format_urn)
analytics_hash = {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_PERSISTENT,
authn_context: [
Saml::Idp::Constants::IAL1_AUTHN_CONTEXT_CLASSREF,
Expand Down Expand Up @@ -1644,6 +1647,7 @@ def name_id_version(format_urn)
analytics_hash = {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_PERSISTENT,
authn_context: [Saml::Idp::Constants::DEFAULT_AAL_AUTHN_CONTEXT_CLASSREF],
authn_context_comparison: 'exact',
Expand Down Expand Up @@ -1681,6 +1685,7 @@ def name_id_version(format_urn)
analytics_hash = {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_PERSISTENT,
authn_context: request_authn_contexts,
authn_context_comparison: 'exact',
Expand Down Expand Up @@ -1716,6 +1721,7 @@ def name_id_version(format_urn)
analytics_hash = {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_EMAIL,
authn_context: request_authn_contexts,
authn_context_comparison: 'exact',
Expand Down Expand Up @@ -1793,6 +1799,7 @@ def name_id_version(format_urn)
analytics_hash = {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_PERSISTENT,
authn_context: request_authn_contexts,
authn_context_comparison: 'exact',
Expand Down Expand Up @@ -1825,6 +1832,7 @@ def name_id_version(format_urn)
analytics_hash = {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_EMAIL,
authn_context: request_authn_contexts,
authn_context_comparison: 'exact',
Expand Down Expand Up @@ -1857,6 +1865,7 @@ def name_id_version(format_urn)
analytics_hash = {
success: true,
errors: {},
error_details: nil,
nameid_format: 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified',
authn_context: request_authn_contexts,
authn_context_comparison: 'exact',
Expand Down Expand Up @@ -2341,6 +2350,7 @@ def name_id_version(format_urn)
analytics_hash = {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_PERSISTENT,
authn_context: [
Saml::Idp::Constants::AAL2_AUTHN_CONTEXT_CLASSREF,
Expand Down Expand Up @@ -2396,6 +2406,7 @@ def stub_requested_attributes
analytics_hash = {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_PERSISTENT,
authn_context: request_authn_contexts,
authn_context_comparison: 'exact',
Expand Down Expand Up @@ -2447,6 +2458,7 @@ def stub_requested_attributes
analytics_hash = {
success: true,
errors: {},
error_details: nil,
nameid_format: Saml::Idp::Constants::NAME_ID_FORMAT_PERSISTENT,
authn_context: request_authn_contexts,
authn_context_comparison: 'exact',
Expand Down
Loading