Skip to content

Add tracking for Email Verification

Alex Buijs requested to merge add-snowplow-tracking-for-email-verification into master

What does this MR do and why?

This adds backend Snowplow tracking for email verification, part of barriers to entry.

The following events are tracked:

  1. an invalid code is entered
    se_category: "IdentityVerification::Email",
    se_action: "failed_attempt",
    se_property: "invalid",
  2. the code entered has expired
    se_category: "IdentityVerification::Email",
    se_action: "failed_attempt",
    se_property: "expired",
  3. the attempt was rate limited
    se_category: "IdentityVerification::Email",
    se_action: "failed_attempt",
    se_property: "rate_limited",
  4. a new code has been sent
    se_category: "IdentityVerification::Email",
    se_action: "sent_instructions",
  5. the attempt was successful
    se_category: "IdentityVerification::Email",
    se_action: "success",

Issue: https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/123

How to set up and validate locally

  1. Install Snowplow micro
    gdk config set snowplow_micro.enabled true
    gdk reconfigure
  2. In rails console enable identity verification
    Feature.enable(:identity_verification)
    ApplicationSetting.first.update(require_admin_approval_after_user_signup: false)
    ApplicationSetting.first.update(send_user_confirmation_email: true)
  3. Visit http://localhost:3000, logout and create a new user
  4. Visit http://localhost:3000/rails/letter_opener and copy the code from the email
  5. Fill in the code on the code verification page
  6. Visit http://localhost:9091/micro/good

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Alex Buijs

Merge request reports