2019-12-05 07:09:25 +00:00
|
|
|
# coding: utf-8
|
|
|
|
#
|
2018-01-11 12:10:27 +00:00
|
|
|
|
2019-12-05 07:09:25 +00:00
|
|
|
from rest_framework import serializers
|
2018-01-11 12:10:27 +00:00
|
|
|
|
2020-03-12 08:24:38 +00:00
|
|
|
__all__ = [
|
|
|
|
'LDAPTestConfigSerializer', 'LDAPUserSerializer', 'LDAPTestLoginSerializer'
|
|
|
|
]
|
2018-01-12 07:43:26 +00:00
|
|
|
|
|
|
|
|
2020-03-12 08:24:38 +00:00
|
|
|
class LDAPTestConfigSerializer(serializers.Serializer):
|
2018-01-12 07:43:26 +00:00
|
|
|
AUTH_LDAP_SERVER_URI = serializers.CharField(max_length=1024)
|
2019-02-22 11:14:07 +00:00
|
|
|
AUTH_LDAP_BIND_DN = serializers.CharField(max_length=1024, required=False, allow_blank=True)
|
|
|
|
AUTH_LDAP_BIND_PASSWORD = serializers.CharField(required=False, allow_blank=True)
|
2018-01-12 07:43:26 +00:00
|
|
|
AUTH_LDAP_SEARCH_OU = serializers.CharField()
|
|
|
|
AUTH_LDAP_SEARCH_FILTER = serializers.CharField()
|
|
|
|
AUTH_LDAP_USER_ATTR_MAP = serializers.CharField()
|
|
|
|
AUTH_LDAP_START_TLS = serializers.BooleanField(required=False)
|
2020-03-12 08:24:38 +00:00
|
|
|
AUTH_LDAP = serializers.BooleanField(required=False)
|
|
|
|
|
|
|
|
|
|
|
|
class LDAPTestLoginSerializer(serializers.Serializer):
|
|
|
|
username = serializers.CharField(max_length=1024, required=True)
|
|
|
|
password = serializers.CharField(max_length=2014, required=True)
|
2018-01-12 07:43:26 +00:00
|
|
|
|
2019-01-15 02:23:30 +00:00
|
|
|
|
2019-08-21 12:27:21 +00:00
|
|
|
class LDAPUserSerializer(serializers.Serializer):
|
|
|
|
id = serializers.CharField()
|
|
|
|
username = serializers.CharField()
|
2019-11-11 08:41:32 +00:00
|
|
|
name = serializers.CharField()
|
2019-08-21 12:27:21 +00:00
|
|
|
email = serializers.CharField()
|
|
|
|
existing = serializers.BooleanField(read_only=True)
|
2019-02-26 04:38:20 +00:00
|
|
|
|