Package restkit :: Module oauth2 :: Class SignatureMethod
[hide private]

Class SignatureMethod

source code

object --+
         |
        SignatureMethod
Known Subclasses:

A way of signing requests.

The OAuth protocol lets consumers and service providers pick a way to sign requests. This interface shows the methods expected by the other `oauth` modules for signing requests. Subclass it and implement its methods to provide a new way to sign requests.

Instance Methods [hide private]
 
signing_base(self, request, consumer, token)
Calculates the string that needs to be signed.
source code
 
sign(self, request, consumer, token)
Returns the signature for the given request, based on the consumer and token also provided.
source code
 
check(self, request, consumer, token, signature)
Returns whether the given signature is the correct signature for the given consumer and token signing the given request.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

signing_base(self, request, consumer, token)

source code 

Calculates the string that needs to be signed.

This method returns a 2-tuple containing the starting key for the signing and the message to be signed. The latter may be used in error messages to help clients debug their software.

sign(self, request, consumer, token)

source code 

Returns the signature for the given request, based on the consumer and token also provided.

You should use your implementation of `signing_base()` to build the message to sign. Otherwise it may be less useful for debugging.