Class: RHC::Rest::WWWAuth
- Defined in:
- lib/rhc/rest/httpclient.rb
Overview
Support three altered authentication behaviors
-
Allow a bearer token to be provided for a server
-
Allow the user and password attributes to be lazily evaluated when the credentials are needed, rather than up front.
-
If a BASIC auth request has been rejected, do not retry.
Defined Under Namespace
Classes: DeferredBasic, DeferredCredential, OAuth2
Instance Attribute Summary collapse
-
#oauth2 ⇒ Object
readonly
Returns the value of attribute oauth2.
Instance Method Summary collapse
-
#initialize ⇒ WWWAuth
constructor
A new instance of WWWAuth.
Constructor Details
#initialize ⇒ WWWAuth
Returns a new instance of WWWAuth.
47 48 49 50 51 52 53 54 55 |
# File 'lib/rhc/rest/httpclient.rb', line 47 def initialize super @oauth2 = OAuth2.new @authenticator.unshift(@oauth2) deferred = DeferredBasic.new @authenticator.map!{ |o| o == @basic_auth ? deferred : o } @basic_auth = deferred end |
Instance Attribute Details
#oauth2 ⇒ Object (readonly)
Returns the value of attribute oauth2.
46 47 48 |
# File 'lib/rhc/rest/httpclient.rb', line 46 def oauth2 @oauth2 end |