Class: App42::Command::Auth
Class Method Summary
collapse
Methods included from Base::Util
app42_client_info, ask_app_name, camel_case_to_whitespace, check_transaction_status, check_transaction_status_of_setup, escape_path, get_flavour_for_upgrade_or_downgrade, get_instance_config_for_upgrade_or_downgrade, input, ip_address_valid?, is_app_exist?, is_service_exist?, is_setup_name_exist?, is_static_ip_assigned?, json_parse, message, number_valid?, numeric?, numeric_including_zero?, params, parse_error_message, print_new_line, request_failed?, resource_url, show_wait_spinner, signature, status_call, time_valid?, util_base, validate_app_and_service_name, validate_database_name, validate_git_url, validate_setup_name, validate_upload_backup_path, validate_url, validate_vm_config
Methods included from UserToken
check_key_file?, config_path, ensure_config_dir, ensure_key_file, get_keys, key_path, local_app42_key, remove_key_file
Class Method Details
.is_authorize?(api_key, secret_key) ⇒ Boolean
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/app42/command/authorize.rb', line 14
def is_authorize?(api_key, secret_key)
if api_key.nil? || secret_key.nil?
message "#{Message::ADD_KEY}", true, 'red'
puts App42::Base::Help.addkeys
exit!
elsif api_key.size == 1 || secret_key.size == 1
message "#{Message::WRONG_KEY}", true, 'red'
puts App42::Base::Help.add
exit!
end
end
|
.is_authorize_for_dedicated? ⇒ Boolean
26
27
28
29
|
# File 'lib/app42/command/authorize.rb', line 26
def is_authorize_for_dedicated?
subscription = App42::Command::Base.new.get_subscription
return subscription["success"]
end
|
.logged_in? ⇒ TRUE/FALSE
10
11
12
|
# File 'lib/app42/command/authorize.rb', line 10
def logged_in?
check_key_file?
end
|