mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-15 08:41:16 -05:00
initial skel for external tenant id
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
This commit is contained in:
committed by
Christian Richter
parent
13ae67b02c
commit
5877bfa8a2
@@ -42,4 +42,4 @@ olcObjectClasses: ( openCloudOid:1.2.5 NAME 'openCloudEducationSchool'
|
||||
DESC 'OpenCloud education school objectclass'
|
||||
SUP openCloudObject
|
||||
AUXILIARY
|
||||
MAY ( openCloudEducationSchoolNumber $ openCloudEducationSchoolTerminationTimestamp ) )
|
||||
MAY ( openCloudEducationSchoolNumber $ openCloudEducationSchoolTerminationTimestamp $ openCloudEducationExternalId) )
|
||||
|
||||
@@ -80,6 +80,7 @@ type LDAP struct {
|
||||
type userAttributeMap struct {
|
||||
displayName string
|
||||
id string
|
||||
externalId string
|
||||
mail string
|
||||
userName string
|
||||
givenName string
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
"github.com/libregraph/idm/pkg/ldapdn"
|
||||
"github.com/opencloud-eu/opencloud/services/graph/pkg/errorcode"
|
||||
libregraph "github.com/opencloud-eu/libre-graph-api-go"
|
||||
"github.com/opencloud-eu/opencloud/services/graph/pkg/errorcode"
|
||||
)
|
||||
|
||||
type educationClassAttributeMap struct {
|
||||
@@ -349,6 +349,7 @@ func (i *LDAP) getEducationClassByID(nameOrID string, requestMembers bool) (*lda
|
||||
return i.getEducationObjectByNameOrID(
|
||||
nameOrID,
|
||||
i.userAttributeMap.id,
|
||||
i.userAttributeMap.externalId,
|
||||
i.educationConfig.classAttributeMap.externalID,
|
||||
i.groupFilter,
|
||||
i.educationConfig.classObjectClass,
|
||||
|
||||
@@ -318,6 +318,7 @@ func (i *LDAP) getEducationUserAttrTypes() []string {
|
||||
return []string{
|
||||
i.userAttributeMap.displayName,
|
||||
i.userAttributeMap.id,
|
||||
i.userAttributeMap.externalId,
|
||||
i.userAttributeMap.mail,
|
||||
i.userAttributeMap.userName,
|
||||
i.userAttributeMap.surname,
|
||||
@@ -345,6 +346,7 @@ func (i *LDAP) getEducationUserByNameOrID(nameOrID string) (*ldap.Entry, error)
|
||||
nameOrID,
|
||||
i.userAttributeMap.userName,
|
||||
i.userAttributeMap.id,
|
||||
i.userAttributeMap.externalId,
|
||||
i.userFilter,
|
||||
i.educationConfig.userObjectClass,
|
||||
i.userBaseDN,
|
||||
@@ -352,9 +354,9 @@ func (i *LDAP) getEducationUserByNameOrID(nameOrID string) (*ldap.Entry, error)
|
||||
)
|
||||
}
|
||||
|
||||
func (i *LDAP) getEducationObjectByNameOrID(nameOrID, nameAttribute, idAttribute, objectFilter, objectClass, baseDN string, attributes []string) (*ldap.Entry, error) {
|
||||
func (i *LDAP) getEducationObjectByNameOrID(nameOrID, nameAttribute, idAttribute, externalIdAttribute, objectFilter, objectClass, baseDN string, attributes []string) (*ldap.Entry, error) {
|
||||
nameOrID = ldap.EscapeFilter(nameOrID)
|
||||
filter := fmt.Sprintf("(|(%s=%s)(%s=%s))", nameAttribute, nameOrID, idAttribute, nameOrID)
|
||||
filter := fmt.Sprintf("(|(%s=%s)(%s=%s)(%s=%s)", nameAttribute, nameOrID, idAttribute, nameOrID, externalIdAttribute, nameOrID)
|
||||
return i.getEducationObjectByFilter(filter, baseDN, objectFilter, objectClass, attributes)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user