Class: Bosh::Cli::Client::Uaa::Options
- Defined in:
- lib/cli/client/uaa/options.rb
Defined Under Namespace
Classes: ValidationError
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#ssl_ca_file ⇒ Object
Returns the value of attribute ssl_ca_file.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id
7 8 9 |
# File 'lib/cli/client/uaa/options.rb', line 7 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret
7 8 9 |
# File 'lib/cli/client/uaa/options.rb', line 7 def client_secret @client_secret end |
#ssl_ca_file ⇒ Object
Returns the value of attribute ssl_ca_file
7 8 9 |
# File 'lib/cli/client/uaa/options.rb', line 7 def ssl_ca_file @ssl_ca_file end |
#url ⇒ Object
Returns the value of attribute url
7 8 9 |
# File 'lib/cli/client/uaa/options.rb', line 7 def url @url end |
Class Method Details
.parse(cli_options, auth_options, env) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/cli/client/uaa/options.rb', line 10 def self.parse(, , env) url = .fetch('url') ssl_ca_file = [:ca_cert] client_id, client_secret = env['BOSH_CLIENT'], env['BOSH_CLIENT_SECRET'] = new(url, ssl_ca_file, client_id, client_secret) .validate! end |
Instance Method Details
#client_auth? ⇒ Boolean
20 21 22 |
# File 'lib/cli/client/uaa/options.rb', line 20 def client_auth? !client_id.nil? && !client_secret.nil? end |
#validate! ⇒ Object
24 25 26 27 28 |
# File 'lib/cli/client/uaa/options.rb', line 24 def validate! unless URI.parse(url).instance_of?(URI::HTTPS) raise ValidationError.new('HTTPS protocol is required') end end |