Files
@ b232a36cc51f
Branch filter:
Location: kallithea/rhodecode/lib/dbmigrate/versions/003_version_1_2_0.py - annotation
b232a36cc51f
1.6 KiB
text/x-python
Improve LDAP authentication
* Adds an LDAP filter for locating the LDAP object
* Adds a search scope policy when using the Base DN
* Adds option required certificate policy when using LDAPS
* Adds attribute mapping for username, firstname, lastname, email
* Initializes rhodecode user using LDAP info (no longer uses "@ldap")
* Remembers the user object (DN) in the user table
* Updates admin interfaces
* Authenticates against actual user objects in LDAP
* Possibly other things.
Really, this should be extended to a list of LDAP configurations, but this is a good start.
* Adds an LDAP filter for locating the LDAP object
* Adds a search scope policy when using the Base DN
* Adds option required certificate policy when using LDAPS
* Adds attribute mapping for username, firstname, lastname, email
* Initializes rhodecode user using LDAP info (no longer uses "@ldap")
* Remembers the user object (DN) in the user table
* Updates admin interfaces
* Authenticates against actual user objects in LDAP
* Possibly other things.
Really, this should be extended to a list of LDAP configurations, but this is a good start.
07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 2f83756f3041 2f83756f3041 2f83756f3041 2f83756f3041 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 2f83756f3041 2f83756f3041 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 2f83756f3041 2f83756f3041 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b de560c47dd03 07f248329a3b 07f248329a3b de560c47dd03 07f248329a3b 07f248329a3b de560c47dd03 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b 07f248329a3b | import logging
import datetime
from sqlalchemy import *
from sqlalchemy.exc import DatabaseError
from sqlalchemy.orm import relation, backref, class_mapper
from sqlalchemy.orm.session import Session
from rhodecode.lib.dbmigrate.migrate import *
from rhodecode.lib.dbmigrate.migrate.changeset import *
from rhodecode.model.meta import Base
from rhodecode.model.db import BaseModel
log = logging.getLogger(__name__)
def upgrade(migrate_engine):
""" Upgrade operations go here.
Don't create your own engine; bind migrate_engine to your metadata
"""
#==========================================================================
# Add table `groups``
#==========================================================================
from rhodecode.model.db import Group
Group().__table__.create()
#==========================================================================
# Add table `group_to_perm`
#==========================================================================
from rhodecode.model.db import GroupToPerm
GroupToPerm().__table__.create()
#==========================================================================
# Upgrade of `repositories` table
#==========================================================================
from rhodecode.model.db import Repository
#ADD group_id column#
group_id = Column("group_id", Integer(), ForeignKey('groups.group_id'),
nullable=True, unique=False, default=None)
group_id.create(Repository().__table__)
return
def downgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
|