Skip to content

Commit

Permalink
Merge branch 'master' into ui-dependency-wdio-bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtjomsPorss authored Dec 3, 2024
2 parents 33e81ca + 19bf477 commit 60c4f1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
18 changes: 7 additions & 11 deletions libs/go/sia/aws/stssession/stssession.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,18 @@ import (
)

func New(useRegionalSTS bool, region string) (*sts.Client, error) {
cfg, err := config.LoadDefaultConfig(context.TODO(),
config.WithRegion(region),
)
if err != nil {
return nil, fmt.Errorf("unable to create new session: %v", err)
}
if useRegionalSTS {
stsUrl := "sts." + region + ".amazonaws.com"
cfg, err := config.LoadDefaultConfig(context.TODO(),
config.WithRegion(region),
)
if err != nil {
return nil, fmt.Errorf("unable to create new session: %v", err)
}
stsUrl := "https://sts." + region + ".amazonaws.com"
return sts.NewFromConfig(cfg, func(o *sts.Options) {
o.BaseEndpoint = aws.String(stsUrl)
}), nil
} else {
cfg, err := config.LoadDefaultConfig(context.TODO())
if err != nil {
return nil, fmt.Errorf("unable to create new session: %v", err)
}
return sts.NewFromConfig(cfg), nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion provider/aws/sia-ec2/authn.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func GetEC2Config(configFile, profileConfigFile, profileRestrictToKey, metaEndpo
log.Printf("Unable to process environment settings: %v\n", err)
// if we do not have settings in our environment, we're going
// to use fallback to <domain>.<service>-service naming structure
log.Println("Trying to determine service name security credentials...")
log.Println("Trying to determine service name from security credentials...")
configAccount, _, err = options.InitCredsConfig("-service", "@", useRegionalSTS, region)
if err != nil {
log.Printf("Unable to process security credentials: %v\n", err)
Expand Down

0 comments on commit 60c4f1f

Please sign in to comment.