2021-09-09 06:00:50 +00:00
|
|
|
# coding: utf-8
|
|
|
|
#
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
__all__ = ['RadiusSettingSerializer']
|
2021-09-09 06:00:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RadiusSettingSerializer(serializers.Serializer):
|
2021-11-01 03:01:24 +00:00
|
|
|
AUTH_RADIUS = serializers.BooleanField(required=False, label=_('Enable Radius Auth'))
|
|
|
|
RADIUS_SERVER = serializers.CharField(required=False, allow_blank=True, max_length=1024, label=_('Host'))
|
2021-09-09 06:00:50 +00:00
|
|
|
RADIUS_PORT = serializers.IntegerField(required=False, label=_('Port'))
|
2022-05-20 02:01:41 +00:00
|
|
|
RADIUS_SECRET = EncryptedField(
|
|
|
|
required=False, max_length=1024, allow_null=True, label=_('Secret'),
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|
2021-11-01 03:01:24 +00:00
|
|
|
OTP_IN_RADIUS = serializers.BooleanField(required=False, label=_('OTP in Radius'))
|