File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ const (
18
18
var (
19
19
// matches char that is not valid in a STS role session name
20
20
invalidSessionNameRegexp = regexp .MustCompile (`[^\w+=,.@-]` )
21
+
22
+ sessionExpiration = 5 * time .Minute
21
23
)
22
24
23
25
type credentials struct {
@@ -38,7 +40,7 @@ func (c credentials) ExpiredAt(at time.Time) bool {
38
40
}
39
41
40
42
func (c credentials ) ExpiresIn (d time.Duration ) bool {
41
- return c .ExpiredAt (time .Now ().Add (- d ))
43
+ return c .ExpiredAt (time .Now ().Add (d ))
42
44
}
43
45
44
46
type containerCredentials struct {
@@ -49,7 +51,7 @@ type containerCredentials struct {
49
51
func (c containerCredentials ) IsValid (container containerInfo ) bool {
50
52
return c .containerInfo .IamRole .Equals (container .IamRole ) &&
51
53
c .containerInfo .ID == container .ID &&
52
- ! c .credentials .ExpiresIn (5 * time . Minute )
54
+ ! c .credentials .ExpiresIn (sessionExpiration )
53
55
}
54
56
55
57
type credentialsProvider struct {
You can’t perform that action at this time.
0 commit comments