Class TwoStepVerificationTestHelper

java.lang.Object
com.atlassian.bamboo.pageobjects.helpers.TwoStepVerificationTestHelper

public class TwoStepVerificationTestHelper extends Object
Helper class for managing two-step verification
  • Constructor Details

    • TwoStepVerificationTestHelper

      public TwoStepVerificationTestHelper()
  • Method Details

    • isTwoStepVerificationEnabled

      public boolean isTwoStepVerificationEnabled()
      Informs whether two-step verification is enabled for the current user in the Bamboo instance.
      Returns:
      whether two-step verification is enabled or null if unknown.
    • enableTwoStepVerificationViaUrl

      public String enableTwoStepVerificationViaUrl(String currentUserPassword)
      Enables two-step verification for the current user in the Bamboo instance using direct API calls.
      Parameters:
      currentUserPassword - the password of the current user, required to elevate permissions
      Returns:
      the secret key used to generate the verification code (it's necessary to elevate permission during unenrollment)
    • disableTwoStepVerificationViaUrl

      public void disableTwoStepVerificationViaUrl(@NotNull @NotNull String totpSecretKey)
      Disables two-step verification for the current user in the Bamboo instance using direct API calls.
      Parameters:
      totpSecretKey - the secret key used to generate the verification code (acquired during enrollment)
    • generateVerificationCodes

      public static List<String> generateVerificationCodes(String secretKey, int delaySteps, int futureSteps)
      Generates a list of verification codes for a given secret key, considering a delay and future steps.
      Parameters:
      secretKey - the secret key used to generate the verification code (obtained during enrollment)
      delaySteps - the number of previous steps to return
      futureSteps - the number of future steps to return
      Returns:
      a list of verification codes made of [delayed steps, current step, future steps]