From 20eba34fb556a50e5c5f7a13f7a3ed9744c47baa Mon Sep 17 00:00:00 2001 From: Kai Lautaportti Date: Thu, 28 Aug 2014 12:06:18 +0300 Subject: [PATCH] Preliminary token revocation support --- pyramid_oauthlib/__init__.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pyramid_oauthlib/__init__.py b/pyramid_oauthlib/__init__.py index e5fd0c4..962164f 100644 --- a/pyramid_oauthlib/__init__.py +++ b/pyramid_oauthlib/__init__.py @@ -10,14 +10,20 @@ OAUTH_PARAMS = ( 'access_token', + 'client', 'client_id', 'client_secret', 'code', 'grant_type', - 'response_type', + 'password', 'redirect_uri', + 'refresh_token', + 'response_type', 'scope', 'state', + 'token', + 'user', + 'username', ) @@ -63,7 +69,15 @@ def create_authorization_response(self, request, @base.catch_errors_and_unavailability def create_revocation_response(self, request): - pass + handler = self.response_types.get( + request.response_type, + self.default_response_type_handler, + ) + return handler.create_revocation_response( + request.url, + request.method, + request.body, + request.headers) @base.catch_errors_and_unavailability def create_token_response(self, request, credentials=None): @@ -204,7 +218,9 @@ def includeme(config): config.add_request_method( lambda request: - server.create_revocation_response(request), + oauth_response( + server.create_revocation_response(request) + ), str('create_revocation_response')) config.add_request_method(