Skip to content
This repository has been archived by the owner on Jun 27, 2021. It is now read-only.

Google Workload Identity Federation (module upgrade) #180

Open
dhdersch opened this issue May 18, 2021 · 6 comments
Open

Google Workload Identity Federation (module upgrade) #180

dhdersch opened this issue May 18, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@dhdersch
Copy link

I am requesting that the terraform-provider-gsuite support Google Workload Identity Federation.

After looking at your code, it looks like the only thing that needs to be done to support this feature is to update the library "golang.org/x/oauth2/google" to the latest version.

google.DefaultClient() (which you use) will automatically support Workload Identity Federation. For more information, you can see this here: https://pkg.go.dev/golang.org/x/oauth2/google

@DeviaVir DeviaVir added the enhancement New feature or request label May 19, 2021
@DeviaVir
Copy link
Owner

29f99d1

@DeviaVir
Copy link
Owner

@dhdersch
Copy link
Author

dhdersch commented May 27, 2021

Looks like it works! Looking forward to the new version being published.

@DeviaVir
Copy link
Owner

DeviaVir commented May 28, 2021

This terraform registry dying on random bs is really getting old..............

@DeviaVir
Copy link
Owner

Done

@dhdersch
Copy link
Author

@DeviaVir Unfortunately, I was incorrect. The build I ran to test this did not use workload identity federation like I thought it was because I accidentally still had GOOGLE_CREDENTIALS set to a path with a service account key in it.

The issue is that workload identity federation generally requires the use of GOOGLE_APPLICATION_CREDENTIALS environment variable. In your code, if this environment variable is set, then this condition will be executed:

https://github.com/DeviaVir/terraform-provider-gsuite/blob/master/gsuite/config.go#L62

For this to work, we would want the following condition to run:

https://github.com/DeviaVir/terraform-provider-gsuite/blob/master/gsuite/config.go#L114

This means that there's some code changes that need to be made in order for the provider to support workload identity federation.

I'll try to find some time to work on this in the next couple of weeks and will submit a pull request once I get it working. I'll attempt to do it in such a way that existing clients do not break.

@DeviaVir DeviaVir reopened this May 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants