2023-07-24 03:52:25 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2021-09-09 06:00:50 +00:00
|
|
|
from rest_framework import serializers
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
'CASSettingSerializer',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
class CASSettingSerializer(serializers.Serializer):
|
2023-02-23 08:38:44 +00:00
|
|
|
PREFIX_TITLE = _('CAS')
|
2022-11-04 06:22:38 +00:00
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
AUTH_CAS = serializers.BooleanField(required=False, label=_('Enable CAS Auth'))
|
|
|
|
CAS_SERVER_URL = serializers.CharField(required=False, max_length=1024, label=_('Server url'))
|
2022-03-29 10:27:28 +00:00
|
|
|
CAS_ROOT_PROXIED_AS = serializers.CharField(
|
|
|
|
required=False, allow_null=True, allow_blank=True,
|
|
|
|
max_length=1024, label=_('Proxy server url')
|
|
|
|
)
|
2021-09-09 06:00:50 +00:00
|
|
|
CAS_LOGOUT_COMPLETELY = serializers.BooleanField(required=False, label=_('Logout completely'))
|
2022-03-29 10:27:28 +00:00
|
|
|
CAS_VERSION = serializers.IntegerField(
|
|
|
|
required=False, label=_('Version'), min_value=1, max_value=3
|
|
|
|
)
|
|
|
|
CAS_USERNAME_ATTRIBUTE = serializers.CharField(
|
|
|
|
required=False, max_length=1024, label=_('Username attr')
|
|
|
|
)
|
|
|
|
CAS_APPLY_ATTRIBUTES_TO_USER = serializers.BooleanField(
|
|
|
|
required=False, label=_('Enable attributes map')
|
|
|
|
)
|
2023-06-08 02:06:14 +00:00
|
|
|
CAS_RENAME_ATTRIBUTES = serializers.JSONField(required=False, label=_('Rename attr'))
|
2021-09-09 06:00:50 +00:00
|
|
|
CAS_CREATE_USER = serializers.BooleanField(required=False, label=_('Create user if not'))
|