aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/service.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Add ActiveStorage.service_configurations and ActiveStorage.service"George Claghorn2019-03-311-1/+1
| | | | This reverts commit 002684e36e813469c3585e193f0698784c88278b.
* Add ActiveStorage.service_configurations and ActiveStorage.serviceGeorge Claghorn2019-03-311-1/+1
| | | | | | * Allow plugins to access the global service and alternative service configs before ActiveStorage::Blob loads. * Make ActiveStorage.service_configurations the default second argument to ActiveStorage::Service.configure. Plugins that just want to use an alternative service defined in config/storage.yml needn't pass in the config themselves.
* Add ActiveStorage::Service#openGeorge Claghorn2019-03-281-0/+4
|
* Prevent content type and disposition bypass in storage service URLsRosa Gutierrez2018-11-271-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Force content-type to binary on service urls for relevant content types We have a list of content types that must be forcibly served as binary, but in practice this only means to serve them as attachment always. We should also set the Content-Type to the configured binary type. As a bonus: add text/cache-manifest to the list of content types to be served as binary by default. * Store content-disposition and content-type in GCS Forcing these in the service_url when serving the file works fine for S3 and Azure, since these services include params in the signature. However, GCS specifically excludes response-content-disposition and response-content-type from the signature, which means an attacker can modify these and have files that should be served as text/plain attachments served as inline HTML for example. This makes our attempt to force specific files to be served as binary and as attachment can be easily bypassed. The only way this can be forced in GCS is by storing content-disposition and content-type in the object metadata. * Update GCS object metadata after identifying blob In some cases we create the blob and upload the data before identifying the content-type, which means we can't store that in GCS right when uploading. In these, after creating the attachment, we enqueue a job to identify the blob, and set the content-type. In other cases, files are uploaded to the storage service via direct upload link. We create the blob before the direct upload, which happens independently from the blob creation itself. We then mark the blob as identified, but we have already the content-type we need without having put it in the service. In these two cases, then, we need to update the metadata in the GCS service. * Include content-type and disposition in the verified key for disk service This prevents an attacker from modifying these params in the service signed URL, which is particularly important when we want to force them to have specific values for security reasons. * Allow only a list of specific content types to be served inline This is different from the content types that must be served as binary in the sense that any content type not in this list will be always served as attachment but with its original content type. Only types in this list are allowed to be served either inline or as attachment. Apart from forcing this in the service URL, for GCS we need to store the disposition in the metadata. Fix CVE-2018-16477.
* Encode Content-Disposition filenames on send_data and send_fileFumiaki MATSUSHIMA2018-09-131-1/+4
|
* Update service.rbishanray2018-06-241-1/+1
|
* Permit configuring the default service URL expiryGeorge Claghorn2018-06-211-2/+0
|
* Verify integrity after chunked downloadGeorge Claghorn2018-05-281-2/+0
|
* Correct the ActiveStorage::Service#download_chunk docs [ci skip]George Claghorn2018-03-051-1/+1
|
* Generate root-relative paths in Active Storage disk service URL methodsGeorge Claghorn2018-03-051-0/+5
| | | | Fixes #32129.
* Merge branch 'master' into activestorage-guideJeffrey Guenther2017-12-081-2/+7
|\
| * Purge variants with their blobsGeorge Claghorn2017-12-021-2/+7
| |
* | Fixes typo in docsJeffrey Guenther2017-11-021-1/+1
|/
* Extract metadata from images and videosGeorge Claghorn2017-10-221-2/+0
|
* Preview PDFs and videosGeorge Claghorn2017-09-281-0/+7
|
* Update Active Storage docs [ci skip]Yoshiyuki Hirano2017-08-301-1/+1
|
* Use frozen string literal in Active StorageKoichi ITO2017-08-121-0/+2
|
* 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-111-12/+12
| | | | | * Use `+` instead of backquote. * Remove escape from class to be link
* `module ActiveStorage`, not `ActiveStorage::Class`claudiob2017-08-041-97/+98
| | | | | | | | | | | | | | | | | | 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-041-1/+1
|
* Add Azure to the available services listRolandas Barysas2017-08-021-0/+1
|
* Use config/storage.yml as part of the skeleton and loadingDavid Heinemeier Hansson2017-07-311-1/+1
|
* Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58'Rafael Mendonça França2017-07-311-0/+113
git-subtree-dir: activestorage git-subtree-mainline: 0d58e7e478e79c2d6b2a39a4444d2a17a903b2a6 git-subtree-split: 3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58