aws-sdk-go-v2 icon indicating copy to clipboard operation
aws-sdk-go-v2 copied to clipboard

Implement Stringify methods for the Go SDK structs that respect @sensitive

Open garrettheel opened this issue 3 years ago • 2 comments

Describe the feature

It would be nice if the Prettify function from https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/internal/awsutil were public (i.e. not within an internal path)

Use Case

Debugging v2 structs is tedious without this function being available. This behavior is different from aws-sdk-go, which called Prettify in String() methods.. making it even easier to inspect these when debugging.

v1 also exposes prettify publicly (github.com/aws/aws-sdk-go/aws/awsutil), and that sorta works.. however it does not format some of the v2 structs properly.

Proposed Solution

Expose Prettify in a public module

Other Information

No response

Acknowledgements

  • [X] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

AWS Go SDK V2 Module Versions Used

n/a

Go version used

1.19

garrettheel avatar Oct 12 '22 21:10 garrettheel

Hi @garrettheel,

Thanks for opening the feature request. Unfortunately we can't expose the prettify function in v2 because v2 does not have Smithy's sensitive trait implemented. Without this, customers could be using Prettify to log sensitive information, and from a security standpoint this is a no-no.

Until we can get that implemented I can recommend using spew.Dump() to walk through the response.

I'm going to leave this FR open since this is something that we eventually do want to add back. In the spirit of full transparency I'll say that it will take a while until we can get to it, but I appreciate you bringing this to us.

Thanks again! Ran

RanVaknin avatar Jan 11 '23 23:01 RanVaknin