Class: AWS::S3::Authentication::CanonicalString
- Inherits:
-
String
- Object
- String
- AWS::S3::Authentication::CanonicalString
- Defined in:
- lib/aws/s3/authentication.rb
Overview
The CanonicalString is used to generate an encrypted signature, signed with your secrect access key. It is composed of data related to the given request for which it provides authentication. This data includes the request method, request headers, and the request path. Both Header and QueryString use it to generate their signature.
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(request, options = {}) ⇒ CanonicalString
constructor
A new instance of CanonicalString.
Constructor Details
#initialize(request, options = {}) ⇒ CanonicalString
152 153 154 155 156 157 158 159 160 161 |
# File 'lib/aws/s3/authentication.rb', line 152 def initialize(request, = {}) super() @request = request @headers = {} = # CHANGED: Reflect the bucket adressing changes request['Host'] = [:bucket_address] ? "#{options[:bucket_address]}.#{DEFAULT_HOST}" : DEFAULT_HOST build end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
150 151 152 |
# File 'lib/aws/s3/authentication.rb', line 150 def headers @headers end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
150 151 152 |
# File 'lib/aws/s3/authentication.rb', line 150 def request @request end |
Class Method Details
.amazon_header_prefix ⇒ Object
145 146 147 |
# File 'lib/aws/s3/authentication.rb', line 145 def amazon_header_prefix /^#{AMAZON_HEADER_PREFIX}/io end |
.default_headers ⇒ Object
137 138 139 |
# File 'lib/aws/s3/authentication.rb', line 137 def default_headers %w(content-type content-md5) end |
.interesting_headers ⇒ Object
141 142 143 |
# File 'lib/aws/s3/authentication.rb', line 141 def interesting_headers ['content-md5', 'content-type', 'date', amazon_header_prefix] end |