From b5b28e0591f7d88ae649ca3d5a2638b67e1e0e61 Mon Sep 17 00:00:00 2001 From: Ziad Sawalha Date: Sat, 3 Dec 2011 22:01:51 -0600 Subject: [PATCH] Refactor: Rename auth controller to token controller - All other controllers are named after the entity they manage. This makes it easier to understand what this controller does. Change-Id: Icc940f181fd91e340e7a10dfe1849a43180ea565 --- keystone/controllers/{auth.py => token.py} | 28 +++++++++++++++++++++- keystone/routers/admin.py | 4 ++-- keystone/routers/service.py | 4 ++-- 3 files changed, 31 insertions(+), 5 deletions(-) rename keystone/controllers/{auth.py => token.py} (75%) diff --git a/keystone/controllers/auth.py b/keystone/controllers/token.py similarity index 75% rename from keystone/controllers/auth.py rename to keystone/controllers/token.py index d7d4ed4cdb..bc31857eed 100644 --- a/keystone/controllers/auth.py +++ b/keystone/controllers/token.py @@ -1,3 +1,29 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# Copyright (c) 2010-2011 OpenStack, LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +""" +Token Controller + +This module contains the TokenController class which receives token-related +calls from the request routers. + +""" + from keystone import utils from keystone.common import wsgi from keystone.logic.types import auth @@ -6,7 +32,7 @@ import keystone.config as config from . import get_marker_limit_and_url -class AuthController(wsgi.Controller): +class TokenController(wsgi.Controller): """Controller for token related operations""" def __init__(self, options): diff --git a/keystone/routers/admin.py b/keystone/routers/admin.py index 26d0d5cb8a..b0a615d9a4 100755 --- a/keystone/routers/admin.py +++ b/keystone/routers/admin.py @@ -19,7 +19,7 @@ import routes from keystone.common import wsgi import keystone.backends as db -from keystone.controllers.auth import AuthController +from keystone.controllers.token import TokenController from keystone.controllers.roles import RolesController from keystone.controllers.staticfiles import StaticFilesController from keystone.controllers.tenant import TenantController @@ -38,7 +38,7 @@ class AdminApi(wsgi.Router): db.configure_backends(options) # Token Operations - auth_controller = AuthController(options) + auth_controller = TokenController(options) mapper.connect("/tokens", controller=auth_controller, action="authenticate", conditions=dict(method=["POST"])) diff --git a/keystone/routers/service.py b/keystone/routers/service.py index 960631303a..8954ec84c3 100644 --- a/keystone/routers/service.py +++ b/keystone/routers/service.py @@ -19,7 +19,7 @@ import routes from keystone.common import wsgi import keystone.backends as db -from keystone.controllers.auth import AuthController +from keystone.controllers.token import TokenController from keystone.controllers.tenant import TenantController from keystone.controllers.version import VersionController from keystone.controllers.staticfiles import StaticFilesController @@ -36,7 +36,7 @@ class ServiceApi(wsgi.Router): db.configure_backends(options) # Token Operations - auth_controller = AuthController(options) + auth_controller = TokenController(options) mapper.connect("/tokens", controller=auth_controller, action="authenticate", conditions=dict(method=["POST"]))