Class: Aspera::Cli::BasicAuthPlugin
- Defined in:
- lib/aspera/cli/basic_auth_plugin.rb
Overview
base class for applications supporting basic authentication
Direct Known Subclasses
Plugins::Alee, Plugins::Aoc, Plugins::Bss, Plugins::Console, Plugins::Faspex, Plugins::Faspex5, Plugins::Node, Plugins::Orchestrator, Plugins::Preview, Plugins::Server, Plugins::Shares, Plugins::Shares2
Constant Summary collapse
- ACTIONS =
[]
Constants inherited from Plugin
Plugin::ALL_OPS, Plugin::GLOBAL_OPS, Plugin::INSTANCE_OPS
Instance Method Summary collapse
-
#basic_auth_api(subpath = nil) ⇒ Object
returns a Rest object with basic auth.
- #execute_action ⇒ Object
-
#initialize(env) ⇒ BasicAuthPlugin
constructor
A new instance of BasicAuthPlugin.
Methods inherited from Plugin
#config, #entity_action, #entity_command, #format, #options, #transfer
Constructor Details
#initialize(env) ⇒ BasicAuthPlugin
8 9 10 11 12 13 14 15 16 |
# File 'lib/aspera/cli/basic_auth_plugin.rb', line 8 def initialize(env) super(env) unless env[:skip_basic_auth_options] self..add_opt_simple(:url,"URL of application, e.g. https://org.asperafiles.com") self..add_opt_simple(:username,"username to log in") self..add_opt_simple(:password,"user's password") self.. end end |
Instance Method Details
#basic_auth_api(subpath = nil) ⇒ Object
returns a Rest object with basic auth
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/aspera/cli/basic_auth_plugin.rb', line 24 def basic_auth_api(subpath=nil) api_url=self..get_option(:url,:mandatory) api_url=api_url+'/'+subpath unless subpath.nil? return Rest.new({ :base_url => api_url, :auth => { :type => :basic, :username => self..get_option(:username,:mandatory), :password => self..get_option(:password,:mandatory) }}) end |
#execute_action ⇒ Object
19 20 21 |
# File 'lib/aspera/cli/basic_auth_plugin.rb', line 19 def execute_action raise "do not execute action on this generic plugin" end |