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

add client config to disable logging skipped output checksum validation #2976

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

lucix-aws
Copy link
Contributor

Closes #2974

Adds DisableLogOutputChecksumValidationSkipped to service clients that have output checksum ops (which, right now, is only S3's GetObject).

Testing

Uploaded a file with the latest cliv2 release, then ran:

package main

import (
	"context"
	"fmt"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/s3"
)

func main() {
	cfg, err := config.LoadDefaultConfig(context.Background())
	if err != nil {
		panic(err)
	}

	svc := s3.NewFromConfig(cfg)
	fmt.Println("1:----------------")
	svc.GetObject(context.Background(), &s3.GetObjectInput{
		Bucket: aws.String("fugazi"),
		Key:    aws.String("cli-upload-crc64"),
	})
	fmt.Println("------------------")
	fmt.Println("2:----------------")
	svc.GetObject(context.Background(), &s3.GetObjectInput{
		Bucket: aws.String("fugazi"),
		Key:    aws.String("cli-upload-crc64"),
	}, func(o *s3.Options) {
		o.DisableLogOutputChecksumValidationSkipped = true
	})
	fmt.Println("------------------")
}

result:

1:----------------
SDK 2025/01/21 13:03:34 WARN Response has no supported checksum. Not validating response payload.
------------------
2:----------------
------------------

@lucix-aws lucix-aws requested a review from a team as a code owner January 21, 2025 18:05
@lucix-aws lucix-aws changed the title Feat checksumnolog add client config to disable logging skipped output checksum validation Jan 21, 2025
@Madrigal
Copy link
Contributor

LGTM. I'd love to expand on the error message to say something like Object was uploaded with algorithm "X", which the Go SDK has no support for. Not validating response payload., but won't block on it

@lucix-aws lucix-aws merged commit e5689c9 into main Jan 21, 2025
13 checks passed
@lucix-aws lucix-aws deleted the feat-checksumnolog branch January 21, 2025 22:51
@andrewwatson andrewwatson mentioned this pull request Feb 4, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add config option to disable logging of skipped output checksum validation
2 participants