diff --git a/oauth2client/appengine.py b/oauth2client/appengine.py index 221e00e..5434063 100644 --- a/oauth2client/appengine.py +++ b/oauth2client/appengine.py @@ -17,8 +17,6 @@ Utilities for making it easier to use OAuth 2.0 on Google App Engine. """ -__author__ = 'jcgregorio@google.com (Joe Gregorio)' - import cgi import json import logging @@ -55,6 +53,9 @@ try: except ImportError: ndb = None + +__author__ = 'jcgregorio@google.com (Joe Gregorio)' + logger = logging.getLogger(__name__) OAUTH2CLIENT_NAMESPACE = 'oauth2client#ns' diff --git a/oauth2client/client.py b/oauth2client/client.py index e743a91..1d9930b 100644 --- a/oauth2client/client.py +++ b/oauth2client/client.py @@ -17,8 +17,6 @@ Tools for interacting with OAuth 2.0 protected resources. """ -__author__ = 'jcgregorio@google.com (Joe Gregorio)' - import base64 import collections import copy @@ -46,6 +44,9 @@ from oauth2client._helpers import _urlsafe_b64decode from oauth2client import clientsecrets from oauth2client import util + +__author__ = 'jcgregorio@google.com (Joe Gregorio)' + HAS_OPENSSL = False HAS_CRYPTO = False try: @@ -56,6 +57,7 @@ try: except ImportError: pass + logger = logging.getLogger(__name__) # Expiry is stored in RFC3339 UTC format diff --git a/oauth2client/clientsecrets.py b/oauth2client/clientsecrets.py index 333210c..cf7472f 100644 --- a/oauth2client/clientsecrets.py +++ b/oauth2client/clientsecrets.py @@ -18,11 +18,12 @@ A client_secrets.json file contains all the information needed to interact with an OAuth 2.0 protected service. """ -__author__ = 'jcgregorio@google.com (Joe Gregorio)' - import json import six + +__author__ = 'jcgregorio@google.com (Joe Gregorio)' + # Properties that make a client_secrets.json file valid. TYPE_WEB = 'web' TYPE_INSTALLED = 'installed' diff --git a/oauth2client/crypt.py b/oauth2client/crypt.py index 8846ec4..6d22472 100644 --- a/oauth2client/crypt.py +++ b/oauth2client/crypt.py @@ -25,6 +25,7 @@ from oauth2client._helpers import _to_bytes from oauth2client._helpers import _urlsafe_b64decode from oauth2client._helpers import _urlsafe_b64encode + CLOCK_SKEW_SECS = 300 # 5 minutes in seconds AUTH_TOKEN_LIFETIME_SECS = 300 # 5 minutes in seconds MAX_TOKEN_LIFETIME_SECS = 86400 # 1 day in seconds diff --git a/oauth2client/django_orm.py b/oauth2client/django_orm.py index d9e3fb8..1df9b84 100644 --- a/oauth2client/django_orm.py +++ b/oauth2client/django_orm.py @@ -18,8 +18,6 @@ Utilities for using OAuth 2.0 in conjunction with the Django datastore. """ -__author__ = 'jcgregorio@google.com (Joe Gregorio)' - import oauth2client import base64 import pickle @@ -28,6 +26,9 @@ from django.db import models from oauth2client.client import Storage as BaseStorage +__author__ = 'jcgregorio@google.com (Joe Gregorio)' + + class CredentialsField(models.Field): __metaclass__ = models.SubfieldBase diff --git a/oauth2client/file.py b/oauth2client/file.py index ba6070e..83add1c 100644 --- a/oauth2client/file.py +++ b/oauth2client/file.py @@ -18,8 +18,6 @@ Utilities for making it easier to work with OAuth 2.0 credentials. """ -__author__ = 'jcgregorio@google.com (Joe Gregorio)' - import os import threading @@ -27,6 +25,9 @@ from oauth2client.client import Credentials from oauth2client.client import Storage as BaseStorage +__author__ = 'jcgregorio@google.com (Joe Gregorio)' + + class CredentialsFileSymbolicLinkError(Exception): """Credentials files must not be symbolic links.""" diff --git a/oauth2client/flask_util.py b/oauth2client/flask_util.py index c67d67c..85fc0b0 100644 --- a/oauth2client/flask_util.py +++ b/oauth2client/flask_util.py @@ -161,8 +161,6 @@ available outside of a request context, you will need to implement your own :class:`oauth2client.Storage`. """ -__author__ = 'jonwayne@google.com (Jon Wayne Parrott)' - import hashlib import json import os @@ -189,6 +187,9 @@ from oauth2client.client import Storage from oauth2client import clientsecrets from oauth2client import util + +__author__ = 'jonwayne@google.com (Jon Wayne Parrott)' + DEFAULT_SCOPES = ('email', ) diff --git a/oauth2client/gce.py b/oauth2client/gce.py index 5cfaeac..61ad296 100644 --- a/oauth2client/gce.py +++ b/oauth2client/gce.py @@ -17,8 +17,6 @@ Utilities for making it easier to use OAuth 2.0 on Google Compute Engine. """ -__author__ = 'jcgregorio@google.com (Joe Gregorio)' - import json import logging from six.moves import urllib @@ -28,6 +26,9 @@ from oauth2client import util from oauth2client.client import AccessTokenRefreshError from oauth2client.client import AssertionCredentials + +__author__ = 'jcgregorio@google.com (Joe Gregorio)' + logger = logging.getLogger(__name__) # URI Template for the endpoint that returns access_tokens. diff --git a/oauth2client/keyring_storage.py b/oauth2client/keyring_storage.py index cb6ace2..11cdc36 100644 --- a/oauth2client/keyring_storage.py +++ b/oauth2client/keyring_storage.py @@ -17,8 +17,6 @@ A Storage for Credentials that uses the keyring module. """ -__author__ = 'jcgregorio@google.com (Joe Gregorio)' - import threading import keyring @@ -27,6 +25,9 @@ from oauth2client.client import Credentials from oauth2client.client import Storage as BaseStorage +__author__ = 'jcgregorio@google.com (Joe Gregorio)' + + class Storage(BaseStorage): """Store and retrieve a single credential to and from the keyring. diff --git a/oauth2client/locked_file.py b/oauth2client/locked_file.py index 9455854..3c9eaf9 100644 --- a/oauth2client/locked_file.py +++ b/oauth2client/locked_file.py @@ -32,8 +32,6 @@ Usage:: from __future__ import print_function -__author__ = 'cache@google.com (David T McWherter)' - import errno import logging import os @@ -41,6 +39,9 @@ import time from oauth2client import util + +__author__ = 'cache@google.com (David T McWherter)' + logger = logging.getLogger(__name__) diff --git a/oauth2client/multistore_file.py b/oauth2client/multistore_file.py index e813d5e..b2458d6 100644 --- a/oauth2client/multistore_file.py +++ b/oauth2client/multistore_file.py @@ -44,8 +44,6 @@ The format of the stored data is like so:: """ -__author__ = 'jbeda@google.com (Joe Beda)' - import errno import json import logging @@ -57,6 +55,9 @@ from oauth2client.client import Storage as BaseStorage from oauth2client import util from oauth2client.locked_file import LockedFile + +__author__ = 'jbeda@google.com (Joe Beda)' + logger = logging.getLogger(__name__) # A dict from 'filename'->_MultiStore instances diff --git a/oauth2client/old_run.py b/oauth2client/old_run.py index 02b855d..1517eb7 100644 --- a/oauth2client/old_run.py +++ b/oauth2client/old_run.py @@ -30,6 +30,7 @@ from oauth2client import util from oauth2client.tools import ClientRedirectHandler from oauth2client.tools import ClientRedirectServer + FLAGS = gflags.FLAGS gflags.DEFINE_boolean('auth_local_webserver', True, diff --git a/oauth2client/tools.py b/oauth2client/tools.py index 0d170a6..45c27f5 100644 --- a/oauth2client/tools.py +++ b/oauth2client/tools.py @@ -21,9 +21,6 @@ the same directory. from __future__ import print_function -__author__ = 'jcgregorio@google.com (Joe Gregorio)' -__all__ = ['argparser', 'run_flow', 'run', 'message_if_missing'] - import logging import socket import sys @@ -35,6 +32,10 @@ from six.moves import input from oauth2client import client from oauth2client import util + +__author__ = 'jcgregorio@google.com (Joe Gregorio)' +__all__ = ['argparser', 'run_flow', 'run', 'message_if_missing'] + _CLIENT_SECRETS_MESSAGE = """WARNING: Please configure OAuth 2.0 To make this sample run you will need to populate the client_secrets.json file diff --git a/oauth2client/util.py b/oauth2client/util.py index 882ff10..f9a35f9 100644 --- a/oauth2client/util.py +++ b/oauth2client/util.py @@ -17,6 +17,16 @@ """Common utility library.""" +import functools +import inspect +import logging +import sys +import types + +import six +from six.moves import urllib + + __author__ = [ 'rafek@google.com (Rafe Kaplan)', 'guido@google.com (Guido van Rossum)', @@ -29,15 +39,6 @@ __all__ = [ 'POSITIONAL_IGNORE', ] -import functools -import inspect -import logging -import sys -import types - -import six -from six.moves import urllib - logger = logging.getLogger(__name__) POSITIONAL_WARNING = 'WARNING' diff --git a/oauth2client/xsrfutil.py b/oauth2client/xsrfutil.py index 013db11..e99876b 100644 --- a/oauth2client/xsrfutil.py +++ b/oauth2client/xsrfutil.py @@ -15,11 +15,6 @@ """Helper methods for creating & verifying XSRF tokens.""" -__authors__ = [ - '"Doug Coker" ', - '"Joe Gregorio" ', -] - import base64 import hmac import time @@ -27,6 +22,11 @@ import time import six from oauth2client import util +__authors__ = [ + '"Doug Coker" ', + '"Joe Gregorio" ', +] + # Delimiter character DELIMITER = b':'