Class: MAuth::Rack::Request
- Inherits:
-
MAuth::Request
- Object
- MAuth::Request
- MAuth::Rack::Request
- Includes:
- Signed
- Defined in:
- lib/mauth/rack.rb
Overview
representation of a request composed from a rack request env which can be passed to a Mauth::Client for authentication
Constant Summary
Constants inherited from MAuth::Request
MAuth::Request::SIGNATURE_COMPONENTS, MAuth::Request::SIGNATURE_COMPONENTS_V2
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #attributes_for_signing ⇒ Object
-
#initialize(env) ⇒ Request
constructor
A new instance of Request.
- #mcc_authentication ⇒ Object
- #mcc_time ⇒ Object
- #x_mws_authentication ⇒ Object
- #x_mws_time ⇒ Object
Methods included from Signed
#fall_back_to_mws_signature_info, #protocol_version, #signature, #signature_app_uuid, #signature_info, #signature_token
Methods included from Signable
#normalize_path, #string_to_sign_v1, #string_to_sign_v2, #unescape_encode_query_string, #uri_escape
Constructor Details
#initialize(env) ⇒ Request
Returns a new instance of Request.
123 124 125 |
# File 'lib/mauth/rack.rb', line 123 def initialize(env) @env = env end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
121 122 123 |
# File 'lib/mauth/rack.rb', line 121 def env @env end |
Instance Method Details
#attributes_for_signing ⇒ Object
127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/mauth/rack.rb', line 127 def attributes_for_signing @attributes_for_signing ||= begin env['rack.input'].rewind body = env['rack.input'].read env['rack.input'].rewind { verb: env['REQUEST_METHOD'], request_url: env['PATH_INFO'], body: body, query_string: env['QUERY_STRING'] } end end |
#mcc_authentication ⇒ Object
153 154 155 |
# File 'lib/mauth/rack.rb', line 153 def mcc_authentication @env['HTTP_MCC_AUTHENTICATION'] end |
#mcc_time ⇒ Object
149 150 151 |
# File 'lib/mauth/rack.rb', line 149 def mcc_time @env['HTTP_MCC_TIME'] end |
#x_mws_authentication ⇒ Object
145 146 147 |
# File 'lib/mauth/rack.rb', line 145 def x_mws_authentication @env['HTTP_X_MWS_AUTHENTICATION'] end |
#x_mws_time ⇒ Object
141 142 143 |
# File 'lib/mauth/rack.rb', line 141 def x_mws_time @env['HTTP_X_MWS_TIME'] end |