-
Notifications
You must be signed in to change notification settings - Fork 875
Closed as not planned
Closed as not planned
Copy link
Labels
credentialsfeature-requestA feature should be added or improved.A feature should be added or improved.needs-reviewp2This is a standard priority issueThis is a standard priority issue
Description
Describe the feature
At the moment, RDS token expiry is hardcoded to 15 minutes when generating the token.
It would be good to have a parameter / overload added that provides a way to specify the token expiry.
In a scenario where we assume role for 1 hour and then generate RDS token, we cannot use the temporary credentials for 1 hour due to this hardcoded duration.
Use Case
This is a super simple change which will reduce the wastefulness of generating temporary credentials so frequently, only because of this hardcoded limitation.
Proposed Solution
sdk/src/Services/RDS/Custom/Util/RDSAuthTokenGenerator.cs
Add new overload:
private static string GenerateAuthToken(ImmutableCredentials immutableCredentials, RegionEndpoint region, string hostname, int port, string dbUser)
{
return GenerateAuthToken(immutableCredentials, region, hostname, port, dbUser, FifteenMinutes);
}
Change existing one to:
private static string GenerateAuthToken(ImmutableCredentials immutableCredentials, RegionEndpoint region, string hostname, int port, string dbUser, TimeSpan tokenDuration)
{
// ...
request.Parameters.Add(XAmzExpires, ((int)Math.Ceiling(tokenDuration.TotalSeconds)).ToString(CultureInfo.InvariantCulture));
// ...
}
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
AWS .NET SDK and/or Package version used
Targeted .NET Platform
.NET Core 8
Operating System and version
AmazonLinux
Metadata
Metadata
Assignees
Labels
credentialsfeature-requestA feature should be added or improved.A feature should be added or improved.needs-reviewp2This is a standard priority issueThis is a standard priority issue