-
Notifications
You must be signed in to change notification settings - Fork 393
Add static account support to GCP secrets engine #956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## main #956 +/- ##
==========================================
+ Coverage 81.78% 82.58% +0.79%
==========================================
Files 65 65
Lines 2992 3026 +34
==========================================
+ Hits 2447 2499 +52
+ Misses 545 527 -18
|
Hi @mweigel ! Welcome and thanks for putting this up. I looked it over and I definitely think you're on the right track, it looks pretty good to me. I would at least recommend getting your local environment set up (see CONTRIBUTING.md), and ensuring you run the linter/formatter before pushing to avoid the CI lint failures: poetry run black .
poetry run flake8 . I would definitely like to get the diff coverage up as well, so looking forward to more tests :) I'll see if any of the other maintainers have experience with GCP, but the code looks pretty straightforward, thanks again! |
@briantist Thanks for taking a look :) I'll keep working on this. I have my environment set up so I can run unit and integration tests. I'm testing out the new functionality in my GCP account currently. |
Ok, I've had some more time to work on this.
A couple of things to note that don't necessarily have to be implemented in this PR:
So there are a couple of options for token and service account key generation. Both options leave the existing "generate_oauth2_access_token" and "generate_service_account_key" methods as they are (in this PR) so existing clients are not impacted. These methods could be marked as deprecated and removed in a future release. 1. Add a new method for each credential generation endpoint Something like:
This is essentially the road I've already started down in this PR by adding the "generate_static_account_oauth2_access_token" and "generate_static_account_service_account_key" methods (those names still feel a little clunky to me). 2. Make two new more generic credential generation methods and add an "account type" option Something like:
These methods would then call the, roleset, static account or impersonated account endpoints depending on what's chosen. This would mean replacing the methods I've just added. Not a big change. I don't have a strong preference either way and I'm happy to implement either :) |
@mweigel I've only skimmed the recent changes but I really appreciate the tests, I don't personally see it as overboard, a 41+% increase in coverage is lovely. I'm going to see if any other maintainers are a little more familiar with GCP and can take a look. Thanks! |
Great, thanks! Again, I appreciate you taking a look :) |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
085b858
to
9dbfa98
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Hi @briantist, no worries. I used the "sync fork" button on my copy of the project and it has updated my branch with the last changes from main. Unfortunately it looks like a merge commit has been created though. I've also allowed maintainers to make changes to the branch. If this is no good I can always close this PR and open a new one based on main right from the start. Let me know what you think, cheers. |
* Allow creation of OAuth2 access tokens using GCP static accounts * Allow creation of service account keys using GCP static accounts
Thank you! I A merge commit is no problem in our PRs because we squash before merging them into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mweigel thanks for this contribution! I appreciate you sticking with it and I love to see tests added so this is great. We're actively trying to smooth out the process of contributing so I hope we'll see more from you if you're able, thanks again!
Hi Brian, thanks for all your work on getting this in. I'll be around, and will actively be using this functionality once released, so if there are any issues that come up feel free to get in touch. I'll look at adding the GCP impersonated accounts as well which should be a smaller change. :) |
Hi all, I've started working on implementing static account functionality in the GCP secrets engine. I've also added the ability to rotate the root service account credentials. It seems to be working well so far and it'd be great to know if I'm on the right track and get some feedback before I go any further, thanks :)
TODO: