Skip to content

google: Prevent GCE auth to hide S3 auth#921

Closed
pquentin wants to merge 1 commit into
apache:trunkfrom
pquentin:trunk
Closed

google: Prevent GCE auth to hide S3 auth#921
pquentin wants to merge 1 commit into
apache:trunkfrom
pquentin:trunk

Conversation

@pquentin
Copy link
Copy Markdown
Contributor

Prevent GCE auth to hide S3 auth

Description

We currently authenticate to Google Cloud Storage using Amazon S3 compatibility auth. Our code runs in Kubernetes on Google Container Engine. We tried to upgrade libcloud recently but 3849f65 from @crunk1 prevented us to authenticate. (Interestingly, it's also the commit that made us want to upgrade, since we eventually want to use service accounts.)

The issue happened for two reasons:

  • GoogleAuthType._is_gce() always returns True when the code is run on the Google Container Engine, regardless of the authentication provided (which makes the issue impossible to reproduce in a local Docker environment)
  • GoogleAuthType._is_gcs_s3() is always checked after _is_gce(), so it could not be used on Google Container Engine

This pull request simply changes the order to give S3 higher priority. Note that Installed Applications auth has lower priority still, because it's the default auth when everything else fails. That's OK because I guess it's not possible on GCE. Still, I think the documentation should recommend to always specify the auth type, because explicit is better than implicit and it helps to avoid unclear errors.

done, ready for review

Checklist (tick everything that applies)

GoogleAuthType._is_gce() is going to return True on any GCE instance,
but if there are S3 credentials, they should be used.
@tonybaloney
Copy link
Copy Markdown
Contributor

seeking input from @crunk1

@crunk1
Copy link
Copy Markdown
Contributor

crunk1 commented Oct 24, 2016

LGTM. Sorry for the hassle!

@pquentin
Copy link
Copy Markdown
Contributor Author

@crunk1 No worries! Thanks for your work on libcloud.

@pquentin
Copy link
Copy Markdown
Contributor Author

@tonybaloney Anything else I should do? Thanks.

@pquentin
Copy link
Copy Markdown
Contributor Author

pquentin commented Nov 9, 2016

@asfgit Anything I can do to help get this merged? Thanks.

@tonybaloney
Copy link
Copy Markdown
Contributor

hey @pquentin back from travelling. let's get this merged.

@asfgit asfgit closed this in 8bedf24 Nov 9, 2016
asfgit pushed a commit that referenced this pull request Nov 9, 2016
asfgit pushed a commit that referenced this pull request Nov 10, 2016
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