Class: Heroku::Command::Auth

Inherits:
Base
  • Object
show all
Defined in:
lib/heroku/command/auth.rb

Overview

authentication (login, logout)

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Methods inherited from Base

#api, #app, #heroku, #initialize, namespace

Methods included from Helpers

#action, #ask, #confirm, #confirm_billing, #confirm_command, #create_git_remote, #deprecate, #display, #display_header, #display_object, #display_row, #display_table, #error, error_with_failure, error_with_failure=, extended, extended_into, #fail, #format_bytes, #format_date, #format_error, #format_with_bang, #get_terminal_environment, #git, #has_git?, #home_directory, #host_name, #hprint, #hputs, included, included_into, #json_decode, #json_encode, #launchy, #line_formatter, #longest, #output_with_bang, #quantify, #redisplay, #retry_on_exception, #run_command, #running_on_a_mac?, #running_on_windows?, #set_buffer, #shell, #spinner, #status, #string_distance, #styled_array, #styled_error, #styled_hash, #styled_header, #suggestion, #time_ago, #truncate, #with_tty

Constructor Details

This class inherits a constructor from Heroku::Command::Base

Instance Method Details

#indexObject

auth

Authenticate, display token and current user



10
11
12
13
14
# File 'lib/heroku/command/auth.rb', line 10

def index
  validate_arguments!

  Heroku::Command::Help.new.send(:help_for_command, current_command)
end

#loginObject

auth:login

log in with your heroku credentials

Example:

$ pogo auth:login Enter your Heroku credentials: Email: [email protected] Password (typing will be hidden): Authentication successful.



28
29
30
31
32
33
# File 'lib/heroku/command/auth.rb', line 28

def 
  validate_arguments!

  Heroku::Auth.
  display "Authentication successful."
end

#logoutObject

auth:logout

clear local authentication credentials

Example:

$ pogo auth:logout Local credentials cleared.



46
47
48
49
50
51
# File 'lib/heroku/command/auth.rb', line 46

def logout
  validate_arguments!

  Heroku::Auth.logout
  display "Local credentials cleared."
end

#tokenObject

auth:token

display your api token

Example:

$ pogo auth:token ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCD



64
65
66
67
68
# File 'lib/heroku/command/auth.rb', line 64

def token
  validate_arguments!

  display Heroku::Auth.api_key
end

#whoamiObject

auth:whoami

display your heroku email address

Example:

$ pogo auth:whoami [email protected]



79
80
81
82
83
# File 'lib/heroku/command/auth.rb', line 79

def whoami
  validate_arguments!

  display Heroku::Auth.user
end