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

Invoke gcspypi using service account? #12

Open
JuergenSimon opened this issue Nov 26, 2019 · 1 comment
Open

Invoke gcspypi using service account? #12

JuergenSimon opened this issue Nov 26, 2019 · 1 comment

Comments

@JuergenSimon
Copy link

I would like to access own repositories in an automated deployment context or docker setup. For that I need a way to authenticate with the GCS without involving logging in as a user with the browser. Is there a way to authenticate using a service account?

@JuergenSimon
Copy link
Author

I re-opened this issue after testing and confirming that this package does not work with service accounts. Try the following procedure to confirm:

  • Create a service account with storage admin rights in IAM
  • Create a key and download it (let's call it my-secret.json for now.
  • In your terminal, call gcloud auth application-default revoke and confirm to make sure you are logged out
  • Try to list your GCS repository using gcspypi --repository "my-rep" -v list. Result: an error message: failed connecting
  • Activate the above service account: gcloud auth activate-service-account --key-file=my-secret.json
  • List your GCS repository: gcspypi --repository "my-rep" -v list.
    => Expected: repository lists ok
    => What happens instead: error message: failed connecting

Only after logging in once and then logging out again it would work correctly.

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

No branches or pull requests

1 participant