| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The Azure gem uses `Azure::Core::Http::HTTPError` for everything:
checksum mismatch, missing object, network unavailable, and many more.
(https://www.rubydoc.info/github/yaxia/azure-storage-ruby/Azure/Core/Http/HTTPError).
Rescuing that class obscures all sorts of configuration errors. We
should check the type of error in those rescue blocks, and reraise when
needed.
|
|
|
|
|
|
|
| |
cbothner/azure-service-swallowing-all-errors"
This reverts commit b204d167c5cfebd59f771d406178e371811ac43a, reversing
changes made to de6a200f82a3de399fa685d583503bc88dbc5e9f.
|
|
|
|
|
|
|
|
|
| |
The Azure gem uses `Azure::Core::Http::HTTPError` for everything:
checksum mismatch, missing object, network unavailable, and many more.
(https://www.rubydoc.info/github/yaxia/azure-storage-ruby/Azure/Core/Http/HTTPError).
Rescuing that class obscures all sorts of configuration errors. We
should check the type of error in those rescue blocks, and reraise when
needed.
|
|
|
|
|
|
|
|
|
| |
`ActiveStorage::Blob#download` and `ActiveStorage::Blob#open` raise
`ActiveStorage::FileNotFoundError` when the corresponding file is missing
from the storage service. Services translate service-specific missing
object exceptions (e.g. `Google::Cloud::NotFoundError` for the GCS service
and `Errno::ENOENT` for the disk service) into
`ActiveStorage::FileNotFoundError`.
|
|
|
|
|
|
|
| |
Avoid mangling service names that end in S:
"GCS".classify # => "GC"
"GCS".camelize # => "GCS"
|
| |
|
|
|
|
| |
Closes #32530.
|
| |
|
| |
|
| |
|
|
|
|
| |
Closes #32193.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
References #32703.
|
|
|
|
| |
Match other services, which all use a 5 MB chunk size.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
| |
Fixes #32129.
|
|
|
|
| |
Fix customizing the download Content-Type for a directly-uploaded blob via a signed URL. See e8286ee.
|
| |
|
| |
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
| |
Closes #31073.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
`content_type` parameter is before `disposition` parameter.
|
| |
|
| |
|
|
|
|
| |
And enable `context_dependent` of Style/BracesAroundHashParameters cop.
|
| |
|
| |
|
|\
| |
| | |
[Active Storage] `rubocop -a --only Layout/TrailingBlankLines`
|
| | |
|
| |
| |
| |
| | |
Follow up of #30188.
|
|/
|
|
|
| |
* Use `+` instead of backquote.
* Remove escape from class to be link
|
|
|
|
|
|
|
|
| |
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)"
|