2.7.0.md

The direct_upload plugin has been split into
upload_endpoint and presign_endpoint plugins.
These plugins provide respective endpoints that accept requests to the
root URL, allowing users to fully choose the URL. They also drop the Roda
dependency.

The activerecord plugin now allows validation error messages
to be an array, which is passed as arguments to
record.errors.add. This allows users to delegate validation
error message generation and i18n to ActiveRecord.

Shrine::Storage::S3 now supports the new
aws-sdk-s3 gem. See the AWS
announcement for more details on the modularization of the
aws-sdk gem.

gem"aws-sdk-s3", "~> 1.2"

Shrine::Storage::S3#open now uses streaming with the
aws-sdk-s3 gem instead of Down. Previously this
discrepancy would cause aws-sdk-s3 options like
:proxy to not have any effect in
Shrine::Storage::S3#open.

Shrine::Storage::S3 now raises an ArgumentError
when :bucket option is nil.

The download_endpoint now encodes uploaded file metadata in
the URL, allowing it to use them when generating a file response. Now the
filename metadata will be used for
Content-Disposition if available. Also, the
mime_type metadata will be used for Content-Type
instead of Rack::Mime when available.

The download_endpoint now returns a 404 Not Found
when uploaded file is missing.

The download_endpoint now returns Cache-Control:
max-age=31536000 header which tells clients to cache the response
for 1 year.

The download_endpoint now uses Rack::BodyProxy
instead of Roda's streaming plugin, which means the
download_endpoint plugin loads less code in total.

Fixed determine_mime_type plugin raising an exception when
empty files are given to file or filemagic
analyzers.

With the release of upload_endpoint and
presign_endpoint plugins, the direct_upload
plugin should now be considered deprecated. It will be officially
deprecated in Shrine 3, and
removed in Shrine 4.

The Shrine::DownloadEndpoint constant has been deprecated over
the Shrine.download_endpoint method, and it will be removed
in Shrine 3. In Shrine 3 the returned app won't
be a Roda subclass anymore, instead it will be a pure Rack
class. If you are relying on this, you should update your code. For
example, if you were using Roda.use to add middlewares, you
can instead wrap the endpoint in the middlewares directly:

map"/attachments"douseMyMiddlewarerunShrine.download_endpointend

The download_endpoint doesn't generate URLs which end with
uploaded file ID anymore; instead it generates URLs with base64-encoded
uploaded file data. The old URLs will remain supported indefinitely. If
you were relying on URLs including uploaded file ID, you'll need to
update your code. If this was becase you wanted to authenticate
download_endpoint requests, you should probably use the new
rack_response plugin instead of
download_endpoint.