2021-09-09 06:00:50 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from rest_framework import serializers
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
'SSOSettingSerializer',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
class SSOSettingSerializer(serializers.Serializer):
|
2022-11-04 06:22:38 +00:00
|
|
|
PREFIX_TITLE = '%s-%s' % (_('Authentication'), _('SSO'))
|
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
AUTH_SSO = serializers.BooleanField(
|
|
|
|
required=False, label=_('Enable SSO auth'),
|
|
|
|
help_text=_("Other service can using SSO token login to JumpServer without password")
|
|
|
|
)
|
|
|
|
AUTH_SSO_AUTHKEY_TTL = serializers.IntegerField(
|
2021-09-14 11:30:03 +00:00
|
|
|
required=False, label=_('SSO auth key TTL'), help_text=_("Unit: second"),
|
2022-07-21 05:51:15 +00:00
|
|
|
min_value=60, max_value=60 * 30
|
2021-09-09 06:00:50 +00:00
|
|
|
)
|