Add ability to configure multiple OTPs #830
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Improve Extendability of OTP implementation.
The current implementation of the OTP works well for use with Magento's admin. It can even be used for other use cases. What is not possible in its current form is accessing multiple OTPs within the same test run. This is for example needed when trying to configure a Magento admin setting based on a value provided by a 3rd party also behind a 2FA.
Even changing the shared secret on the fly with something like
<magentoCLI command="security:tfa:google:set-secret admin {{_CREDS.fooman/other/OTP_SHARED_SECRET}}" stepKey="setSecret"/>
does not work as the OTP is only initialised once.
This PR allows providing a separate secret
<getOTP stepKey="getOtherOtp" userInput="fooman/other/OTP_SHARED_SECRET"/>
with
<getOTP stepKey="getOtp" />
retaining the default implementation for Magento's Admin 2FA.
Fixed Issues (if relevant)
Contribution checklist