gdata.oauth | index /usr/lib/python2.7/dist-packages/gdata/oauth/__init__.py

Package Contents

``

rsa |  |  |

Classes

``

__builtin__.object
  OAuthClient
  OAuthConsumer
  OAuthDataStore
  OAuthRequest
  OAuthServer
  OAuthSignatureMethod
    OAuthSignatureMethod_HMAC_SHA1
    OAuthSignatureMethod_PLAINTEXT
  OAuthToken
exceptions.RuntimeError(exceptions.StandardError)
  OAuthError

class OAuthClient(__builtin__.object)
`` | `# OAuthClient is a worker to attempt to execute a request`

Methods defined here:

__init__(self, oauth_consumer, oauth_token)

access_resource(self, oauth_request)

fetch_access_token(self, oauth_request)

fetch_request_token(self, oauth_request)

get_consumer(self)

get_token(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

consumer = None

token = None

class OAuthConsumer(__builtin__.object)
`` | `# OAuthConsumer is a data type that represents the identity of the Consumer # via its shared secret with the Service Provider.`

Methods defined here:

__init__(self, key, secret)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

key = None

secret = None

class OAuthDataStore(__builtin__.object)
`` | `# OAuthDataStore is a database abstraction used to lookup consumers and tokens`

Methods defined here:

authorize_request_token(self, oauth_token, user)

fetch_access_token(self, oauth_consumer, oauth_token)

fetch_request_token(self, oauth_consumer)

lookup_consumer(self, key)

lookup_nonce(self, oauth_consumer, oauth_token, nonce, timestamp)

lookup_token(self, oauth_consumer, token_type, token_token)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class OAuthError(exceptions.RuntimeError)
`` | `# Generic exception class`

Method resolution order:
  OAuthError
  exceptions.RuntimeError
  exceptions.StandardError
  exceptions.Exception
  exceptions.BaseException
  __builtin__.object

Methods defined here:

__init__(self, message='OAuth error occured.')

Data descriptors defined here:

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes inherited from exceptions.RuntimeError:

__new__ = <built-in method __new__ of type object>
  `T.__new__(S, ...) -> a new object with type S, a subtype of T`

Methods inherited from exceptions.BaseException:

__delattr__(...)
  `x.__delattr__('name') <==> del x.name`

__getattribute__(...)
  `x.__getattribute__('name') <==> x.name`

__getitem__(...)
  `x.__getitem__(y) <==> x[y]`

__getslice__(...)
  `x.__getslice__(i, j) <==> x[i:j]
  Use of negative indices is not supported.`

__reduce__(...)

__repr__(...)
  `x.__repr__() <==> repr(x)`

__setattr__(...)
  `x.__setattr__('name', value) <==> x.name = value`

__setstate__(...)

__str__(...)
  `x.__str__() <==> str(x)`

__unicode__(...)

Data descriptors inherited from exceptions.BaseException:

__dict__

args

message

class OAuthRequest(__builtin__.object)
`` | `OAuth parameters: - oauth_consumer_key - oauth_token - oauth_signature_method - oauth_signature - oauth_timestamp - oauth_nonce - oauth_version ... any additional parameters, as defined by the Service Provider.`

Methods defined here:

__init__(self, http_method='GET', http_url=None, parameters=None)

build_signature(self, signature_method, consumer, token)

get_nonoauth_parameters(self)
  `# get any non-oauth parameters`

get_normalized_http_method(self)
  `# just uppercases the http method`

get_normalized_http_url(self)
  `# parses the url and rebuilds it to be scheme://host/path`

get_normalized_parameters(self)
  `# return a string that consists of all the parameters that need to be signed`

get_parameter(self, parameter)

set_parameter(self, parameter, value)

sign_request(self, signature_method, consumer, token)
  `# set the signature parameter to the result of build_signature`

to_header(self, realm='')
  `# serialize as a header for an HTTPAuth request`

to_postdata(self)
  `# serialize as post data for a POST request`

to_url(self)
  `# serialize as a url for a GET request`

Static methods defined here:

from_consumer_and_token(oauth_consumer, token=None, http_method='GET', http_url=None, parameters=None)

from_request(http_method, http_url, headers=None, parameters=None, query_string=None)

from_token_and_callback(token, callback=None, http_method='GET', http_url=None, parameters=None)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

http_method = 'GET'

http_url = None

parameters = None

version = '1.0'

class OAuthServer(__builtin__.object)
`` | `# OAuthServer is a worker to check a requests validity against a data store`

Methods defined here:

__init__(self, data_store=None, signature_methods=None)

add_signature_method(self, signature_method)

authorize_token(self, token, user)
  `# authorize a request token`

build_authenticate_header(self, realm='')
  `# optional support for the authenticate header`

fetch_access_token(self, oauth_request)
  `# process an access_token request
  # returns the access token on success`

fetch_request_token(self, oauth_request)
  `# process a request_token request
  # returns the request token on success`

get_callback(self, oauth_request)
  `# get the callback url`

get_data_store(self)

set_data_store(self, oauth_data_store)

verify_request(self, oauth_request)
  `# verify an api call, checks all the parameters`

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

data_store = None

signature_methods = None

timestamp_threshold = 300

version = '1.0'

class OAuthSignatureMethod(__builtin__.object)
`` | `# OAuthSignatureMethod is a strategy class that implements a signature method`

Methods defined here:

build_signature(self, oauth_request, oauth_consumer, oauth_token)

build_signature_base_string(self, oauth_request, oauth_consumer, oauth_token)

check_signature(self, oauth_request, consumer, token, signature)

get_name(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class OAuthSignatureMethod_HMAC_SHA1(OAuthSignatureMethod)

``

Method resolution order:
  OAuthSignatureMethod_HMAC_SHA1
  OAuthSignatureMethod
  __builtin__.object

Methods defined here:

build_signature(self, oauth_request, consumer, token)

build_signature_base_string(self, oauth_request, consumer, token)

get_name(self)

Methods inherited from OAuthSignatureMethod:

check_signature(self, oauth_request, consumer, token, signature)

Data descriptors inherited from OAuthSignatureMethod:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class OAuthSignatureMethod_PLAINTEXT(OAuthSignatureMethod)

``

Method resolution order:
  OAuthSignatureMethod_PLAINTEXT
  OAuthSignatureMethod
  __builtin__.object

Methods defined here:

build_signature(self, oauth_request, consumer, token)

build_signature_base_string(self, oauth_request, consumer, token)

get_name(self)

Methods inherited from OAuthSignatureMethod:

check_signature(self, oauth_request, consumer, token, signature)

Data descriptors inherited from OAuthSignatureMethod:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class OAuthToken(__builtin__.object)
`` | `# OAuthToken is a data type that represents an End User via either an access # or request token.`

Methods defined here:

__init__(self, key, secret)

__str__(self)

to_string(self)

Static methods defined here:

from_string(s)
  `# return a token from something like:
  # oauth_token_secret=digg&oauth_token=digg`

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

key = None

secret = None

Functions

``

build_authenticate_header(realm='')
  `# optional WWW-Authenticate header (401 error)`

escape(s)
  `# url escape`

generate_nonce(length=8)
  `# util function: nonce
  # pseudorandom number`

generate_timestamp()
  `# util function: current timestamp
  # seconds since epoch (UTC)`

Data
`` |  | HTTP_METHOD = 'GET' SIGNATURE_METHOD = 'PLAINTEXT' VERSION = '1.0'