Commit 98e10a1c authored by Jens Langhammer's avatar Jens Langhammer

Move LDAP Source to DB

parent bcf9db59
# Generated by Django 2.1.3 on 2018-11-26 15:17
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('passbook_core', '0003_rule_order'),
]
operations = [
migrations.CreateModel(
name='LDAPSource',
fields=[
('source_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='passbook_core.Source')),
('server_uri', models.TextField()),
('bind_cn', models.TextField()),
('bind_password', models.TextField()),
('type', models.CharField(choices=[('ad', 'ad'), ('generic', 'generic')], max_length=20)),
('domain', models.TextField()),
('base_dn', models.TextField()),
('create_user', models.BooleanField(default=False)),
('reset_password', models.BooleanField(default=True)),
],
options={
'verbose_name': 'LDAP Source',
'verbose_name_plural': 'LDAP Sources',
},
bases=('passbook_core.source',),
),
]
# """Supervisr mod_ldap Models"""
"""passbook LDAP Models"""
# from django.contrib.auth.models import Group
# from django.db import models
from django.db import models
from django.utils.translation import gettext as _
# from supervisr.core.fields import JSONField
# from passbook.core.models import (CreatedUpdatedModel, ProductExtension,
# UUIDModel)
from passbook.core.models import Source
class LDAPSource(Source):
"""LDAP Authentication source"""
TYPE_ACTIVE_DIRECTORY = 'ad'
TYPE_GENERIC = 'generic'
TYPES = (
(TYPE_ACTIVE_DIRECTORY, TYPE_ACTIVE_DIRECTORY),
(TYPE_GENERIC, TYPE_GENERIC),
)
server_uri = models.TextField()
bind_cn = models.TextField()
bind_password = models.TextField()
type = models.CharField(max_length=20, choices=TYPES)
domain = models.TextField()
base_dn = models.TextField()
create_user = models.BooleanField(default=False)
reset_password = models.BooleanField(default=True)
class Meta:
verbose_name = _('LDAP Source')
verbose_name_plural = _('LDAP Sources')
# class LDAPModification(UUIDModel, CreatedUpdatedModel):
......
"""Oauth2 provider product extension"""
from django.utils.translation import gettext as _
from oauth2_provider.models import AbstractApplication
from passbook.core.models import Provider
from django.utils.translation import gettext as _
class OAuth2Provider(Provider, AbstractApplication):
......
# Generated by Django 2.1.3 on 2018-11-26 15:09
from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
......
"""passbook saml_idp Models"""
from django.db import models
from django.utils.translation import gettext as _
from passbook.core.models import Provider
from passbook.lib.utils.reflection import class_to_path
from passbook.saml_idp.base import Processor
from django.utils.translation import gettext as _
class SAMLProvider(Provider):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment