class RHC::Rest::WWWAuth::OAuth2
Attributes
scheme[R]
Public Class Methods
new()
click to toggle source
# File lib/rhc/rest/httpclient.rb, line 61 def initialize @cred = nil @auth = {} @set = false @scheme = "Bearer" end
Public Instance Methods
challenge(uri, param_str = nil)
click to toggle source
# File lib/rhc/rest/httpclient.rb, line 96 def challenge(uri, param_str = nil) false end
get(req)
click to toggle source
# File lib/rhc/rest/httpclient.rb, line 88 def get(req) target_uri = req.header.request_uri return @cred if @cred hash_find_value(@auth) { |uri, cred| uri_part_of(target_uri, uri) } end
reset_challenge()
click to toggle source
# File lib/rhc/rest/httpclient.rb, line 68 def reset_challenge end
set(uri, user, password)
click to toggle source
# File lib/rhc/rest/httpclient.rb, line 71 def set(uri, user, password) @set = true if uri.nil? @cred = password else @auth[urify(uri)] = password end end
set?()
click to toggle source
# File lib/rhc/rest/httpclient.rb, line 84 def set? @set == true end
set_token(uri, token)
click to toggle source
# File lib/rhc/rest/httpclient.rb, line 80 def set_token(uri, token) set(uri, nil, token) end