Пример #1
0
 def __init__(self, host, user, passwd, dbname, query):
     BaseAuth.__init__(self)
     self.mysql_group_query = query
     self.host = host
     self.user = user
     self.passwd = passwd
     self.dbname = dbname
Пример #2
0
 def __init__(
         self,
         server,  # mount.cifs //server/share
         share,  # mount.cifs //server/share
         mountpoint_fn,  # function of username to determine the mountpoint, e.g.:
         # lambda username: u'/mnt/wiki/%s' % username
     dir_user,  # username to get the uid that is used for mount.cifs -o uid=... (e.g. 'www-data')
         domain,  # mount.cifs -o domain=...
         dir_mode='0700',  # mount.cifs -o dir_mode=...
         file_mode='0600',  # mount.cifs -o file_mode=...
         iocharset='utf-8',  # mount.cifs -o iocharset=... (try 'iso8859-1' if default does not work)
         coding='utf-8',  # encoding used for username/password/cmdline (try 'iso8859-1' if default does not work)
         log='/dev/null',  # logfile for mount.cifs output
 ):
     BaseAuth.__init__(self)
     self.server = server
     self.share = share
     self.mountpoint_fn = mountpoint_fn
     self.dir_user = dir_user
     self.domain = domain
     self.dir_mode = dir_mode
     self.file_mode = file_mode
     self.iocharset = iocharset
     self.log = log
     self.coding = coding
Пример #3
0
 def __init__(self,
              autocreate=False,
              realm='MoinMoin',
              coding='iso-8859-1'):
     self.autocreate = autocreate
     self.realm = realm
     self.coding = coding
     BaseAuth.__init__(self)
Пример #4
0
 def __init__(self,
              auth_server,
              login_path="/login",
              logout_path="/logout",
              validate_path="/validate"):
     BaseAuth.__init__(self)
     self.cas = PyCAS(auth_server,
                      login_path=login_path,
                      validate_path=validate_path,
                      logout_path=logout_path)
 def __init__(self, apps=['egw'], s_path="/tmp", s_prefix="sess_", autocreate=False):
     """ @param apps: A list of the enabled applications. See above for
         possible keys.
         @param s_path: The path where the PHP sessions are stored.
         @param s_prefix: The prefix of the session files.
     """
     BaseAuth.__init__(self)
     self.s_path = s_path
     self.s_prefix = s_prefix
     self.apps = apps
     self.autocreate = autocreate
Пример #6
0
 def __init__(
     self, modify_request=None, update_user=None, create_user=None, forced_service=None, idselector_com=None
 ):
     BaseAuth.__init__(self)
     self._modify_request = modify_request or (lambda x: None)
     self._update_user = update_user or (lambda i, u: None)
     self._create_user = create_user or (lambda i, u: None)
     self._forced_service = forced_service
     self._idselector_com = idselector_com
     if forced_service:
         self.login_inputs = ["special_no_input"]
Пример #7
0
    def __init__(self, trusted_providers=[]):
        # the name
        self.name = 'openid'
        # we only need openid
        self.login_inputs = ['openid']
        # logout is possible
        self.logout_possible = True
        # the store
        self.store = MemoryStore()

        self._trusted_providers = list(trusted_providers)
        BaseAuth.__init__(self)
 def __init__(self, authorities=None,
              email_key=True, name_key=True,
              use_email=False, use_name=False,
              autocreate=False):
     self.use_email = use_email
     self.authorities = authorities
     self.email_key = email_key
     self.name_key = name_key
     self.use_email = use_email
     self.use_name = use_name
     self.autocreate = autocreate
     BaseAuth.__init__(self)
Пример #9
0
 def __init__(self,
              modify_request=None,
              update_user=None,
              create_user=None,
              forced_service=None,
              idselector_com=None):
     BaseAuth.__init__(self)
     self._modify_request = modify_request or (lambda x, c: None)
     self._update_user = update_user or (lambda i, u, c: None)
     self._create_user = create_user or (lambda i, u, c: None)
     self._forced_service = forced_service
     self._idselector_com = idselector_com
     if forced_service:
         self.login_inputs = ['special_no_input']
Пример #10
0
 def __init__(self,
              authorities=None,
              email_key=True,
              name_key=True,
              use_email=False,
              use_name=False,
              autocreate=False):
     self.use_email = use_email
     self.authorities = authorities
     self.email_key = email_key
     self.name_key = name_key
     self.use_email = use_email
     self.use_name = use_name
     self.autocreate = autocreate
     BaseAuth.__init__(self)
Пример #11
0
 def __init__(self,
              apps=['egw'],
              s_path="/tmp",
              s_prefix="sess_",
              autocreate=False):
     """ @param apps: A list of the enabled applications. See above for
         possible keys.
         @param s_path: The path where the PHP sessions are stored.
         @param s_prefix: The prefix of the session files.
     """
     BaseAuth.__init__(self)
     self.s_path = s_path
     self.s_prefix = s_prefix
     self.apps = apps
     self.autocreate = autocreate
Пример #12
0
    def __init__(self, cookies=['session_ser'], autocreate=True):
        """ @param cookie: Names of the cookies to parse.
        """
        BaseAuth.__init__(self)
        self.cookies = cookies
        self.autocreate = autocreate

        self.fflink = FusionForgeLink()
        self.session_key = self.fflink.get_config('session_key')

        # List super users (Forge admins)

        conn = self.fflink._conn
        cur = conn.cursor()
        cur.execute("""SELECT distinct(u.user_name)
                       FROM users u,
                            pfo_user_role pur,
                            pfo_role pr,
                            pfo_role_setting prs
                       WHERE u.user_id = pur.user_id
                         AND pur.role_id = pr.role_id
                         AND pr.role_id = prs.role_id
                         AND prs.section_name='forge_admin'
                         AND prs.perm_val = 1""")
        self.admins = []
        if cur.rowcount > 0:
            self.admins = [r[0] for r in cur]
        logging.debug("FusionForgeSessionAuth: admins=%s", (self.admins, ))

        # List projects

        cur.execute("""SELECT g.unix_group_name
                       FROM groups g, group_plugin gp, plugins p
                       WHERE g.group_id = gp.group_id
                         AND gp.plugin_id = p.plugin_id
                         AND p.plugin_name = 'moinmoin'""")
        self.projects = []
        if cur.rowcount:
            self.projects = [r[0] for r in cur]
        logging.debug("FusionForgeSessionAuth: projects=%s", (self.projects, ))
Пример #13
0
    def __init__(self, cookies=['session_ser'], autocreate=True):
        """ @param cookie: Names of the cookies to parse.
        """
        BaseAuth.__init__(self)
        self.cookies = cookies
        self.autocreate = autocreate

        self.fflink = FusionForgeLink()
        self.session_key = self.fflink.get_config('session_key')

        # List super users (Forge admins)

        conn = self.fflink._conn
        cur = conn.cursor()
        cur.execute("""SELECT distinct(u.user_name)
                       FROM users u,
                            pfo_user_role pur,
                            pfo_role pr,
                            pfo_role_setting prs
                       WHERE u.user_id = pur.user_id
                         AND pur.role_id = pr.role_id
                         AND pr.role_id = prs.role_id
                         AND prs.section_name='forge_admin'
                         AND prs.perm_val = 1""")
        self.admins = []
        if cur.rowcount > 0:
           self.admins = [r[0] for r in cur]
        logging.debug ("FusionForgeSessionAuth: admins=%s", (self.admins,))

        # List projects

        cur.execute("""SELECT g.unix_group_name
                       FROM groups g, group_plugin gp, plugins p
                       WHERE g.group_id = gp.group_id
                         AND gp.plugin_id = p.plugin_id
                         AND p.plugin_name = 'moinmoin'""")
        self.projects = []
        if cur.rowcount:
           self.projects = [r[0] for r in cur]
        logging.debug ("FusionForgeSessionAuth: projects=%s", (self.projects,))
Пример #14
0
 def __init__(self,
     server, # mount.cifs //server/share
     share, # mount.cifs //server/share
     mountpoint_fn, # function of username to determine the mountpoint, e.g.:
                    # lambda username: u'/mnt/wiki/%s' % username
     dir_user, # username to get the uid that is used for mount.cifs -o uid=... (e.g. 'www-data')
     domain, # mount.cifs -o domain=...
     dir_mode='0700', # mount.cifs -o dir_mode=...
     file_mode='0600', # mount.cifs -o file_mode=...
     iocharset='utf-8', # mount.cifs -o iocharset=... (try 'iso8859-1' if default does not work)
     coding='utf-8', # encoding used for username/password/cmdline (try 'iso8859-1' if default does not work)
     log='/dev/null', # logfile for mount.cifs output
     ):
     BaseAuth.__init__(self)
     self.server = server
     self.share = share
     self.mountpoint_fn = mountpoint_fn
     self.dir_user = dir_user
     self.domain = domain
     self.dir_mode = dir_mode
     self.file_mode = file_mode
     self.iocharset = iocharset
     self.log = log
     self.coding = coding
Пример #15
0
 def __init__(self, apikey):
     BaseAuth.__init__(self)
     self.apikey = apikey
Пример #16
0
 def __init__(self, autocreate=False):
     self.autocreate = autocreate
     BaseAuth.__init__(self)
Пример #17
0
 def __init__(self, autocreate=False):
     self.autocreate = autocreate
     BaseAuth.__init__(self)
Пример #18
0
 def __init__(self, trusted_wikis, autocreate=False):
     BaseAuth.__init__(self)
     self.trusted_wikis = trusted_wikis
     self.autocreate = autocreate
Пример #19
0
 def __init__(self, auth_server, login_path="/login", logout_path="/logout", validate_path="/validate"):
     BaseAuth.__init__(self)
     self.cas = PyCAS(auth_server, login_path=login_path,
                      validate_path=validate_path, logout_path=logout_path)
Пример #20
0
 def __init__(self, apikey):
     BaseAuth.__init__(self)
     self.apikey = apikey
Пример #21
0
 def __init__(self, autocreate=False, realm='MoinMoin', coding='iso-8859-1'):
     self.autocreate = autocreate
     self.realm = realm
     self.coding = coding
     BaseAuth.__init__(self)