Skip to content
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

Pass credentials directly to GCP connectors rather than through environment variable #1040

Merged
merged 7 commits into from
Jul 12, 2024

Conversation

austinweisgrau
Copy link
Collaborator

@austinweisgrau austinweisgrau commented Apr 22, 2024

Pass credentials directly to GCP connectors rather than through shared environment variable. Avoids issue documented in #1039 where credentials for all GCP clients are stored in the same environment variable, leading to overwrites if multiple clients are initialized in the same environment.

TODO

  • Fix for BigQuery connector
  • Test BigQuery connector works with live creds
  • Fix for Sheets connector
  • Test Sheets connector works with live creds
  • Fix for Admin connector
  • Test Admin connector works with live creds
  • Fix for CloudStorage connector
  • Test CloudStorage connector works with live creds
  • Fix for tests

@austinweisgrau austinweisgrau force-pushed the gcs_auth branch 2 times, most recently from 1183f86 to 43a035a Compare April 22, 2024 17:28
@austinweisgrau
Copy link
Collaborator Author

Ok this should qualify as a true refactor, where no existing behavior is altered (except for a very hacky use of these classes), but the bug will go away.

@austinweisgrau austinweisgrau force-pushed the gcs_auth branch 3 times, most recently from 589237c to 6394960 Compare April 22, 2024 18:32
@austinweisgrau
Copy link
Collaborator Author

I haven't used the Admin connector - curious if someone else can test that. ... @KasiaHinkson have u used it?

@austinweisgrau
Copy link
Collaborator Author

Just ensuring that it can authenticate is all thats needed

@KasiaHinkson
Copy link
Contributor

I have not used the Admin connector and this has been sitting in my inbox too long waiting for me to find the time to explore that and see if I could test it. I can go ahead and review it assuming that since this works for other connectors it will presumably work for the Admin connector, or I can keep waiting and try to make time next week?

@austinweisgrau austinweisgrau force-pushed the gcs_auth branch 3 times, most recently from c825011 to 7f993b5 Compare May 21, 2024 18:07
@austinweisgrau
Copy link
Collaborator Author

So, funny thing. I enabled the Google Admin API so I could test this out.

Turns out, the changes in this PR did break the parsons GoogleAdmin connector, a small change in argument order on the new client request method. That is fixed here.

Trouble is, this connector was actually already broken. I tested the connector on main and its methods return empty Tables every time. Digging in, every request returns an error, but the connector doesn't check for that and just ends up returning empty Tables.

So the connector is actually still as broken as it was on main, new issue here #1058 to track that. This PR should be good to go though - the new authentication works as intended.

@shaunagm
Copy link
Collaborator

Sorry this has been waiting so long. @KasiaHinkson did you review this or does it still need a review?

Avoids issue documented in move-coop#1039 where credentials for all GCP clients
are stored in the same environment variable, leading to overwrites if
multiple clients are initialized in the same environment.
Avoids mock credentials needing to match Google Service Account
credential parsing
Copy link
Contributor

@KasiaHinkson KasiaHinkson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this all looks good to me! Apologies again on the wait here, wanted to make sure I took the time to really read through it all

@austinweisgrau austinweisgrau merged commit 6dfaaec into move-coop:main Jul 12, 2024
18 checks passed
@austinweisgrau austinweisgrau deleted the gcs_auth branch July 12, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants