Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENHANCEMENT: add the additional checksum as a supported put parameter #430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,18 @@ Specifies the AWS KMS key ID to use for object encryption.

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321.

## checksum_algorithm

AWS allows to calculate the integrity checksum server side. The additional checksum is
used to validate the data during upload or download. The following 4 SHA and CRC algorithms are supported:

* CRC32
* CRC32C
* SHA1
* SHA256

For more info refer to [object integrity](https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html).

## compute_checksums

AWS SDK uses MD5 for API request/response by default. On FIPS enabled environment,
Expand Down
3 changes: 3 additions & 0 deletions lib/fluent/plugin/out_s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def initialize
desc "Arbitrary S3 tag-set for the object"
config_param :tagging, :string, default: nil
desc "Arbitrary S3 metadata headers to set for the object"
config_param :checksum_algorithm, :string, default: nil
desc "Indicates the algorithm you want Amazon S3 to use to create the checksum for the object (CRC32,CRC32C,SHA1,SHA256)"
config_param :s3_metadata, :hash, default: nil
config_section :bucket_lifecycle_rule, param_name: :bucket_lifecycle_rules, multi: true do
desc "A unique ID for this rule"
Expand Down Expand Up @@ -368,6 +370,7 @@ def write(chunk)
put_options[:grant_read] = @grant_read if @grant_read
put_options[:grant_read_acp] = @grant_read_acp if @grant_read_acp
put_options[:grant_write_acp] = @grant_write_acp if @grant_write_acp
put_options[:checksum_algorithm] = @checksum_algorithm if @checksum_algorithm
put_options[:tagging] = @tagging if @tagging

if @s3_metadata
Expand Down