mirror of https://github.com/jumpserver/jumpserver
parent
2c73611cb4
commit
d675b1d4fc
|
@ -4,6 +4,7 @@ from django.db.models import Count
|
||||||
|
|
||||||
from common.mixins.serializers import BulkSerializerMixin
|
from common.mixins.serializers import BulkSerializerMixin
|
||||||
from common.utils import ssh_pubkey_gen
|
from common.utils import ssh_pubkey_gen
|
||||||
|
from common.drf.fields import EncryptedField
|
||||||
from common.validators import alphanumeric_re, alphanumeric_cn_re, alphanumeric_win_re
|
from common.validators import alphanumeric_re, alphanumeric_cn_re, alphanumeric_win_re
|
||||||
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
|
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
|
||||||
from ..models import SystemUser, Asset
|
from ..models import SystemUser, Asset
|
||||||
|
@ -26,6 +27,9 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
|
||||||
auto_generate_key = serializers.BooleanField(initial=True, required=False, write_only=True)
|
auto_generate_key = serializers.BooleanField(initial=True, required=False, write_only=True)
|
||||||
type_display = serializers.ReadOnlyField(source='get_type_display', label=_('Type display'))
|
type_display = serializers.ReadOnlyField(source='get_type_display', label=_('Type display'))
|
||||||
ssh_key_fingerprint = serializers.ReadOnlyField(label=_('SSH key fingerprint'))
|
ssh_key_fingerprint = serializers.ReadOnlyField(label=_('SSH key fingerprint'))
|
||||||
|
token = EncryptedField(
|
||||||
|
label=_('Token'), required=False, write_only=True, style={'base_template': 'textarea.html'}
|
||||||
|
)
|
||||||
applications_amount = serializers.IntegerField(
|
applications_amount = serializers.IntegerField(
|
||||||
source='apps_amount', read_only=True, label=_('Apps amount')
|
source='apps_amount', read_only=True, label=_('Apps amount')
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue