Skip to content

Commit

Permalink
ENHANCEMENT: add the additional checksum as a supported put parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Pellegrino <[email protected]>
  • Loading branch information
Giuseppe Pellegrino committed Oct 5, 2023
1 parent defa3e2 commit 348a1f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
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

0 comments on commit 348a1f0

Please sign in to comment.