From 65667294013a7df47e11be6df935bff85058f80d Mon Sep 17 00:00:00 2001 From: Massimo DiPierro Date: Mon, 12 Mar 2012 12:12:45 -0500 Subject: [PATCH] moved debugger auth to access.py --- VERSION | 2 +- applications/admin/controllers/webservices.py | 10 ---------- applications/admin/models/access.py | 8 +++++++- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/VERSION b/VERSION index eb3d111a..6be3302e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-03-12 12:07:09) dev +Version 1.99.7 (2012-03-12 12:12:43) dev diff --git a/applications/admin/controllers/webservices.py b/applications/admin/controllers/webservices.py index cd220a3d..4fcc4634 100644 --- a/applications/admin/controllers/webservices.py +++ b/applications/admin/controllers/webservices.py @@ -125,16 +125,6 @@ def detach_debugger(): return True def call(): - "Entry point. Prevents access to action if not admin password is present" - - basic = request.env.http_authorization - if not basic or not basic[:6].lower() == 'basic ': - raise HTTP(401,"Wrong credentials") - (username, password) = base64.b64decode(basic[6:]).split(':') - if not verify_password(password) or not is_manager(): - time.sleep(10) - raise HTTP(403,"Not authorized") - session.forget() return service() diff --git a/applications/admin/models/access.py b/applications/admin/models/access.py index 3344294b..466b5fe7 100644 --- a/applications/admin/models/access.py +++ b/applications/admin/models/access.py @@ -121,7 +121,13 @@ if session.authorized: session.last_time = t0 if request.controller == "webservices": - pass + basic = request.env.http_authorization + if not basic or not basic[:6].lower() == 'basic ': + raise HTTP(401,"Wrong credentials") + (username, password) = base64.b64decode(basic[6:]).split(':') + if not verify_password(password) or not is_manager(): + time.sleep(10) + raise HTTP(403,"Not authorized") elif not session.authorized and not \ (request.controller == 'default' and \ request.function in ('index','user')):