Class: Conjur::Command::Users

Inherits:
Conjur::Command show all
Defined in:
lib/conjur/command/users.rb

Class Method Summary collapse

Methods inherited from Conjur::Command

acting_as_option, api, command, display, method_missing, require_arg

Methods included from IdentifierManipulation

#conjur_account, #full_resource_id, #get_kind_and_id_from_args

Class Method Details

.prompt_for_passwordObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/conjur/command/users.rb', line 28

def self.prompt_for_password
  # use stderr to allow output redirection, e.g.
  # conjur user:create -p username > user.json
  hl = HighLine.new($stdin, $stderr)

  password = hl.ask("Enter the password (it will not be echoed): "){ |q| q.echo = false }
  confirmation = hl.ask("Confirm the password: "){ |q| q.echo = false }
  
  raise "Password does not match confirmation" unless password == confirmation
  
  password
end