Sha256: cf6096e8802f1a5e4181a61adc7e3ccf4b00af4758045eaeda756799b67eb950
Contents?: true
Size: 1.01 KB
Versions: 14
Compression:
Stored size: 1.01 KB
Contents
module Brightbox module Config module TwoFactorHelper attr_writer :two_factor_helper_password def two_factor_helper_command return config[client_name]["two_factor_helper_command"] unless client_name.nil? end # Return the two_factor code from the helper if it's possible 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 private 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 end end end
Version data entries
14 entries across 14 versions & 1 rubygems