-
Notifications
You must be signed in to change notification settings - Fork 4
Add support for service account impersonation #12
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
func (source *impersonatedGceSource) getToken(ctx context.Context) (*oauth2.Token, error) { | ||
tokenSource, err := impersonate.CredentialsTokenSource(ctx, impersonate.CredentialsConfig{ | ||
TargetPrincipal: source.TargetPrincipal, | ||
Scopes: []string{"https://www.googleapis.com/auth/cloud-platform.read-only"}, |
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.
Perhaps the value of Scopes
should actually be cfg.Scopes
or source.scopes
I'll do some house keeping and then the go.mod changes won't be necessary. |
Thanks! Feel free to change this PR. |
@zoltanbedi Let me know if you have any feedback! Happy to make the requisite changes myself, if there are any 🫡 . |
Hey @andrewnicolalde, I checked your branch and did some changes but I still want to verify it and try it out. |
I'm going to close this one. |
Superseded by #14
This PR adds support for service account impersonation.Note: I have not been able to get a binary written to disk so that I can test that these changes produce the desired result. If you have any advice as to how I can do so, that would be much appreciated!See also: grafana/google-bigquery-datasource#336