Class: Rack::OauthProxy::Client::Request
- Inherits:
-
Object
- Object
- Rack::OauthProxy::Client::Request
- Defined in:
- lib/rack/oauth_proxy/client/request.rb
Constant Summary collapse
- DEFAULT_PROPAGATED_HEADER_FIELDS =
["Authorization"]
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #header ⇒ Object
- #header_with_nil_value ⇒ Object
-
#initialize(env, options = {}) ⇒ Request
constructor
A new instance of Request.
- #params ⇒ Object
Constructor Details
#initialize(env, options = {}) ⇒ Request
Returns a new instance of Request.
13 14 15 16 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 13 def initialize(env, = {}) @env = env = end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
11 12 13 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 11 def env @env end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 11 def end |
Instance Method Details
#header ⇒ Object
18 19 20 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 18 def header header_with_nil_value.reject {|key, value| value.nil? } end |
#header_with_nil_value ⇒ Object
22 23 24 25 26 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 22 def header_with_nil_value propagated_header_fields.inject({}) do |result, field| result.merge(field => env["HTTP_" + field.gsub("-", "_").upcase]) end end |
#params ⇒ Object
28 29 30 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 28 def params rack_request.params.slice("access_token", "bearer_token") end |