RhodiumGroup / rhg_compute_tools

Tools for using compute.rhg.com and compute.impactlab.org
MIT License
1 stars 4 forks source link

Alternative approach to enable alt GCS auth #52

Closed brews closed 4 years ago

brews commented 4 years ago

This PR presents an alternative approach to PR #49.

I refactored how we create authenticated clients. Minor refactor to how we mock the CLI tests. Reverted the earlier change to rhg_compute_tools.gcs.replicate_directory_structure_on_gcs() signature -- here it no longer accepting certificates and requires an authenticated client on input. This client is created with rhg_compute_tools.gcs._authenticate_client() which reads from a path to credentials or use alternative authentication internal to cloud.google.storage.

I feel like this makes the process less magical and flexible enough for future development.

brews commented 4 years ago

Note: Merge either this PR or PR #49. Not both.

delgadom commented 4 years ago

Thanks @brews - this is definitely a clean implementation. But this requires users of the python API to create their own client, right? Why not make the client creation helper public?

brews commented 4 years ago

@delgadom Followed your last suggestion with 1761e68.

Ready to merge when you are.