Move LDAP Source to DB
This commit is contained in:
parent
bcf9db59e2
commit
98e10a1ca9
35
passbook/ldap/migrations/0001_initial.py
Normal file
35
passbook/ldap/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# 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',),
|
||||||
|
),
|
||||||
|
]
|
0
passbook/ldap/migrations/__init__.py
Normal file
0
passbook/ldap/migrations/__init__.py
Normal file
|
@ -1,11 +1,37 @@
|
||||||
# """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,
|
# from passbook.core.models import (CreatedUpdatedModel, ProductExtension,
|
||||||
# UUIDModel)
|
# 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):
|
# class LDAPModification(UUIDModel, CreatedUpdatedModel):
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"""Oauth2 provider product extension"""
|
"""Oauth2 provider product extension"""
|
||||||
|
|
||||||
|
from django.utils.translation import gettext as _
|
||||||
from oauth2_provider.models import AbstractApplication
|
from oauth2_provider.models import AbstractApplication
|
||||||
|
|
||||||
from passbook.core.models import Provider
|
from passbook.core.models import Provider
|
||||||
from django.utils.translation import gettext as _
|
|
||||||
|
|
||||||
|
|
||||||
class OAuth2Provider(Provider, AbstractApplication):
|
class OAuth2Provider(Provider, AbstractApplication):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Generated by Django 2.1.3 on 2018-11-26 15:09
|
# Generated by Django 2.1.3 on 2018-11-26 15:09
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
"""passbook saml_idp Models"""
|
"""passbook saml_idp Models"""
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from passbook.core.models import Provider
|
from passbook.core.models import Provider
|
||||||
from passbook.lib.utils.reflection import class_to_path
|
from passbook.lib.utils.reflection import class_to_path
|
||||||
from passbook.saml_idp.base import Processor
|
from passbook.saml_idp.base import Processor
|
||||||
from django.utils.translation import gettext as _
|
|
||||||
|
|
||||||
|
|
||||||
class SAMLProvider(Provider):
|
class SAMLProvider(Provider):
|
||||||
|
|
Reference in a new issue