mirror of https://github.com/jumpserver/jumpserver
fix: 修复 connection token 相关的返回字段
parent
2c952c2877
commit
37f119260e
|
@ -1,8 +1,9 @@
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
from rest_framework import serializers
|
||||
|
||||
from common.serializers.fields import EncryptedField
|
||||
from perms.serializers.permission import ActionChoicesField
|
||||
from orgs.mixins.serializers import OrgResourceModelSerializerMixin
|
||||
from common.serializers.fields import EncryptedField
|
||||
from ..models import ConnectionToken
|
||||
|
||||
__all__ = [
|
||||
|
@ -16,6 +17,7 @@ class ConnectionTokenSerializer(OrgResourceModelSerializerMixin):
|
|||
label=_("Input secret"), max_length=40960, required=False, allow_blank=True
|
||||
)
|
||||
from_ticket_info = serializers.SerializerMethodField(label=_("Ticket info"))
|
||||
actions = ActionChoicesField()
|
||||
|
||||
class Meta:
|
||||
model = ConnectionToken
|
||||
|
@ -29,7 +31,7 @@ class ConnectionTokenSerializer(OrgResourceModelSerializerMixin):
|
|||
]
|
||||
read_only_fields = [
|
||||
# 普通 Token 不支持指定 user
|
||||
'user', 'expire_time',
|
||||
'user', 'expire_time', 'is_expired',
|
||||
'user_display', 'asset_display',
|
||||
]
|
||||
fields = fields_small + read_only_fields
|
||||
|
|
Loading…
Reference in New Issue