Add a RdsUtilities with the ability to generate an IAM auth token#2057
Conversation
|
This was based on a conversation with Matt. Looking for feedback on direction before writing tests and finishing testing + docs |
There was a problem hiding this comment.
This probably needs a link to the doc where it states this must be 15 min
There was a problem hiding this comment.
Ya, our doc pages all say 15 mins: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html
|
SonarCloud Quality Gate failed.
|
|
Ping. Still looking for feedback on direction before committing any more time to this. |
|
Sorry, re:invent kept me from getting back to this Zoe. Thank you for the initial review. Will work on marching this forward |
|
@zoewangg Should we stick region/credProvider in:
S3 seems to do both 3 |
|
@abrooksv I'd vote # 3 to be consistent with s3 utilities. |
|
Okay, new revision pushed:
Let me know if you want them broken out into 4 files, happy to do it. Or w/e layout you feel is best.
Need to figure out how we should test this. V1 has no tests for its version of the class 😢 Standard pre-signer methods have access to Should we have a test only constructor on DefaultRdsUtilities to takes a signer? |
Codecov Report
@@ Coverage Diff @@
## master #2057 +/- ##
============================================
+ Coverage 77.62% 77.64% +0.01%
Complexity 367 367
============================================
Files 1237 1240 +3
Lines 38904 39001 +97
Branches 3064 3068 +4
============================================
+ Hits 30201 30283 +82
- Misses 7239 7253 +14
- Partials 1464 1465 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
zoewangg
left a comment
There was a problem hiding this comment.
WRT testing, I don't think it should have access to AwsRequestOverrideConfiguration or SdkRequestOverrideConfiguration. A test ctor with a test singer injected sounds good to me.
5819133 to
0542027
Compare
There was a problem hiding this comment.
Test data came from AWS CLI: https://github.com/aws/aws-cli/blob/master/tests/functional/rds/test_generate_db_auth_token.py#L50
f178c96 to
1ef3854
Compare
|
Left one minor comment, otherwise LGTM. Can you squash all commits into one? |
|
Just a few clarifications. If so, then why model it as if there is? Specifically:
Overall, I reckon the idea is to model it after Why not simply a class with static methods, named |
|
Hi @lbruun, first of all, thank you for reviewing the design and providing feedback!
Yes, it is correct.
We will work on the javadocs to make it clear that |
1ef3854 to
4348a5d
Compare
|
Hi @zoewangg
And speaking of hidden utility classes: Why not take advantage of use like this: AwsHostNameUtils.parseSigningRegion(hostname, "rds");Of course it should be optional. User should still be able to provide the Region explicitly. But providing the Region this way is IMO very likely to be correct. In fact I struggle to see when it won't yield the correct result given that the value used for |
|
@lbruun thanks for the javadoc suggestions! I think they make sense. We have added a note in
|
4348a5d to
0c064a0
Compare
|
Kudos, SonarCloud Quality Gate passed! |
|
I would like to check this changes committed to 2.17.14 version. I couldn't able to locate the software.amazon.awssdk.services.rds.DefaultRdsUtilities.DefaultBuilder newer version. |
…d3cfe9a03 Pull request: release <- staging/1bea35fc-9413-467d-87b8-50ed3cfe9a03
Description
Add a new Rds Utilities class that can generate the auth token.
V1 Parity feature
More info: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.AWSCLI.html
Utilities pattern is used instead of Presigner due to this is a pseudo request. There does not exist a modeled API call so it does not make sense to make a presigner for it.
Motivation and Context
Upstream this code out of the AWS Toolkit for JetBrains
#1157
Testing
Need to write the tests
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsLicense