"""A simple wrapper around the OAuth2 credentials library."""
from oauth2client import client
[docs]class Credentials(object):
"""An object used to simplify the OAuth2 credentials library.
.. note::
You should not need to use this class directly.
Instead, use the helper methods provided in
:func:`gcloud.datastore.__init__.get_connection`
and
:func:`gcloud.datastore.__init__.get_dataset`
which use this class under the hood.
"""
@classmethod
[docs] def get_for_service_account(cls, client_email, private_key_path, scope=None):
"""Gets the credentials for a service account.
:type client_email: string
:param client_email: The e-mail attached to the service account.
:type private_key_path: string
:param private_key_path: The path to a private key file (this file was
given to you when you created the service
account).
:type scope: string or tuple of strings
:param scope: The scope against which to authenticate.
(Different services require different scopes,
check the documentation for which scope is required
for the different levels of access
to any particular API.)
"""
return client.SignedJwtAssertionCredentials(
service_account_name=client_email,
private_key=open(private_key_path).read(),
scope=scope)
Shop Amazon - Back to School Shop Amazon - Off to College Shop Amazon - Off to College - Dorm and Apartment Essentials Shop Amazon - Trade In Your iPhone Shop Amazon - Trade In Your Smartphone . Shop Amazon - Fall Outlet Event Amazon.com Widgets Amazon.com Widgets Amazon.com Widgets جارٍ التحميل... 6 Secrets for Better Web Application Development More PowerPoint presentations from Michelle Hummel Shop Amazon 3D Printing Store - Unleash Your Creativity in 3D Style Shop Amazon - Save Time and Money with School Lists Shop Amazon Fire TV - Say it. Watch it. Shop Amazon - Create an Amazon Wedding Registry ...
تعليقات
إرسال تعليق