# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from ipsilon.util.log import Log
from ipsilon.util.page import Page
from ipsilon.util.user import UserSession
from ipsilon.util.plugin import PluginLoader, PluginObject
import cherrypy
-class LoginManagerBase(PluginObject):
+class LoginManagerBase(PluginObject, Log):
def __init__(self):
super(LoginManagerBase, self).__init__()
raise cherrypy.HTTPRedirect(ref)
- def _debug(self, fact):
- if cherrypy.config.get('debug', False):
- cherrypy.log(fact)
-
def get_tree(self, site):
raise NotImplementedError
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from ipsilon.util.log import Log
from ipsilon.util.plugin import PluginLoader, PluginObject
from ipsilon.util.plugin import PluginInstaller
from ipsilon.util.page import Page
import cherrypy
-class ProviderException(Exception):
+class ProviderException(Exception, Log):
def __init__(self, message):
super(ProviderException, self).__init__(message)
def __str__(self):
return repr(self.message)
- def _debug(self, fact):
- if cherrypy.config.get('debug', False):
- cherrypy.log('%s: %s' % (self.__class__.__name__, fact))
-
class ProviderBase(PluginObject):
self.tree = None
self.admin = None
- def _debug(self, fact):
- if cherrypy.config.get('debug', False):
- cherrypy.log(fact)
-
def get_tree(self, site):
raise NotImplementedError
FACILITY = 'provider_config'
-class LoadProviders(object):
+class LoadProviders(Log):
def __init__(self, root, site):
loader = PluginLoader(LoadProviders, FACILITY, 'IdpProvider')
plugin = providers['available'][item]
plugin.register(site)
- def _debug(self, fact):
- if cherrypy.config.get('debug', False):
- cherrypy.log(fact)
-
class ProvidersInstall(object):
from ipsilon.providers.common import ProviderException
from ipsilon.tools.saml2metadata import SAML2_NAMEID_MAP
-import cherrypy
+from ipsilon.util.log import Log
import lasso
return repr(self.message)
-class ServiceProvider(object):
+class ServiceProvider(Log):
def __init__(self, config, provider_id):
self.cfg = config
idval = data.keys()[0]
self.cfg.del_datum(idval)
- def _debug(self, fact):
- if cherrypy.config.get('debug', False):
- cherrypy.log(fact)
-
def normalize_username(self, username):
if 'strip domain' in self._properties:
return username.split('@', 1)[0]
return ServiceProvider(self.cfg, spid)
-class IdentityProvider(object):
+class IdentityProvider(Log):
def __init__(self, config):
self.server = lasso.Server(config.idp_metadata_file,
config.idp_key_file,
def get_providers(self):
return self.server.get_providers()
-
- def _debug(self, fact):
- if cherrypy.config.get('debug', False):
- cherrypy.log(fact)
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from ipsilon.util.log import Log
from ipsilon.util.user import UserSession
from urllib import unquote
import cherrypy
return check
-class Page(object):
+class Page(Log):
def __init__(self, site, form=False):
if 'template_env' not in site:
raise ValueError('Missing template environment')
m.update(kwargs)
return t.render(**m)
- def _debug(self, fact):
- if cherrypy.config.get('debug', False):
- cherrypy.log(fact)
-
def default(self, *args, **kwargs):
raise cherrypy.HTTPError(404)
import cherrypy
import inspect
from ipsilon.util.data import Store
+from ipsilon.util.log import Log
class Plugins(object):
return p.get_plugins(self._pathname, 'Installer')
-class PluginObject(object):
+class PluginObject(Log):
def __init__(self):
self.name = None
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from ipsilon.util.data import Store
+from ipsilon.util.log import Log
import cherrypy
raise AttributeError
-class UserSession(object):
+class UserSession(Log):
def __init__(self):
self.user = self.get_data('user', 'name')
- def _debug(self, fact):
- if cherrypy.config.get('debug', False):
- cherrypy.log(fact)
-
def get_user(self):
return User(self.user)