mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-24 21:08:30 +00:00
perf: 虚拟账号增加密码选项 (#11201)
* perf: 修改账号配置 * perf: 修改 account * perf: 修改 virtual account * perf: 虚拟账号增加密码选项 * perf: 修改获取虚拟账号 * perf: 修改 virtual account * perf: 修改一些写法 * perf: 添加说明 --------- Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
26
apps/accounts/serializers/account/virtual.py
Normal file
26
apps/accounts/serializers/account/virtual.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from rest_framework import serializers
|
||||
|
||||
from accounts.models import VirtualAccount
|
||||
|
||||
__all__ = ['VirtualAccountSerializer']
|
||||
|
||||
|
||||
class VirtualAccountSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = VirtualAccount
|
||||
field_mini = ['id', 'alias', 'username', 'name']
|
||||
common_fields = ['date_created', 'date_updated', 'comment']
|
||||
fields = field_mini + [
|
||||
'secret_from_login',
|
||||
] + common_fields
|
||||
read_only_fields = common_fields + common_fields
|
||||
extra_kwargs = {
|
||||
'comment': {'label': _('Comment')},
|
||||
'name': {'label': _('Name')},
|
||||
'username': {'label': _('Username')},
|
||||
'secret_from_login': {'help_text': _('Current only support login from AD/LDAP. Secret priority: '
|
||||
'Same account in asset secret > Login secret > Manual input')
|
||||
},
|
||||
'alias': {'required': False},
|
||||
}
|
Reference in New Issue
Block a user