File tree 5 files changed +32
-18
lines changed
configurations/migrations
5 files changed +32
-18
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ django-elasticsearch-dsl==7.2.1
312
312
# via
313
313
# -c requirements/ci.txt
314
314
# -r requirements/ci.txt
315
- django-extensions==3.1 .3
315
+ django-extensions==3.2 .3
316
316
# via -r requirements/dev.in
317
317
django-extra-fields==3.0.2
318
318
# via
Original file line number Diff line number Diff line change 480
480
"open_inwoner.accounts.backends.CustomOIDCBackend" ,
481
481
]
482
482
483
- # Allowing OIDC admins to bypass 2FA
484
- MAYKIN_2FA_ALLOW_MFA_BYPASS_BACKENDS = [
485
- "open_inwoner.accounts.backends.CustomOIDCBackend" ,
486
- ]
487
-
488
483
489
484
SESSION_COOKIE_NAME = "open_inwoner_sessionid"
490
485
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
609
604
ADMIN_INDEX_SHOW_REMAINING_APPS = False
610
605
ADMIN_INDEX_AUTO_CREATE_APP_GROUP = False
611
606
ADMIN_INDEX_SHOW_REMAINING_APPS_TO_SUPERUSERS = False
607
+ ADMIN_INDEX_SHOW_MENU = True
608
+ ADMIN_INDEX_DISPLAY_DROP_DOWN_MENU_CONDITION_FUNCTION = (
609
+ "open_inwoner.utils.django_two_factor_auth.should_display_dropdown_menu"
610
+ )
611
+
612
612
613
613
#
614
614
# DJANGO-AXES (4.0+)
816
816
TWO_FACTOR_PATCH_ADMIN = False
817
817
TWO_FACTOR_WEBAUTHN_RP_NAME = f"OpenInwoner { ENVIRONMENT } "
818
818
TWO_FACTOR_WEBAUTHN_AUTHENTICATOR_ATTACHMENT = "cross-platform"
819
+ # Allow OIDC admins to bypass 2FA
820
+ MAYKIN_2FA_ALLOW_MFA_BYPASS_BACKENDS = [
821
+ "open_inwoner.accounts.backends.CustomOIDCBackend" ,
822
+ ]
819
823
820
824
# file upload limits
821
825
MIN_UPLOAD_SIZE = 1 # in bytes
Original file line number Diff line number Diff line change 60
60
# Django privates
61
61
SENDFILE_BACKEND = "django_sendfile.backends.development"
62
62
63
- # Two factor auth
64
- TWO_FACTOR_FORCE_OTP_ADMIN = False
65
- TWO_FACTOR_PATCH_ADMIN = False
66
-
67
63
# THOU SHALT NOT USE NAIVE DATETIMES
68
64
warnings .filterwarnings (
69
65
"error" ,
Original file line number Diff line number Diff line change
1
+ # Generated by Django 3.2.23 on 2024-02-07 15:19
2
+
3
+ from django .db import migrations
4
+
5
+
6
+ class Migration (migrations .Migration ):
7
+
8
+ dependencies = [
9
+ ("configurations" , "0058_siteconfiguration_recipients_email_digest" ),
10
+ ]
11
+
12
+ operations = [
13
+ migrations .AlterModelOptions (
14
+ name = "siteconfigurationpage" ,
15
+ options = {
16
+ "ordering" : ("order" ,),
17
+ "verbose_name" : "Flatpage in the footer" ,
18
+ "verbose_name_plural" : "Flatpages in the footer" ,
19
+ },
20
+ ),
21
+ ]
Original file line number Diff line number Diff line change 1
- from django .conf import settings
2
-
3
1
from django_admin_index .utils import (
4
2
should_display_dropdown_menu as default_should_display_dropdown_menu ,
5
3
)
8
6
def should_display_dropdown_menu (request ) -> bool :
9
7
default = default_should_display_dropdown_menu (request )
10
8
11
- two_factor_enabled = settings .TWO_FACTOR_PATCH_ADMIN
12
- if not two_factor_enabled :
13
- return default
14
-
15
- # never display the dropdown in two-factor admin views
16
- if request .resolver_match .view_name .startswith ("admin:two_factor:" ):
9
+ if request .resolver_match .view_name .startswith ("maykin_2fa" ):
17
10
return False
18
11
19
12
return default and request .user .is_verified ()
You can’t perform that action at this time.
0 commit comments