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

codegen: PresignClient does not pass LogSigning option to signer #960

Closed
3 tasks done
jasdel opened this issue Dec 10, 2020 · 1 comment · Fixed by #955
Closed
3 tasks done

codegen: PresignClient does not pass LogSigning option to signer #960

jasdel opened this issue Dec 10, 2020 · 1 comment · Fixed by #955
Labels
bug This issue is a bug.

Comments

@jasdel
Copy link
Contributor

jasdel commented Dec 10, 2020

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
The generated PresignClients do not configure the LogSigning option of v4Signer.

// NewPresignClient generates a presign client using provided API Client and
// presign options
func NewPresignClient(c *Client, optFns ...func(*PresignOptions)) *PresignClient {
var presignOptions PresignOptions
for _, fn := range optFns {
fn(&presignOptions)
}
client := copyAPIClient(c, presignOptions.ClientOptions...)
if presignOptions.Presigner == nil {
presignOptions.Presigner = v4.NewSigner()
}

Version of AWS SDK for Go?
v0.30.0

Version of Go (go version)?
v1.15.5

To Reproduce (observed behavior)

	client := s3.NewFromConfig(cfg, func(o *s3.Options) {
		o.ClientLogMode |= aws.LogSigning
	})
	// or
	p := s3.NewPresignClient(client, func(o *s3.PresignOptions) {
		o.ClientOptions = append(o.ClientOptions, func(o *s3.Options) {
			o.ClientLogMode |= aws.LogSigning
		})
	})

Expected behavior

@@ -317,14 +319,17 @@ type PresignClient struct {

 // NewPresignClient generates a presign client using provided API Client and
 // presign options
-func NewPresignClient(c *Client, optFns ...func(*PresignOptions)) *PresignClient {
+func NewPresignClient(client *Client, optFns ...func(*PresignOptions)) *PresignClient {
        var presignOptions PresignOptions
        for _, fn := range optFns {
                fn(&presignOptions)
        }
-       client := copyAPIClient(c, presignOptions.ClientOptions...)
+       client = copyAPIClient(client, presignOptions.ClientOptions...)
        if presignOptions.Presigner == nil {
-               presignOptions.Presigner = v4.NewSigner()
+               presignOptions.Presigner = v4.NewSigner(func(s *v4.Signer) {
+                       s.LogSigning = client.options.ClientLogMode.IsSigning()
+               })
        }

Additional context
Add any other context about the problem here.

@jasdel jasdel added the bug This issue is a bug. label Dec 10, 2020
@jasdel jasdel added this to the v1.0 Release Candidate milestone Dec 10, 2020
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant