Skip to content

Commit

Permalink
Add 'Period' support to AWS IAM token renewal (#3220)
Browse files Browse the repository at this point in the history
  • Loading branch information
EXPEddrewery authored and jefferai committed Aug 22, 2017
1 parent be57fd0 commit a4f4e5b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion builtin/credential/aws/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,13 @@ func (b *backend) pathLoginRenewIam(
}
}

return framework.LeaseExtend(roleEntry.TTL, roleEntry.MaxTTL, b.System())(req, data)
// If 'Period' is set on the role, then the token should never expire.
if roleEntry.Period > time.Duration(0) {
req.Auth.TTL = roleEntry.Period
return &logical.Response{Auth: req.Auth}, nil
} else {
return framework.LeaseExtend(roleEntry.TTL, roleEntry.MaxTTL, b.System())(req, data)
}
}

func (b *backend) pathLoginRenewEc2(
Expand Down

0 comments on commit a4f4e5b

Please sign in to comment.