https://github.com/rs/gcs-oauth2-boto-env-plugin
Google Storage auth2 plugin with support for passing service key via environment
https://github.com/rs/gcs-oauth2-boto-env-plugin
Last synced: 9 months ago
JSON representation
Google Storage auth2 plugin with support for passing service key via environment
- Host: GitHub
- URL: https://github.com/rs/gcs-oauth2-boto-env-plugin
- Owner: rs
- License: mit
- Created: 2015-06-08T23:41:02.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-02-18T01:59:51.000Z (over 10 years ago)
- Last Synced: 2025-04-15T14:13:19.665Z (about 1 year ago)
- Language: Python
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Google Cloud Storage oAuth2 ENV Plugin
======================================
.. image:: https://img.shields.io/pypi/v/gcs-oauth2-boto-env-plugin.svg
:target: https://pypi.python.org/pypi/gcs-oauth2-boto-env-plugin
gcs-oauth2-boto-env-plugin is a Python application whose purpose is to behave as an auth plugin for the boto auth plugin framework for use with OAuth 2.0 credentials for the Google Cloud Platform. This plugin is only compatible with service accounts, and it's functionality is essentially a wrapper around `gcs-oauth2-boto-plugin `_, with the added capability of passing the private JSON key as an environment variable for easy deployment.
Usage
-----
Call the following program with the content of the JSON private key set as ``GOOGLE_OAUTH2_JSON_PRIVATE_KEY`` environment variable::
import boto
import gcs_oauth2_boto_env_plugin
project_id = 'your-project-id'
header_values = {"x-goog-project-id": project_id}
uri = boto.storage_uri('', 'gs')
for bucket in uri.get_all_buckets(headers=header_values):
print bucket.name
License
-------
All source code is licensed under the `MIT License `_.