module Brightbox::Config::TwoFactorHelper
Attributes
Public Instance Methods
Source
# File lib/brightbox-cli/config/two_factor_helper.rb, line 6 def two_factor_helper_command return config[client_name]["two_factor_helper_command"] unless client_name.nil? end
Source
# File lib/brightbox-cli/config/two_factor_helper.rb, line 11 def two_factor_helper_password if defined?(@two_factor_helper_password) && !@two_factor_helper_password.nil? return @two_factor_helper_password end @two_factor_helper_password = if two_factor_helper_command two_factor_helper_call end end
Return the two_factor code from the helper if it’s possible
Private Instance Methods
Source
# File lib/brightbox-cli/config/two_factor_helper.rb, line 23 def two_factor_helper_call info "INFO: Calling two factor helper to obtain two factor" begin cmd = two_factor_helper_command.split(/\s+/) IO.popen(cmd, "r") do |io| io.readline.chomp end rescue ArgumentError, Errno::ENOENT nil end end