Class: Bosh::Cli::Client::Uaa::Client
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #login(credentials) ⇒ Object
- #prompts ⇒ Object
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cli/client/uaa.rb', line 12 def initialize() token_decoder = TokenDecoder.new if .client_auth? token_issuer = ClientTokenIssuer.new(, token_decoder) else token_issuer = PasswordTokenIssuer.new(, token_decoder) end @ssl_ca_file = .ssl_ca_file @token_issuer = token_issuer end |
Instance Method Details
#login(credentials) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/cli/client/uaa.rb', line 30 def login(credentials) @token_issuer.access_info(credentials) rescue CF::UAA::TargetError => e err("Failed to log in: #{e.info['error_description']}") #FIXME: the uaa client shouldn't know about 'err' rescue CF::UAA::BadResponse nil end |
#prompts ⇒ Object
23 24 25 26 27 28 |
# File 'lib/cli/client/uaa.rb', line 23 def prompts @token_issuer.prompts rescue CF::UAA::SSLException => e raise e unless @ssl_ca_file.nil? err('Invalid SSL Cert. Use --ca-cert to specify SSL certificate') #FIXME: the uaa client shouldn't know about 'err' end |