class

ActiveStorage::S3Service

Inherits ActiveStorage::Service < Reference < Object

Constructors

new(endpoint : String, bucket : String, access_key_id : String, secret_access_key : String, region : String = "us-east-1", name : String = "S3")
Source

Instance methods

delete(key : String) : Nil
Source
download(key : String) : String
Source
exist?(key : String) : Bool
Source
headers_for_direct_upload(key : String, content_type : String | Nil, content_length : Int64, checksum : String | Nil, filename : String | Nil = nil) : Hash(String, String)

Headers the client sends with the presigned PUT (all four are the signed ones from url_for_direct_upload plus the gem's Content-Disposition, oracle s3du_headers).

Source
upload(key : String, data : String | Bytes, checksum : String | Nil = nil, content_type : String | Nil = nil) : Nil
Source
url(key : String, expires_in : Int32 = 300, disposition : String | Nil = nil, filename : String | Nil = nil, content_type : String | Nil = nil) : String

Presigned GET URL (the gem's S3Service#url for private buckets).

Source
url_for_direct_upload(key : String, expires_in : Int32, content_type : String | Nil, content_length : Int64, checksum : String | Nil) : String

Presigned PUT URL for direct uploads — the aws-sdk shape the gem produces (object.presigned_url(:put, content_type:, content_md5:, whitelist_headers: ["content-length"]), oracle s3du_url_shape): query-SigV4, UNSIGNED-PAYLOAD, SignedHeaders "content-length;content-md5;content-type;host" (the client must send Content-Length/Content-MD5/Content-Type with the body).

Source

Nested types