syntax = "proto3";

package user_multi_factor_auth;

option go_package = "user_multi_factor_auth";

import "eventbus/change.proto";
import "eventbus/owner.proto";

// UserMultiFactorAuthUpdate is triggered when a user adds MFA to their account.
message UserMultiFactorAuthUpdate {
  option (eventbus.owner.ldap_group) = "team-identity";
  string user_id = 1;
  eventbus.change.BoolChange any_enabled = 2;
  Authy authy = 3;
}

// The Authy 2FA Platform.
message Authy {
  StatusChange status = 1;
}

// The status of 2FA registration.
enum Status {
  STATUS_INVALID = 0;
  STATUS_DISABLED = 1;
  STATUS_ENABLED = 2;
}

// An object representing the state change for a given MFA platform.
message StatusChange {
  bool updated = 1;
  Status value = 2;
  bool has_old_value = 3;
  Status old_value = 4;
}
