Class TwoStepVerificationTestHelper
java.lang.Object
com.atlassian.bamboo.pageobjects.helpers.TwoStepVerificationTestHelper
Helper class for managing two-step verification
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
disableTwoStepVerificationViaUrl
(@NotNull String totpSecretKey) Disables two-step verification for the current user in the Bamboo instance using direct API calls.enableTwoStepVerificationViaUrl
(String currentUserPassword) Enables two-step verification for the current user in the Bamboo instance using direct API calls.generateVerificationCodes
(String secretKey, int delaySteps, int futureSteps) Generates a list of verification codes for a given secret key, considering a delay and future steps.boolean
Informs whether two-step verification is enabled for the current user in the Bamboo instance.
-
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
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
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 returnfutureSteps
- the number of future steps to return- Returns:
- a list of verification codes made of [delayed steps, current step, future steps]
-