Skip to content

Commit

Permalink
Fix a bug where malformed ~/.aws/config would prevent loading
Browse files Browse the repository at this point in the history
credentials
  • Loading branch information
punmechanic committed Dec 10, 2024
1 parent a735c08 commit 1753b20
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions command/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"time"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/sts"
"github.com/riotgames/key-conjurer/oauth2"
"github.com/riotgames/key-conjurer/okta"
Expand Down Expand Up @@ -129,12 +128,7 @@ func (g GetCommand) fetchNewCredentials(ctx context.Context, account Account, gl
g.TimeToLive = cfg.TTL
}

awsCfg, err := config.LoadDefaultConfig(ctx, config.WithRegion(g.Region))
if err != nil {
return nil, err
}

stsClient := sts.NewFromConfig(awsCfg)
stsClient := sts.New(sts.Options{Region: g.Region})
timeoutInSeconds := int32(3600 * g.TimeToLive)
resp, err := stsClient.AssumeRoleWithSAML(ctx, &sts.AssumeRoleWithSAMLInput{
DurationSeconds: aws.Int32(timeoutInSeconds),
Expand Down

0 comments on commit 1753b20

Please sign in to comment.