syntax = "proto3";

import "google/api/annotations.proto";
import "google/protobuf/struct.proto";
import "wix/spi/definitions.proto";
import "wix/common/spi.proto";
import "google/protobuf/wrappers.proto";
import "wix/api/validations.proto";
import "wix/api/annotations.proto";
import "google/protobuf/timestamp.proto";

package com.wixpress.appservice.api.upstream.wix.iam.authentication.v1;

enum FactorType {
  UNKNOWN_FACTOR_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED]; // Unknown factor type.
  PASSWORD = 1; // Requires a password.
  SMS = 2; // Requires a code sent via SMS.
  CALL = 3; // Requires a code sent by phone call.
  EMAIL = 4; // Requires a code sent by email.
  TOTP = 6; // Requires authentication via an authenticator app.
  PUSH = 7; // Requires authentication via a push notification.
  WEBAUTHN = 8; // Requires authentication via WebAuthn/passkey.
  RECOVERY_CODE = 9; // Requires a recovery code.
}

message FactorConfig {
  option (.wix.api.decomposite_of) = "wix.iam.authentication.factor.v1.FactorConfig";
  // the base URI where all the methods are deployed.
   .wix.common.spi.SpiBaseUri uri_config = 1;
  // the type of the factor
  FactorType factor_type = 2;
  // whether the factor supports verify without enrolling first
  bool supports_verify_without_enroll = 3;
  // whether the factor implementer requires enrollment
  bool enroll_required = 4;
}
