Skip to content

Commit

Permalink
Enable AWS SSO support
Browse files Browse the repository at this point in the history
  • Loading branch information
rmak-cpi committed Jan 3, 2024
1 parent b851e2c commit 79cdc4f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/aws-sigv4-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,19 @@ func main() {
log.SetLevel(log.DebugLevel)
}

sessionOptions := session.Options{
SharedConfigState: session.SharedConfigEnable,
}

sessionConfig := aws.Config{}
if v := os.Getenv("AWS_STS_REGIONAL_ENDPOINTS"); len(v) == 0 {
sessionConfig.STSRegionalEndpoint = endpoints.RegionalSTSEndpoint
}

sessionConfig.CredentialsChainVerboseErrors = aws.Bool(shouldLogSigning())

session, err := session.NewSession(&sessionConfig)
sessionOptions.Config.MergeIn(&sessionConfig)
session, err := session.NewSessionWithOptions(sessionOptions)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 79cdc4f

Please sign in to comment.