-
Notifications
You must be signed in to change notification settings - Fork 338
Add GCP service account impersonation for credentials. #3246
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
adnanhemani
left a comment
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.
Looks great, @talatuyarer!! Thank you for this :) One small nit - not a requirement before merging (we can refactor after), but if you are making any changes, would be nice to take care of this in the same go.
| .generateAccessToken( | ||
| Mockito.argThat( | ||
| request -> | ||
| request.getName().equals("projects/-/serviceAccounts/" + serviceAccount) |
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.
nit: Would recommend moving these variables out to the main class as public variables and then referencing them here from there so that we don't have magic variables and it will be cleaner to maintain if there are any changes in the future!
dimas-b
left a comment
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.
Thanks for your contribution, @talatuyarer !
| * is configured, it impersonates that account first. | ||
| */ | ||
| private GoogleCredentials getBaseCredentials() { | ||
| if (config().getGcpServiceAccount() != null) { |
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.
Interesting that this config value was defined before, but not used 🤔
Does anyone have insight into why it was this way?
Technically, now that GcpServiceAccount config values start affecting Polaris behaviour, this could be a breaking change in existing deployments that may have (possibly accidental and/or incorrect) values in that config property.
I do believe that such a situation is unlikely, so it should be fine to proceed with this PR. However, it probably deserves mentioning as a Change in CHANGELOG.md
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.
Looks like this is in the CLI doc for a while, https://polaris.apache.org/in-dev/unreleased/command-line-interface/#catalogs
--service-account (Only for GCS) The service account to use when connecting to GCS
Agreed with @dimas-b, not particularly a big concern, but +1 on adding this to the CHANGELOG.md.
flyrain
left a comment
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.
Thanks a lot for working on it, @talatuyarer! Looks great to me overall. I think it's ready once we add an item in changelog.
adnanhemani
left a comment
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.
LGTM!
|
Thanks a lot for adding this, @talatuyarer! Thanks @dimas-b @adnanhemani for the review! |
This will close this bug: #550
cc @flyrain