Class: Azuki::Command::Auth
Overview
authentication (login, logout)
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#index ⇒ Object
auth.
-
#login ⇒ Object
auth:login.
-
#logout ⇒ Object
auth:logout.
-
#token ⇒ Object
auth:token.
-
#whoami ⇒ Object
auth:whoami.
Methods inherited from Base
#api, #app, #azuki, #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, #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 Azuki::Command::Base
Instance Method Details
#index ⇒ Object
auth
Authenticate, display token and current user
10 11 12 13 14 |
# File 'lib/azuki/command/auth.rb', line 10 def index validate_arguments! Azuki::Command::Help.new.send(:help_for_command, current_command) end |
#login ⇒ Object
auth:login
log in with your azuki credentials
Example:
$ azuki auth:login Enter your Azuki credentials: Email: [email protected] Password (typing will be hidden): Authentication successful.
28 29 30 31 32 33 |
# File 'lib/azuki/command/auth.rb', line 28 def login validate_arguments! Azuki::Auth.login display "Authentication successful." end |
#logout ⇒ Object
auth:logout
clear local authentication credentials
Example:
$ azuki auth:logout Local credentials cleared.
46 47 48 49 50 51 |
# File 'lib/azuki/command/auth.rb', line 46 def logout validate_arguments! Azuki::Auth.logout display "Local credentials cleared." end |
#token ⇒ Object
auth:token
display your api token
Example:
$ azuki auth:token ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCD
64 65 66 67 68 |
# File 'lib/azuki/command/auth.rb', line 64 def token validate_arguments! display Azuki::Auth.api_key end |