core: add user UID to API
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
2cad9a3d07
commit
446f104c90
|
@ -42,6 +42,7 @@ class UserSerializer(ModelSerializer):
|
|||
avatar = CharField(read_only=True)
|
||||
attributes = JSONField(validators=[is_dict], required=False)
|
||||
groups = ListSerializer(child=GroupSerializer(), read_only=True, source="ak_groups")
|
||||
uid = CharField(read_only=True)
|
||||
|
||||
class Meta:
|
||||
|
||||
|
@ -57,6 +58,7 @@ class UserSerializer(ModelSerializer):
|
|||
"email",
|
||||
"avatar",
|
||||
"attributes",
|
||||
"uid",
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/nmcclain/ldap"
|
||||
|
@ -79,7 +78,7 @@ func (pi *ProviderInstance) Search(bindDN string, searchReq ldap.SearchRequest,
|
|||
},
|
||||
{
|
||||
Name: "uid",
|
||||
Values: []string{strconv.Itoa(int(u.Pk))},
|
||||
Values: []string{u.UID},
|
||||
},
|
||||
{
|
||||
Name: "name",
|
||||
|
|
|
@ -15395,6 +15395,11 @@ definitions:
|
|||
attributes:
|
||||
title: Attributes
|
||||
type: object
|
||||
uid:
|
||||
title: Uid
|
||||
type: string
|
||||
readOnly: true
|
||||
minLength: 1
|
||||
Token:
|
||||
required:
|
||||
- identifier
|
||||
|
|
Reference in New Issue