X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0e87ae0739ed3e72301b7b718098f97a7f06a5d8..d45957a6f6f199046a72595e016f7ebeeb459a37:/apps/piston/oauth.py?ds=inline diff --git a/apps/piston/oauth.py b/apps/piston/oauth.py index 3a42e20f9..8c430ea7a 100644 --- a/apps/piston/oauth.py +++ b/apps/piston/oauth.py @@ -87,7 +87,7 @@ class OAuthConsumer(object): class OAuthToken(object): """OAuthToken is a data type that represents an End User via either an access or request token. - + key -- the token secret -- the token secret @@ -133,7 +133,7 @@ class OAuthToken(object): if self.callback_confirmed is not None: data['oauth_callback_confirmed'] = self.callback_confirmed return urllib.urlencode(data) - + def from_string(s): """ Returns a token from something like: oauth_token_secret=xxx&oauth_token=xxx @@ -157,11 +157,11 @@ class OAuthRequest(object): """OAuthRequest represents the request and can be serialized. OAuth parameters: - - oauth_consumer_key + - oauth_consumer_key - oauth_token - oauth_signature_method - - oauth_signature - - oauth_timestamp + - oauth_signature + - oauth_timestamp - oauth_nonce - oauth_version - oauth_verifier @@ -436,7 +436,7 @@ class OAuthServer(object): def get_callback(self, oauth_request): """Get the callback URL.""" return oauth_request.get_parameter('oauth_callback') - + def build_authenticate_header(self, realm=''): """Optional support for the authenticate header.""" return {'WWW-Authenticate': 'OAuth realm="%s"' % realm} @@ -482,7 +482,7 @@ class OAuthServer(object): if not token: raise OAuthError('Invalid %s token: %s' % (token_type, token_field)) return token - + def _get_verifier(self, oauth_request): return oauth_request.get_parameter('oauth_verifier') @@ -601,7 +601,7 @@ class OAuthSignatureMethod_HMAC_SHA1(OAuthSignatureMethod): def get_name(self): return 'HMAC-SHA1' - + def build_signature_base_string(self, oauth_request, consumer, token): sig = ( escape(oauth_request.get_normalized_http_method()),