Class: Aws::S3::Presigner
- Inherits:
-
Object
- Object
- Aws::S3::Presigner
- Defined in:
- lib/aws-sdk-core/s3/presigner.rb
Overview
Defined Under Namespace
Classes: PresignHandler
Constant Summary collapse
- ONE_WEEK =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
60 * 60 * 24 * 7
- FIFTEEN_MINUTES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
60 * 15
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Presigner
constructor
A new instance of Presigner.
- #presigned_url(method, params = {}) ⇒ Object
Constructor Details
Instance Method Details
#presigned_url(method, params = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/aws-sdk-core/s3/presigner.rb', line 37 def presigned_url(method, params = {}) expires_in = params.delete(:expires_in) || FIFTEEN_MINUTES scheme = params.delete(:secure) == false ? 'http' : 'https' request = @client.build_request(method, params) request.handle(PresignHandler, step: :sign, priority: 99) validate_expires_in_header(expires_in) request.context[:presigned_expires_in] = expires_in url = URI.parse(request.send_request.data) url.scheme = scheme url.to_s end |