Skip to content

Commit

Permalink
style: final tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: Samantha Coyle <[email protected]>
  • Loading branch information
sicoyle committed Nov 13, 2024
1 parent b5e1d97 commit 923ee94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion common/authentication/aws/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,11 @@ func (a *StaticAuth) Ses() *SesClients {
}

func (a *StaticAuth) getTokenClient() (*session.Session, error) {
awsConfig := a.Cfg
var awsConfig *aws.Config
if a.Cfg == nil {
awsConfig = aws.NewConfig()
} else {
awsConfig = a.Cfg
}

if a.Region != "" {
Expand Down
12 changes: 7 additions & 5 deletions common/authentication/aws/x509.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,15 @@ func (a *x509) createOrRefreshSession(ctx context.Context) (*session.Session, er
}}
var mySession *session.Session

awsConfig := a.Cfg
if awsConfig != nil {
awsConfig = a.Cfg.WithRegion(*a.region).WithHTTPClient(client).WithLogLevel(aws.LogOff)
var awsConfig *aws.Config
if a.Cfg == nil {
awsConfig = aws.NewConfig().WithHTTPClient(client).WithLogLevel(aws.LogOff)
} else {
awsConfig = aws.NewConfig().WithRegion(*a.region).WithHTTPClient(client).WithLogLevel(aws.LogOff)
awsConfig = a.Cfg.WithHTTPClient(client).WithLogLevel(aws.LogOff)
}
if a.region != nil {
awsConfig.WithRegion(*a.region)
}

// this is needed for testing purposes to mock the client,
// so code never sets the client, but tests do.
var rolesClient *rolesanywhere.RolesAnywhere
Expand Down

0 comments on commit 923ee94

Please sign in to comment.