Class: Moguera::Authentication::Request
- Inherits:
-
Object
- Object
- Moguera::Authentication::Request
- Defined in:
- lib/moguera/authentication/request.rb
Instance Attribute Summary collapse
-
#access_key ⇒ Object
readonly
Returns the value of attribute access_key.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#http_date ⇒ Object
readonly
Returns the value of attribute http_date.
-
#request_method ⇒ Object
readonly
Returns the value of attribute request_method.
-
#request_path ⇒ Object
readonly
Returns the value of attribute request_path.
-
#secret_access_key ⇒ Object
readonly
Returns the value of attribute secret_access_key.
-
#token_prefix ⇒ Object
Returns the value of attribute token_prefix.
Instance Method Summary collapse
-
#initialize(access_key:, secret_access_key:, request_path:, request_method:, http_date:, content_type:) ⇒ Request
constructor
A new instance of Request.
- #token ⇒ Object
Constructor Details
#initialize(access_key:, secret_access_key:, request_path:, request_method:, http_date:, content_type:) ⇒ Request
Returns a new instance of Request.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/moguera/authentication/request.rb', line 6 def initialize(access_key:, secret_access_key:, request_path:, request_method:, http_date:, content_type:) require 'time' require 'openssl' require 'base64' @access_key = access_key @secret_access_key = secret_access_key @request_path = request_path @request_method = request_method @http_date = http_date @content_type = content_type @token_prefix = token_prefix || 'MOGUERA' validate_parameter! end |
Instance Attribute Details
#access_key ⇒ Object (readonly)
Returns the value of attribute access_key.
23 24 25 |
# File 'lib/moguera/authentication/request.rb', line 23 def access_key @access_key end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
23 24 25 |
# File 'lib/moguera/authentication/request.rb', line 23 def content_type @content_type end |
#http_date ⇒ Object (readonly)
Returns the value of attribute http_date.
23 24 25 |
# File 'lib/moguera/authentication/request.rb', line 23 def http_date @http_date end |
#request_method ⇒ Object (readonly)
Returns the value of attribute request_method.
23 24 25 |
# File 'lib/moguera/authentication/request.rb', line 23 def request_method @request_method end |
#request_path ⇒ Object (readonly)
Returns the value of attribute request_path.
23 24 25 |
# File 'lib/moguera/authentication/request.rb', line 23 def request_path @request_path end |
#secret_access_key ⇒ Object (readonly)
Returns the value of attribute secret_access_key.
23 24 25 |
# File 'lib/moguera/authentication/request.rb', line 23 def secret_access_key @secret_access_key end |
#token_prefix ⇒ Object
Returns the value of attribute token_prefix.
4 5 6 |
# File 'lib/moguera/authentication/request.rb', line 4 def token_prefix @token_prefix end |
Instance Method Details
#token ⇒ Object
26 27 28 29 30 |
# File 'lib/moguera/authentication/request.rb', line 26 def token raise ParameterInvalid, 'Token prefix required.' if @token_prefix.nil? @token_prefix + ' ' + @access_key + ':' + signature end |