Skip to content

Commit

Permalink
Merge pull request #117 from sheetaljoshi/master
Browse files Browse the repository at this point in the history
Added support for unsigned_payload. New services such as Lattice does…
  • Loading branch information
alvinlin123 authored Mar 29, 2023
2 parents 645ae6a + d47db9f commit 4a207d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/aws-sigv4-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ var (
regionOverride = kingpin.Flag("region", "AWS region to sign for").String()
disableSSLVerification = kingpin.Flag("no-verify-ssl", "Disable peer SSL certificate validation").Bool()
idleConnTimeout = kingpin.Flag("transport.idle-conn-timeout", "Idle timeout to the upstream service").Default("40s").Duration()
unsignedPayload = kingpin.Flag("unsigned-payload", "Prevent signing of the payload").Default("false").Bool()

)

type awsLoggerAdapter struct {
Expand Down Expand Up @@ -102,12 +104,13 @@ func main() {
} else {
credentials = session.Config.Credentials
}

signer := v4.NewSigner(credentials, func(s *v4.Signer) {
if shouldLogSigning() {
s.Logger = awsLoggerAdapter{}
s.Debug = aws.LogDebugWithSigning
}
s.UnsignedPayload = *unsignedPayload
})
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
Expand Down

0 comments on commit 4a207d1

Please sign in to comment.