Class: RHC::Commands::Authorization
- Defined in:
- lib/rhc/commands/authorization.rb
Constant Summary
Constants included from Helpers
Helpers::BOUND_WARNING, Helpers::PREFIX, Helpers::ROLES
Instance Method Summary collapse
Methods inherited from Base
Methods included from RHC::ContextHelpers
#find_app, #find_domain, #find_membership_container, #find_team, #from_local_git, included, #namespace_context, #server_context
Methods included from GitHelpers
#git_clone_application, #git_clone_deploy_hooks, #git_clone_repo, #git_cmd, #git_config_get, #git_config_set, #git_remote_add, #git_version, #has_git?
Methods included from Helpers
#agree, #certificate_file, #client_from_options, #collect_env_vars, #color, #confirm_action, #date, #datetime_rfc3339, #debug, #debug?, #debug_error, #decode_json, #deprecated, #deprecated_command, #disable_deprecated?, #distance_of_time_in_words, #env_var_regex_pattern, #error, #exec, #host_exists?, #hosts_file_contains?, #human_size, #info, #interactive?, #jruby?, #mac?, #openshift_online_server?, #openshift_rest_endpoint, #openshift_server, #openshift_url, #pluralize, #results, #role_name, #run_with_tee, #ssh_string, #ssh_string_parts, #ssl_options, #success, #system_path, #table_heading, #to_host, #to_uri, #token_for_user, #unix?, #user_agent, #warn, #windows?, #with_tolerant_encoding
Methods included from OutputHelpers
#default_display_env_var, #display_app, #display_app_configurations, #display_authorization, #display_cart, #display_cart_storage_info, #display_cart_storage_list, #display_deployment, #display_deployment_list, #display_domain, #display_env_var_list, #display_key, #display_team, #format_cart_gears, #format_cart_header, #format_gear_info, #format_key_header, #format_scaling_info, #format_usage_message
Constructor Details
This class inherits a constructor from RHC::Commands::Base
Instance Method Details
#add ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/rhc/commands/authorization.rb', line 63 def add unless .scopes.to_s.strip.present? say "When adding an authorization, you must specify which permissions clients will have." scope_help say "Run 'app authorization add --help' to see more options" return 0 end say "Adding authorization ... " auth = rest_client.(:scope => .scopes, :note => .note, :expires_in => .expires_in) success "done" paragraph{ (auth) } 0 end |
#delete(tokens) ⇒ Object
87 88 89 90 91 92 93 |
# File 'lib/rhc/commands/authorization.rb', line 87 def delete(tokens) raise ArgumentError, "You must specify one or more tokens to delete" if tokens.blank? say "Deleting authorization ... " tokens.each{ |token| rest_client.(token) } success "done" 0 end |
#delete_all ⇒ Object
101 102 103 104 105 106 |
# File 'lib/rhc/commands/authorization.rb', line 101 def delete_all say "Deleting all authorizations ... " rest_client. success "done" 0 end |
#list ⇒ Object
35 36 37 38 39 |
# File 'lib/rhc/commands/authorization.rb', line 35 def list rest_client..each{ |auth| paragraph{ (auth, token_for_user) } } or info "No authorizations" 0 end |