|
52 | 52 | ) |
53 | 53 |
|
54 | 54 | # 自定义中间件 |
55 | | -MIDDLEWARE += ( |
| 55 | +MIDDLEWARE = ( |
| 56 | + # request instance provider |
| 57 | + "blueapps.middleware.request_provider.RequestProvider", |
| 58 | + "django.contrib.sessions.middleware.SessionMiddleware", |
| 59 | + "django.middleware.common.CommonMiddleware", |
| 60 | + "django.middleware.csrf.CsrfViewMiddleware", |
| 61 | + "django.contrib.auth.middleware.AuthenticationMiddleware", |
| 62 | + "django.contrib.messages.middleware.MessageMiddleware", |
| 63 | + # 跨域检测中间件, 默认关闭 |
| 64 | + # 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 65 | + "django.middleware.security.SecurityMiddleware", |
| 66 | + # 蓝鲸静态资源服务 |
| 67 | + "whitenoise.middleware.WhiteNoiseMiddleware", |
| 68 | + # Auth middleware |
| 69 | + "blueapps.account.middlewares.RioLoginRequiredMiddleware", |
| 70 | + "blueapps.account.middlewares.WeixinLoginRequiredMiddleware", |
| 71 | + "blueapps.account.middlewares.LoginRequiredMiddleware", |
56 | 72 | # "blueapps.account.middlewares.BkJwtLoginRequiredMiddleware", |
57 | | - "apps.middlewares.CommonMid", |
58 | | - "apps.middlewares.UserLocalMiddleware", |
59 | 73 | "apigw_manager.apigw.authentication.ApiGatewayJWTGenericMiddleware", # JWT 认证 |
60 | 74 | "apigw_manager.apigw.authentication.ApiGatewayJWTAppMiddleware", # JWT 透传的应用信息 |
61 | | - "apigw_manager.apigw.authentication.ApiGatewayJWTUserMiddleware", # JWT 透传的用户信息 |
| 75 | + "apps.middlewares.ApiGatewayJWTUserInjectAppMiddleware", # JWT 透传的用户信息 |
| 76 | + # exception middleware |
| 77 | + "blueapps.core.exceptions.middleware.AppExceptionMiddleware", |
| 78 | + "django.middleware.locale.LocaleMiddleware", |
| 79 | + "apps.middlewares.CommonMid", |
| 80 | + "apps.middlewares.UserLocalMiddleware", |
62 | 81 | ) |
63 | 82 |
|
64 | 83 | # 添加django_prometheus中间件 |
|
77 | 96 | # =============================================================================== |
78 | 97 | # Authentication |
79 | 98 | # =============================================================================== |
80 | | -AUTHENTICATION_BACKENDS += ( |
| 99 | +AUTHENTICATION_BACKENDS = ( |
81 | 100 | # "blueapps.account.backends.BkJwtBackend", |
82 | 101 | "apigw_manager.apigw.authentication.UserModelBackend", |
| 102 | + "blueapps.account.backends.RioBackend", |
| 103 | + "blueapps.account.backends.WeixinBackend", |
| 104 | + "blueapps.account.backends.UserBackend", |
83 | 105 | ) |
84 | 106 |
|
85 | 107 | # 所有环境的日志级别可以在这里配置 |
|
0 commit comments