diff --git a/src/bk-user/bkuser/apis/web/idp/serializers.py b/src/bk-user/bkuser/apis/web/idp/serializers.py index acf84f85e..6efc025d5 100644 --- a/src/bk-user/bkuser/apis/web/idp/serializers.py +++ b/src/bk-user/bkuser/apis/web/idp/serializers.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from typing import List, Dict, Any +from typing import Any, Dict, List from django.utils.translation import gettext_lazy as _ from drf_yasg.utils import swagger_serializer_method @@ -16,12 +16,12 @@ from rest_framework import serializers from rest_framework.exceptions import ValidationError +from bkuser.apps.data_source.models import DataSource from bkuser.apps.idp.constants import IdpStatus from bkuser.apps.idp.models import Idp, IdpPlugin -from bkuser.apps.data_source.models import DataSource from bkuser.apps.tenant.models import TenantUserCustomField, UserBuiltinField -from bkuser.idp_plugins.constants import BuiltinIdpPluginEnum from bkuser.idp_plugins.base import get_plugin_cfg_cls +from bkuser.idp_plugins.constants import BuiltinIdpPluginEnum from bkuser.utils.pydantic import stringify_pydantic_error diff --git a/src/bk-user/bkuser/apis/web/idp/views.py b/src/bk-user/bkuser/apis/web/idp/views.py index e8cea0228..45ca0df0c 100644 --- a/src/bk-user/bkuser/apis/web/idp/views.py +++ b/src/bk-user/bkuser/apis/web/idp/views.py @@ -15,21 +15,22 @@ from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response -from bkuser.apps.idp.models import Idp, IdpPlugin -from bkuser.apps.data_source.models import DataSource from bkuser.apis.web.mixins import CurrentUserTenantMixin +from bkuser.apps.data_source.models import DataSource +from bkuser.apps.idp.models import Idp, IdpPlugin from bkuser.apps.permission.constants import PermAction from bkuser.apps.permission.permissions import perm_class -from bkuser.idp_plugins.base import get_plugin_cfg_schema_map from bkuser.common.error_codes import error_codes +from bkuser.idp_plugins.base import get_plugin_cfg_schema_map + from .serializers import ( - IdpPluginOutputSLZ, - IdpSearchInputSLZ, - IdpSearchOutputSLZ, IdpCreateInputSLZ, IdpCreateOutputSLZ, - IdpRetrieveOutputSLZ, IdpPartialUpdateInputSLZ, + IdpPluginOutputSLZ, + IdpRetrieveOutputSLZ, + IdpSearchInputSLZ, + IdpSearchOutputSLZ, IdpUpdateInputSLZ, ) diff --git a/src/bk-user/bkuser/apps/idp/models.py b/src/bk-user/bkuser/apps/idp/models.py index f5865589f..9d3472e7c 100644 --- a/src/bk-user/bkuser/apps/idp/models.py +++ b/src/bk-user/bkuser/apps/idp/models.py @@ -11,16 +11,16 @@ from typing import List from urllib.parse import urljoin -from django.db import models from django.conf import settings +from django.db import models from bkuser.common.models import AuditedModel +from bkuser.idp_plugins.base import get_plugin_type +from bkuser.idp_plugins.constants import BuiltinIdpPluginEnum, PluginTypeEnum from bkuser.utils.uuid import generate_uuid from .constants import IdpStatus -from .data_models import DataSourceMatchRuleList, DataSourceMatchRule -from bkuser.idp_plugins.base import get_plugin_type -from bkuser.idp_plugins.constants import PluginTypeEnum, BuiltinIdpPluginEnum +from .data_models import DataSourceMatchRule, DataSourceMatchRuleList class IdpPlugin(models.Model): diff --git a/src/bk-user/bkuser/common/constants.py b/src/bk-user/bkuser/common/constants.py index 9752559c4..25aae6793 100644 --- a/src/bk-user/bkuser/common/constants.py +++ b/src/bk-user/bkuser/common/constants.py @@ -19,9 +19,7 @@ class BkLanguageEnum(str, StructuredEnum): # 永久:2100-01-01 00:00:00 UTC -PERMANENT_TIME = datetime.datetime( - year=2100, month=1, day=1, hour=0, minute=0, second=0, tzinfo=datetime.timezone.utc -) +PERMANENT_TIME = datetime.datetime(year=2100, month=1, day=1, hour=0, minute=0, second=0, tzinfo=datetime.timezone.utc) # 敏感信息掩码(7 位 * 是故意的,避免遇到用户输入 6/8 位 * 的情况) SENSITIVE_MASK = "*******"