From 991989bc04178442b2a6b766a67f7a26e60c08f0 Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Wed, 6 Nov 2013 17:30:28 +0530 Subject: Modularize swift-auth CGI script, add unit tests - Moved most of swift-auth CGI script to kerbauth_utils.py - Added unit tests for kerbauth_utils.py - Made MEMCACHE_SERVERS, DEBUG_HEADERS, TOKEN_LIFE as configurable parameters Change-Id: I2e9e9823e8aa99dc2cf41327c55428350c8768dc Signed-off-by: Prashanth Pai Reviewed-on: http://review.gluster.org/6248 Tested-by: Chetan Risbud Reviewed-by: Chetan Risbud Reviewed-by: Luis Pabon Tested-by: Luis Pabon --- swiftkerbauth/__init__.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'swiftkerbauth/__init__.py') diff --git a/swiftkerbauth/__init__.py b/swiftkerbauth/__init__.py index eaa1d88..abdbeaa 100644 --- a/swiftkerbauth/__init__.py +++ b/swiftkerbauth/__init__.py @@ -14,4 +14,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.0.0" + +from swift.common.utils import readconf, config_true_value + +config_file = {} +try: + config_file = readconf("/etc/swift/proxy-server.conf", + section_name="filter:cache") +except SystemExit: + pass +MEMCACHE_SERVERS = config_file.get('memcache_servers', None) + +config_file = {} +try: + config_file = readconf("/etc/swift/proxy-server.conf", + section_name="filter:kerbauth") +except SystemExit: + pass +TOKEN_LIFE = int(config_file.get('token_life', 86400)) +RESELLER_PREFIX = config_file.get('reseller_prefix', "AUTH_") +DEBUG_HEADERS = config_true_value(config_file.get('debug_headers', 'yes')) -- cgit