From 52101007aa94bde10158ca8a1daf40404deffa89 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 25 Sep 2020 16:51:32 +0200 Subject: [PATCH] e2e: bump chrome version --- e2e/ci.docker-compose.yml | 2 +- e2e/docker-compose.yml | 2 +- ..._1432.py => 0003_default_setup_flow.py.py} | 0 .../0003_otptimestage_configure_flow.py | 28 ------------- .../migrations/0004_default_setup_flow.py | 42 +++++++++++++++++++ swagger.yaml | 17 +++++--- 6 files changed, 56 insertions(+), 35 deletions(-) rename passbook/stages/otp_static/migrations/{0003_auto_20200925_1432.py => 0003_default_setup_flow.py.py} (100%) create mode 100644 passbook/stages/otp_time/migrations/0004_default_setup_flow.py diff --git a/e2e/ci.docker-compose.yml b/e2e/ci.docker-compose.yml index cd13dc1f8..a996a3425 100644 --- a/e2e/ci.docker-compose.yml +++ b/e2e/ci.docker-compose.yml @@ -2,7 +2,7 @@ version: '3.7' services: chrome: - image: selenium/standalone-chrome:3.141.59-20200525 + image: selenium/standalone-chrome:3.141 volumes: - /dev/shm:/dev/shm network_mode: host diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index 35bd99735..7f92cba9a 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.7' services: chrome: - image: selenium/standalone-chrome-debug:3.141.59-20200719 + image: selenium/standalone-chrome-debug:3.141 volumes: - /dev/shm:/dev/shm network_mode: host diff --git a/passbook/stages/otp_static/migrations/0003_auto_20200925_1432.py b/passbook/stages/otp_static/migrations/0003_default_setup_flow.py.py similarity index 100% rename from passbook/stages/otp_static/migrations/0003_auto_20200925_1432.py rename to passbook/stages/otp_static/migrations/0003_default_setup_flow.py.py diff --git a/passbook/stages/otp_time/migrations/0003_otptimestage_configure_flow.py b/passbook/stages/otp_time/migrations/0003_otptimestage_configure_flow.py index e26e37a5b..d27bc41f0 100644 --- a/passbook/stages/otp_time/migrations/0003_otptimestage_configure_flow.py +++ b/passbook/stages/otp_time/migrations/0003_otptimestage_configure_flow.py @@ -1,35 +1,7 @@ # Generated by Django 3.1.1 on 2020-09-25 10:39 import django.db.models.deletion -from django.apps.registry import Apps from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - -from passbook.flows.models import FlowDesignation -from passbook.stages.otp_time.models import TOTPDigits - - -def create_default_setup_flow(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - Flow = apps.get_model("passbook_flows", "Flow") - FlowStageBinding = apps.get_model("passbook_flows", "FlowStageBinding") - - OTPTimeStage = apps.get_model("passbook_stages_otp_time", "OTPTimeStage") - - db_alias = schema_editor.connection.alias - - flow, _ = Flow.objects.using(db_alias).update_or_create( - slug="default-otp-time-configure", - designation=FlowDesignation.STAGE_CONFIGURATION, - defaults={"name": "Setup Two-Factor authentication"}, - ) - - stage, _ = OTPTimeStage.objects.using(db_alias).update_or_create( - name="default-otp-time-configure", defaults={"digits": TOTPDigits.SIX} - ) - - FlowStageBinding.objects.using(db_alias).update_or_create( - target=flow, stage=stage, defaults={"order": 0} - ) class Migration(migrations.Migration): diff --git a/passbook/stages/otp_time/migrations/0004_default_setup_flow.py b/passbook/stages/otp_time/migrations/0004_default_setup_flow.py new file mode 100644 index 000000000..ee685b73b --- /dev/null +++ b/passbook/stages/otp_time/migrations/0004_default_setup_flow.py @@ -0,0 +1,42 @@ +# Generated by Django 3.1.1 on 2020-09-25 15:36 + +from django.apps.registry import Apps +from django.db import migrations +from django.db.backends.base.schema import BaseDatabaseSchemaEditor + +from passbook.flows.models import FlowDesignation +from passbook.stages.otp_time.models import TOTPDigits + + +def create_default_setup_flow(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): + Flow = apps.get_model("passbook_flows", "Flow") + FlowStageBinding = apps.get_model("passbook_flows", "FlowStageBinding") + + OTPTimeStage = apps.get_model("passbook_stages_otp_time", "OTPTimeStage") + + db_alias = schema_editor.connection.alias + + flow, _ = Flow.objects.using(db_alias).update_or_create( + slug="default-otp-time-configure", + designation=FlowDesignation.STAGE_CONFIGURATION, + defaults={"name": "Setup Two-Factor authentication"}, + ) + + stage, _ = OTPTimeStage.objects.using(db_alias).update_or_create( + name="default-otp-time-configure", defaults={"digits": TOTPDigits.SIX} + ) + + FlowStageBinding.objects.using(db_alias).update_or_create( + target=flow, stage=stage, defaults={"order": 0} + ) + + +class Migration(migrations.Migration): + + dependencies = [ + ("passbook_stages_otp_time", "0003_otptimestage_configure_flow"), + ] + + operations = [ + migrations.RunPython(create_default_setup_flow), + ] diff --git a/swagger.yaml b/swagger.yaml index a39a79ed6..8debe8ca3 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -6088,7 +6088,7 @@ definitions: - enrollment - unenrollment - recovery - - stage_setup + - stage_configuration stages: type: array items: @@ -7412,6 +7412,13 @@ definitions: title: Name type: string minLength: 1 + configure_flow: + title: Configure flow + description: Flow used by an authenticated user to configure this Stage. If + empty, user will not be able to configure this stage. + type: string + format: uuid + x-nullable: true digits: title: Digits type: integer @@ -7454,10 +7461,10 @@ definitions: title: Backends type: string minLength: 1 - change_flow: - title: Change flow - description: Flow used by an authenticated user to change their password. - If empty, user will be unable to change their password. + configure_flow: + title: Configure flow + description: Flow used by an authenticated user to configure this Stage. If + empty, user will not be able to configure this stage. type: string format: uuid x-nullable: true