2021-09-09 06:00:50 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from rest_framework import serializers
|
|
|
|
|
2022-05-20 02:01:41 +00:00
|
|
|
from common.drf.fields import EncryptedField
|
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
__all__ = ['DingTalkSettingSerializer']
|
|
|
|
|
|
|
|
|
|
|
|
class DingTalkSettingSerializer(serializers.Serializer):
|
2022-11-04 06:22:38 +00:00
|
|
|
PREFIX_TITLE = '%s-%s' % (_('Authentication'), _('DingTalk'))
|
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
DINGTALK_AGENTID = serializers.CharField(max_length=256, required=True, label='AgentId')
|
|
|
|
DINGTALK_APPKEY = serializers.CharField(max_length=256, required=True, label='AppKey')
|
2022-05-20 02:01:41 +00:00
|
|
|
DINGTALK_APPSECRET = EncryptedField(max_length=256, required=False, label='AppSecret')
|
2021-09-09 06:00:50 +00:00
|
|
|
AUTH_DINGTALK = serializers.BooleanField(default=False, label=_('Enable DingTalk Auth'))
|