We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee212da commit a13c3e4Copy full SHA for a13c3e4
internal/credproviders/assume_role_provider.go
@@ -11,8 +11,8 @@ import (
11
"encoding/json"
12
"errors"
13
"fmt"
14
- "io/ioutil"
15
"net/http"
+ "os"
16
"time"
17
18
"go.mongodb.org/mongo-driver/v2/internal/aws/credentials"
@@ -74,10 +74,13 @@ func (a *AssumeRoleProvider) RetrieveWithContext(ctx context.Context) (credentia
74
if tokenFile == "" && roleArn != "" {
75
return v, errors.New("AWS_ROLE_ARN is set, but AWS_WEB_IDENTITY_TOKEN_FILE is missing")
76
}
77
- token, err := ioutil.ReadFile(tokenFile)
+ token, err := os.ReadFile(tokenFile)
78
if err != nil {
79
return v, err
80
81
+ if token[len(token)-1] == '\n' {
82
+ token = token[:len(token)-1]
83
+ }
84
85
sessionName := a.AwsRoleSessionNameEnv.Get()
86
if sessionName == "" {
0 commit comments