# Generated by Django 2.2.13 on 2020-09-04 14:59

import cms.models.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import djangocms_oidc.models


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='OIDCDisplayDedicatedContent',
            fields=[
                ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='djangocms_oidc_oidcdisplaydedicatedcontent', serialize=False, to='cms.CMSPlugin')),
                ('conditions', models.CharField(blank=True, choices=[('email_verified', 'Email verified')], help_text='Show content only if the given conditions are met.', max_length=255, null=True, verbose_name='Conditions')),
            ],
            options={
                'abstract': False,
            },
            bases=('cms.cmsplugin',),
        ),
        migrations.CreateModel(
            name='OIDCRegisterConsumer',
            fields=[
                ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='djangocms_oidc_oidcregisterconsumer', serialize=False, to='cms.CMSPlugin')),
                ('name', models.CharField(default='Default', help_text='Registration name', max_length=255, unique=True, verbose_name='Name')),
                ('register_url', models.URLField(help_text='Register consumer automaticaly, when it is not. (Client ID and secret missing).', verbose_name='Register consumer URL')),
            ],
            options={
                'abstract': False,
            },
            bases=('cms.cmsplugin',),
        ),
        migrations.CreateModel(
            name='OIDCShowAttribute',
            fields=[
                ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='djangocms_oidc_oidcshowattribute', serialize=False, to='cms.CMSPlugin')),
                ('verified_by', models.CharField(default='name', help_text='Verified by names (separated by space). Eg.: name given_name+family_name preferred_username nickname email openid2_id', max_length=255, verbose_name='Verified by names')),
                ('default_value', models.CharField(blank=True, help_text='Show this text when attribute has not been handovered.', max_length=255, null=True, verbose_name='Default value')),
                ('css_names', models.CharField(blank=True, help_text='Extra class names (separated by space).', max_length=255, null=True, verbose_name='CSS names')),
            ],
            options={
                'abstract': False,
            },
            bases=('cms.cmsplugin',),
        ),
        migrations.CreateModel(
            name='OIDCProvider',
            fields=[
                ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='djangocms_oidc_oidcprovider', serialize=False, to='cms.CMSPlugin')),
                ('name', models.CharField(help_text='Provider name', max_length=255, unique=True, verbose_name='Name')),
                ('slug', models.SlugField(help_text='Used, for example, as a css class for a button or link.', verbose_name='Code')),
                ('client_id', models.CharField(blank=True, help_text='The value is required if "Register consumer" is not set.', max_length=255, null=True, verbose_name='Client ID')),
                ('client_secret', models.CharField(blank=True, help_text='The value is required if "Register consumer" is not set.', max_length=255, null=True, verbose_name='Client secret')),
                ('authorization_endpoint', models.URLField(verbose_name='Authorization endpoint')),
                ('token_endpoint', models.URLField(verbose_name='Token endpoint')),
                ('user_endpoint', models.URLField(verbose_name='User endpoint')),
                ('account_url', models.URLField(blank=True, null=True, verbose_name='Account URL')),
                ('logout_url', models.URLField(blank=True, null=True, verbose_name='Logout URL')),
                ('register_consumer', models.ForeignKey(blank=True, help_text='Register consumer on the provider, when Client ID and secret are not set.', null=True, on_delete=django.db.models.deletion.CASCADE, to='djangocms_oidc.OIDCRegisterConsumer', verbose_name='Register consumer')),
            ],
            options={
                'abstract': False,
            },
            bases=('cms.cmsplugin',),
        ),
        migrations.CreateModel(
            name='OIDCLogin',
            fields=[
                ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='djangocms_oidc_oidclogin', serialize=False, to='cms.CMSPlugin')),
                ('claims', models.JSONField(default=dict, help_text='Claims attributes for data handover.', validators=[djangocms_oidc.models.validate_claims], verbose_name='Claims')),
                ('insist_on_required_claims', models.BooleanField(default=False, help_text='Consider the data invalid if not all the required data has been handovered.', verbose_name='Insist on required claims')),
                ('verified_by', models.CharField(blank=True, help_text='Verified by names (separated by space).', max_length=255, null=True, verbose_name='Verified by names')),
                ('authorization_prompt', models.CharField(blank=True, choices=[('none', 'No interaction'), ('login', 'Force login'), ('consent', 'Force consent with handovered data')], help_text='Prompt for user at authorization. "No interaction" cannot be combined with others.', max_length=255, null=True, verbose_name='Prompt')),
                ('no_new_user', models.BooleanField(default=False, help_text='Do not create a new user account if the user is not recognized.', verbose_name='No new user')),
                ('provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='djangocms_oidc.OIDCProvider')),
                ('redirect_page', cms.models.fields.PageField(blank=True, help_text='Redirect to the page after login or hangover data.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='cms.Page', verbose_name='CMS Page')),
            ],
            options={
                'abstract': False,
            },
            bases=('cms.cmsplugin',),
        ),
        migrations.CreateModel(
            name='OIDCIdentifier',
            fields=[
                ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='djangocms_oidc_oidcidentifier', serialize=False, to='cms.CMSPlugin')),
                ('uident', models.CharField(help_text='Provider unique identifier.', max_length=255, unique=True, verbose_name='Identifier')),
                ('provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='djangocms_oidc.OIDCProvider')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            bases=('cms.cmsplugin',),
        ),
        migrations.CreateModel(
            name='OIDCHandoverData',
            fields=[
                ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='djangocms_oidc_oidchandoverdata', serialize=False, to='cms.CMSPlugin')),
                ('claims', models.JSONField(default=dict, help_text='Claims attributes for data handover.', validators=[djangocms_oidc.models.validate_claims], verbose_name='Claims')),
                ('insist_on_required_claims', models.BooleanField(default=False, help_text='Consider the data invalid if not all the required data has been handovered.', verbose_name='Insist on required claims')),
                ('verified_by', models.CharField(blank=True, help_text='Verified by names (separated by space).', max_length=255, null=True, verbose_name='Verified by names')),
                ('authorization_prompt', models.CharField(blank=True, choices=[('none', 'No interaction'), ('login', 'Force login'), ('consent', 'Force consent with handovered data')], help_text='Prompt for user at authorization. "No interaction" cannot be combined with others.', max_length=255, null=True, verbose_name='Prompt')),
                ('provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='djangocms_oidc.OIDCProvider')),
                ('redirect_page', cms.models.fields.PageField(blank=True, help_text='Redirect to the page after login or hangover data.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='cms.Page', verbose_name='CMS Page')),
            ],
            options={
                'abstract': False,
            },
            bases=('cms.cmsplugin',),
        ),
    ]
