From ff71ca42d7b3e8fdd04d8a9d74a24a04c1fec494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Tue, 29 Mar 2016 08:45:17 +0300 Subject: [PATCH] Move GSSAPI credcache from authorization config section to accounts --- certidude/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/certidude/config.py b/certidude/config.py index 1af7512..01087df 100644 --- a/certidude/config.py +++ b/certidude/config.py @@ -16,6 +16,9 @@ AUTHENTICATION_BACKENDS = set([j for j in AUTHORIZATION_BACKEND = cp.get("authorization", "backend") # whitelist, ldap, posix ACCOUNTS_BACKEND = cp.get("accounts", "backend") # posix, ldap +if ACCOUNTS_BACKEND == "ldap": + LDAP_GSSAPI_CRED_CACHE = cp.get("accounts", "ldap gssapi credential cache") + USER_SUBNETS = set([ipaddress.ip_network(j) for j in cp.get("authorization", "user subnets").split(" ") if j]) ADMIN_SUBNETS = set([ipaddress.ip_network(j) for j in @@ -69,7 +72,6 @@ elif "posix" == AUTHORIZATION_BACKEND: USERS_GROUP = cp.get("authorization", "posix user group") ADMIN_GROUP = cp.get("authorization", "posix admin group") elif "ldap" == AUTHORIZATION_BACKEND: - LDAP_GSSAPI_CRED_CACHE = cp.get("authorization", "ldap gssapi credential cache") LDAP_USER_FILTER = cp.get("authorization", "ldap user filter") LDAP_ADMIN_FILTER = cp.get("authorization", "ldap admin filter") if "%s" not in LDAP_USER_FILTER: raise ValueError("No placeholder %s for username in 'ldap user filter'")