aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/service
Commit message (Collapse)AuthorAgeFilesLines
* Remove vestigial require on ActiveStorage GCSServiceBibek Shrestha2018-07-041-1/+0
| | | | | | | | | | | | The file `filename.rb` as mentioned in `require "active_storage/filename"` belongs to the `app` folder while GCSService belongs to the lib folder. Looking at the git blame, it was added in commit https://github.com/rails/rails/commit/ccac681122db9747fec9512076772bca345e24b9#diff-bda6a610ef1575b2c8458c96b7f12578 where ActiveStorage::Filename was actually used. But it is no longer required on master and therefore can be removed. This allows anyone to use GCSService directly without enabling ActiveStorage engine.
* Support streaming downloads from Google Cloud StorageGeorge Claghorn2018-05-011-19/+25
|
* Avoid duplicating downloads from Google Cloud Storage in memoryGeorge Claghorn2018-04-291-2/+2
| | | | References #32703.
* Stream blobs from disk in 5 MB chunksGeorge Claghorn2018-04-291-1/+1
| | | | Match other services, which all use a 5 MB chunk size.
* Simplify URL generation for partial downloads from GCSGeorge Claghorn2018-04-251-1/+2
|
* Halve memory allocation in S3Service#downloadJanko Marohnić2018-04-231-1/+1
| | | | | | | | Aws::S3::Object#get returns a response with object content wrapped in an in-memory StringIO object. StringIO#read will return a copy of the content, which is not necessary because we can return the content directly using StringIO#string. This halves memory allocation of S3Service#download, because we remove unnecessary content duplication.
* Use a current model to provide the host for service urlsAndrew White2018-04-061-4/+7
| | | | | | | Trying to pass the current request down to the service so that it can create full urls instead of paths makes the API messy so use a model based on ActiveSupport::CurrentAttributes to provide the current host to services that need it (primarily the disk service).
* Allow full use of the AWS S3 SDK authentication options (#32270)Brian Knight2018-03-191-2/+2
| | | | | | | | | If an explicit AWS key pair and/or region is not provided in config/storage.yml, attempt to use environment variables, shared credentials, or IAM role credentials. Order of precedence is determined by the AWS SDK[1]. [1]: https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/setup-config.html
* Fix Azure signed URL generation with newer client libGeorge Claghorn2018-03-121-6/+4
|
* Remove path config option from Azure serviceAndrew White2018-03-121-6/+10
| | | | | | | | | | | The Active Storage service for Azure Storage has an option called `path` that is ambiguous in meaning. It needs to be set to the primary blob storage endpoint but that can be determined from the blobs client anyway. To simplify the configuration this commit removes the `path` option and gets the endpoint from the blobs client instead. Closes #32225.
* Remove blank Content-Type from GCS direct upload headersGeorge Claghorn2018-03-061-1/+1
| | | | Since we started clearing the client-side blob's type in e0867b3, we no longer need to set a blank Content-Type header before issuing the direct upload request. Fixes that Safari 9 would combine the blank Content-Type header with the blank blob type to produce a Content-Type header containing a single comma, invalidating the request.
* Generate root-relative paths in Active Storage disk service URL methodsGeorge Claghorn2018-03-055-8/+48
| | | | Fixes #32129.
* Avoid specifying content types for direct uploads to Google Cloud StorageGeorge Claghorn2018-02-261-5/+4
| | | | Fix customizing the download Content-Type for a directly-uploaded blob via a signed URL. See e8286ee.
* Provide a sensible default hostGeorge Claghorn2018-01-161-1/+1
|
* Extract content types from blob dataGeorge Claghorn2018-01-151-17/+11
|
* Return `nil` instead of `false` if raise `Azure::Core::Http::HTTPError`Yoshiyuki Hirano2017-12-121-1/+1
| | | | | | | * If it raise error `Azure::Core::Http::HTTPError`, return `nil` instead of `false` in `ActiveStorage::Service::AzureStorageService#delete`. * Other services behave as same as this.
* Fix customizing Content-Type via GCS service URLsGeorge Claghorn2017-12-071-1/+7
|
* Fix instrumention name: delete_prefixed like the others.Kasper Timm Hansen2017-12-031-1/+1
|
* Purge variants with their blobsGeorge Claghorn2017-12-025-27/+68
|
* Use `credentials` instead of `keyfile` in GCS seviceyuuji.yaginuma2017-11-291-0/+2
| | | | | | | | | | | | | The `keyfile` was renamed to `credentials` in `google-cloud-storage` 1.8.0. https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/google-cloud-storage/CHANGELOG.md#180--2017-11-14 Although `keyfile` can still be used, but it looks like deprecate. https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/ddf7b2a856d676316525eb581c1a4cc83ca6097b/google-cloud-storage/lib/google/cloud/storage.rb#L589...L590 Therefore, I think that should use `credentials` in newly generated applications. Ref: https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues/1802
* Avoid connecting to GCS during app bootGeorge Claghorn2017-11-231-5/+12
|
* Remove needless block parameterGeorge Claghorn2017-11-071-1/+1
|
* Fix streaming downloads from S3/Azure StorageGeorge Claghorn2017-11-062-7/+7
| | | Closes #31073.
* Preview PDFs and videosGeorge Claghorn2017-09-284-7/+13
|
* Avoid making HTTP requests to generate signed URLs for GCS objectsGeorge Claghorn2017-09-131-3/+3
|
* Use v3 of the AWS SDKYuji Yaginuma2017-09-091-3/+3
|
* Accept GCS client optionsGeorge Claghorn2017-09-011-2/+2
|
* Ignore files already deleted on GCS file deletionsRosa Gutierrez2017-08-311-1/+5
| | | | | | | | Relying on the GET request issued first to fetch the file we want to delete is not enough to avoid this error. If the file is deleted after our GET request but before the DELETE request we'll get a NotFound error that after all means that the file is already deleted, so it can be safely ignored.
* Fix order of Active Storage DiskService URL parametersKoichi ITO2017-08-261-1/+1
| | | | `content_type` parameter is before `disposition` parameter.
* Fix syntax errorGeorge Claghorn2017-08-201-1/+1
|
* DRYGeorge Claghorn2017-08-204-10/+14
|
* Fix RuboCop offensesKoichi ITO2017-08-161-2/+2
| | | | And enable `context_dependent` of Style/BracesAroundHashParameters cop.
* minor tweaks in Active Storage after a walkthroughXavier Noria2017-08-154-4/+4
|
* Use frozen string literal in Active StorageKoichi ITO2017-08-126-0/+12
|
* Merge pull request #30147 from yhirano55/fix_trailing_blank_linesRafael França2017-08-111-1/+0
|\ | | | | [Active Storage] `rubocop -a --only Layout/TrailingBlankLines`
| * [Active Storage] `rubocop -a --only Layout/TrailingBlankLines`Yoshiyuki Hirano2017-08-091-1/+0
| |
* | Fix formatting of Active Storage docs [ci skip]Koichi ITO2017-08-111-1/+1
| | | | | | | | Follow up of #30188.
* | Fix formatting of Active Storage docs [ci skip]yuuji.yaginuma2017-08-115-9/+9
|/ | | | | * Use `+` instead of backquote. * Remove escape from class to be link
* Support content_type in AzureStorageService#urlMike Gunderloy2017-08-081-2/+3
| | | | | | | | Add in the content_type option, which is defined as part of the generic ActiveStorage::Service class. Without this option, attempts to generate a URL for an attached file fail with "ArgumentError (unknown keyword: content_type)"
* Merge branch 'master' into ast-moduleDavid Heinemeier Hansson2017-08-051-1/+1
|\
| * Remove unecesarry exception variabledixpac2017-08-051-1/+1
| |
* | `module ActiveStorage`, not `ActiveStorage::Class`claudiob2017-08-046-353/+366
|/ | | | | | | | | | | | | | | | | | The reasons for this commit are: - uniformity with the other Rails libraries - (possibly) behave better with respect to autoloading - fix the index in the generated documentation Before this commit, run `rake rdoc` generates this left sidebar (ActiveStorage entries are indexed twice, both inside and outside the module): <img width="308" alt="before" src="https://user-images.githubusercontent.com/10076/28939523-7c087dec-7846-11e7-9289-38ed4a2930cd.png"> After this commit, run `rake rdoc` generates this left sidebar: (ActiveStorage entries are only indexed inside the module): <img width="303" alt="after" src="https://user-images.githubusercontent.com/10076/28939524-7c090be0-7846-11e7-8ee5-29dfecae548e.png">
* Rename Azure to AzureStorage (#30057)Dino Maric2017-08-042-2/+2
|
* Do not change the entire codebase style only because of active_storageRafael Mendonça França2017-08-031-4/+2
| | | | | | We are already removing the braces around hash parameters in the last argument in other places so we should not change the entire codebase because of two places.
* Fix all rubocop violationsRafael Mendonça França2017-08-031-2/+4
|
* Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58'Rafael Mendonça França2017-07-316-0/+488
git-subtree-dir: activestorage git-subtree-mainline: 0d58e7e478e79c2d6b2a39a4444d2a17a903b2a6 git-subtree-split: 3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58