Documentation
¶
Index ¶
- Constants
- Variables
- func CreateGroupModelFromCS3(g *cs3group.Group) *libregraph.Group
- func CreateUserModelFromCS3(u *cs3user.User) *libregraph.User
- func GetExpandValues(req *godata.GoDataQuery) ([]string, error)
- func GetSearchValues(req *godata.GoDataQuery) (string, error)
- func GetSelectValues(req *godata.GoDataQuery) ([]string, error)
- type Backend
- type CS3
- func (i *CS3) AddMembersToGroup(ctx context.Context, groupID string, memberID []string) error
- func (i *CS3) CreateGroup(ctx context.Context, group libregraph.Group) (*libregraph.Group, error)
- func (i *CS3) CreateUser(ctx context.Context, user libregraph.User) (*libregraph.User, error)
- func (i *CS3) DeleteGroup(ctx context.Context, id string) error
- func (i *CS3) DeleteUser(ctx context.Context, nameOrID string) error
- func (i *CS3) FilterUsers(_ context.Context, _ *godata.GoDataRequest, _ *godata.ParseNode) ([]*libregraph.User, error)
- func (i *CS3) GetGroup(ctx context.Context, groupID string, queryParam url.Values) (*libregraph.Group, error)
- func (i *CS3) GetGroupMembers(ctx context.Context, groupID string, _ *godata.GoDataRequest) ([]*libregraph.User, error)
- func (i *CS3) GetGroups(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.Group, error)
- func (i *CS3) GetUser(ctx context.Context, userID string, _ *godata.GoDataRequest) (*libregraph.User, error)
- func (i *CS3) GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.User, error)
- func (i *CS3) RemoveMemberFromGroup(ctx context.Context, groupID string, memberID string) error
- func (i *CS3) UpdateGroupName(ctx context.Context, groupID string, groupName string) error
- func (i *CS3) UpdateLastSignInDate(ctx context.Context, userID string, timestamp time.Time) error
- func (i *CS3) UpdateUser(ctx context.Context, nameOrID string, user libregraph.UserUpdate) (*libregraph.User, error)
- type DisableUserMechanismType
- type EducationBackend
- type ErrEducationBackend
- func (i *ErrEducationBackend) AddClassesToEducationSchool(ctx context.Context, schoolNumberOrID string, memberIDs []string) error
- func (i *ErrEducationBackend) AddTeacherToEducationClass(ctx context.Context, classID string, teacherID string) error
- func (i *ErrEducationBackend) AddUsersToEducationSchool(ctx context.Context, schoolID string, memberID []string) error
- func (i *ErrEducationBackend) CreateEducationClass(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error)
- func (i *ErrEducationBackend) CreateEducationSchool(ctx context.Context, school libregraph.EducationSchool) (*libregraph.EducationSchool, error)
- func (i *ErrEducationBackend) CreateEducationUser(ctx context.Context, user libregraph.EducationUser) (*libregraph.EducationUser, error)
- func (i *ErrEducationBackend) DeleteEducationClass(ctx context.Context, nameOrID string) error
- func (i *ErrEducationBackend) DeleteEducationSchool(ctx context.Context, id string) error
- func (i *ErrEducationBackend) DeleteEducationUser(ctx context.Context, nameOrID string) error
- func (i *ErrEducationBackend) GetEducationClass(ctx context.Context, namedOrID string) (*libregraph.EducationClass, error)
- func (i *ErrEducationBackend) GetEducationClassMembers(ctx context.Context, nameOrID string) ([]*libregraph.EducationUser, error)
- func (i *ErrEducationBackend) GetEducationClassTeachers(ctx context.Context, classID string) ([]*libregraph.EducationUser, error)
- func (i *ErrEducationBackend) GetEducationClasses(ctx context.Context) ([]*libregraph.EducationClass, error)
- func (i *ErrEducationBackend) GetEducationSchool(ctx context.Context, nameOrID string) (*libregraph.EducationSchool, error)
- func (i *ErrEducationBackend) GetEducationSchoolClasses(ctx context.Context, schoolNumberOrID string) ([]*libregraph.EducationClass, error)
- func (i *ErrEducationBackend) GetEducationSchoolUsers(ctx context.Context, id string) ([]*libregraph.EducationUser, error)
- func (i *ErrEducationBackend) GetEducationSchools(ctx context.Context) ([]*libregraph.EducationSchool, error)
- func (i *ErrEducationBackend) GetEducationUser(ctx context.Context, nameOrID string) (*libregraph.EducationUser, error)
- func (i *ErrEducationBackend) GetEducationUsers(ctx context.Context) ([]*libregraph.EducationUser, error)
- func (i *ErrEducationBackend) RemoveClassFromEducationSchool(ctx context.Context, schoolNumberOrID string, memberID string) error
- func (i *ErrEducationBackend) RemoveTeacherFromEducationClass(ctx context.Context, classID string, teacherID string) error
- func (i *ErrEducationBackend) RemoveUserFromEducationSchool(ctx context.Context, schoolID string, memberID string) error
- func (i *ErrEducationBackend) UpdateEducationClass(ctx context.Context, id string, class libregraph.EducationClass) (*libregraph.EducationClass, error)
- func (i *ErrEducationBackend) UpdateEducationSchool(ctx context.Context, numberOrID string, school libregraph.EducationSchool) (*libregraph.EducationSchool, error)
- func (i *ErrEducationBackend) UpdateEducationUser(ctx context.Context, nameOrID string, user libregraph.EducationUser) (*libregraph.EducationUser, error)
- type IdentityCache
- type IdentityCacheOption
- type LDAP
- func (i *LDAP) AddClassesToEducationSchool(ctx context.Context, schoolNumberOrID string, memberIDs []string) error
- func (i *LDAP) AddMembersToGroup(ctx context.Context, groupID string, memberIDs []string) error
- func (i *LDAP) AddTeacherToEducationClass(ctx context.Context, classID string, teacherID string) error
- func (i *LDAP) AddUsersToEducationSchool(ctx context.Context, schoolNumberOrID string, memberIDs []string) error
- func (i *LDAP) CreateEducationClass(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error)
- func (i *LDAP) CreateEducationSchool(ctx context.Context, school libregraph.EducationSchool) (*libregraph.EducationSchool, error)
- func (i *LDAP) CreateEducationUser(ctx context.Context, user libregraph.EducationUser) (*libregraph.EducationUser, error)
- func (i *LDAP) CreateGroup(ctx context.Context, group libregraph.Group) (*libregraph.Group, error)
- func (i *LDAP) CreateLDAPGroupByDN(dn string) error
- func (i *LDAP) CreateUser(ctx context.Context, user libregraph.User) (*libregraph.User, error)
- func (i *LDAP) DeleteEducationClass(ctx context.Context, id string) error
- func (i *LDAP) DeleteEducationSchool(ctx context.Context, id string) error
- func (i *LDAP) DeleteEducationUser(ctx context.Context, nameOrID string) error
- func (i *LDAP) DeleteGroup(ctx context.Context, id string) error
- func (i *LDAP) DeleteUser(ctx context.Context, nameOrID string) error
- func (i *LDAP) FilterUsers(ctx context.Context, oreq *godata.GoDataRequest, filter *godata.ParseNode) ([]*libregraph.User, error)
- func (i *LDAP) GetEducationClass(ctx context.Context, id string) (*libregraph.EducationClass, error)
- func (i *LDAP) GetEducationClassMembers(ctx context.Context, id string) ([]*libregraph.EducationUser, error)
- func (i *LDAP) GetEducationClassTeachers(ctx context.Context, classID string) ([]*libregraph.EducationUser, error)
- func (i *LDAP) GetEducationClasses(ctx context.Context) ([]*libregraph.EducationClass, error)
- func (i *LDAP) GetEducationSchool(ctx context.Context, numberOrID string) (*libregraph.EducationSchool, error)
- func (i *LDAP) GetEducationSchoolClasses(ctx context.Context, schoolNumberOrID string) ([]*libregraph.EducationClass, error)
- func (i *LDAP) GetEducationSchoolUsers(ctx context.Context, schoolNumberOrID string) ([]*libregraph.EducationUser, error)
- func (i *LDAP) GetEducationSchools(ctx context.Context) ([]*libregraph.EducationSchool, error)
- func (i *LDAP) GetEducationUser(ctx context.Context, nameOrID string) (*libregraph.EducationUser, error)
- func (i *LDAP) GetEducationUsers(ctx context.Context) ([]*libregraph.EducationUser, error)
- func (i *LDAP) GetGroup(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.Group, error)
- func (i *LDAP) GetGroupMembers(ctx context.Context, groupID string, req *godata.GoDataRequest) ([]*libregraph.User, error)
- func (i *LDAP) GetGroups(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.Group, error)
- func (i *LDAP) GetUser(ctx context.Context, nameOrID string, oreq *godata.GoDataRequest) (*libregraph.User, error)
- func (i *LDAP) GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.User, error)
- func (i *LDAP) RemoveClassFromEducationSchool(ctx context.Context, schoolNumberOrID string, memberID string) error
- func (i *LDAP) RemoveMemberFromGroup(ctx context.Context, groupID string, memberID string) error
- func (i *LDAP) RemoveTeacherFromEducationClass(ctx context.Context, classID string, teacherID string) error
- func (i *LDAP) RemoveUserFromEducationSchool(ctx context.Context, schoolNumberOrID string, memberID string) error
- func (i *LDAP) UpdateEducationClass(ctx context.Context, id string, class libregraph.EducationClass) (*libregraph.EducationClass, error)
- func (i *LDAP) UpdateEducationSchool(ctx context.Context, numberOrID string, school libregraph.EducationSchool) (*libregraph.EducationSchool, error)
- func (i *LDAP) UpdateEducationUser(ctx context.Context, nameOrID string, user libregraph.EducationUser) (*libregraph.EducationUser, error)
- func (i *LDAP) UpdateGroupName(ctx context.Context, groupID string, groupName string) error
- func (i *LDAP) UpdateLastSignInDate(ctx context.Context, userID string, timestamp time.Time) error
- func (i *LDAP) UpdateUser(ctx context.Context, nameOrID string, user libregraph.UserUpdate) (*libregraph.User, error)
- func (i *LDAP) UserEnabled(user *ldap.Entry) (bool, error)
Constants ¶
const ( UserTypeMember = "Member" UserTypeGuest = "Guest" UserTypeFederated = "Federated" )
Variables ¶
var ( // ErrReadOnly signals that the backend is set to read only. ErrReadOnly = errorcode.New(errorcode.NotAllowed, "server is configured read-only") // ErrNotFound signals that the requested resource was not found. ErrNotFound = errorcode.New(errorcode.ItemNotFound, "not found") // ErrUnsupportedFilter signals that the requested filter is not supported by the backend. ErrUnsupportedFilter = godata.NotImplementedError("unsupported filter") )
Errors used by the interfaces
Functions ¶
func CreateGroupModelFromCS3 ¶
func CreateGroupModelFromCS3(g *cs3group.Group) *libregraph.Group
CreateGroupModelFromCS3 converts a cs3 Group object into a libregraph.Group
func CreateUserModelFromCS3 ¶
func CreateUserModelFromCS3(u *cs3user.User) *libregraph.User
CreateUserModelFromCS3 converts a cs3 User object into a libregraph.User
func GetExpandValues ¶
func GetExpandValues(req *godata.GoDataQuery) ([]string, error)
GetExpandValues extracts the values of the $expand query parameter and returns them in a []string, rejects any $expand value that consists of more than just a single path segment
func GetSearchValues ¶
func GetSearchValues(req *godata.GoDataQuery) (string, error)
GetSearchValues extracts the value of the $search query parameter and returns it as a string. Rejects any search query that is more than just a simple string
func GetSelectValues ¶
func GetSelectValues(req *godata.GoDataQuery) ([]string, error)
GetSelectValues extracts the values of the $select query parameter and returns them in a []string, rejects any $select value that consists of more than just a single path segment
Types ¶
type Backend ¶
type Backend interface {
// CreateUser creates a given user in the identity backend.
CreateUser(ctx context.Context, user libregraph.User) (*libregraph.User, error)
// DeleteUser deletes a given user, identified by username or id, from the backend
DeleteUser(ctx context.Context, nameOrID string) error
// UpdateUser applies changes to given user, identified by username or id
UpdateUser(ctx context.Context, nameOrID string, user libregraph.UserUpdate) (*libregraph.User, error)
GetUser(ctx context.Context, nameOrID string, oreq *godata.GoDataRequest) (*libregraph.User, error)
GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.User, error)
// FilterUsers returns a list of users that match the filter
FilterUsers(ctx context.Context, oreq *godata.GoDataRequest, filter *godata.ParseNode) ([]*libregraph.User, error)
UpdateLastSignInDate(ctx context.Context, userID string, timestamp time.Time) error
// CreateGroup creates the supplied group in the identity backend.
CreateGroup(ctx context.Context, group libregraph.Group) (*libregraph.Group, error)
// DeleteGroup deletes a given group, identified by id
DeleteGroup(ctx context.Context, id string) error
// UpdateGroupName updates the group name
UpdateGroupName(ctx context.Context, groupID string, groupName string) error
GetGroup(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.Group, error)
GetGroups(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.Group, error)
// GetGroupMembers list all members of a group
GetGroupMembers(ctx context.Context, id string, oreq *godata.GoDataRequest) ([]*libregraph.User, error)
// AddMembersToGroup adds new members (reference by a slice of IDs) to supplied group in the identity backend.
AddMembersToGroup(ctx context.Context, groupID string, memberID []string) error
// RemoveMemberFromGroup removes a single member (by ID) from a group
RemoveMemberFromGroup(ctx context.Context, groupID string, memberID string) error
}
Backend defines the Interface for an IdentityBackend implementation
type CS3 ¶
type CS3 struct {
Config *shared.Reva
Logger *log.Logger
GatewaySelector pool.Selectable[gateway.GatewayAPIClient]
}
func (*CS3) AddMembersToGroup ¶
AddMembersToGroup implements the Backend Interface. It's currently not supported for the CS3 backend
func (*CS3) CreateGroup ¶
func (i *CS3) CreateGroup(ctx context.Context, group libregraph.Group) (*libregraph.Group, error)
CreateGroup implements the Backend Interface. It's currently not supported for the CS3 backend
func (*CS3) CreateUser ¶
func (i *CS3) CreateUser(ctx context.Context, user libregraph.User) (*libregraph.User, error)
CreateUser implements the Backend Interface. It's currently not supported for the CS3 backend
func (*CS3) DeleteGroup ¶
DeleteGroup implements the Backend Interface. It's currently not supported for the CS3 backend
func (*CS3) DeleteUser ¶
DeleteUser implements the Backend Interface. It's currently not supported for the CS3 backend
func (*CS3) FilterUsers ¶
func (i *CS3) FilterUsers(_ context.Context, _ *godata.GoDataRequest, _ *godata.ParseNode) ([]*libregraph.User, error)
FilterUsers implements the Backend Interface. It's currently not supported for the CS3 backend
func (*CS3) GetGroup ¶
func (i *CS3) GetGroup(ctx context.Context, groupID string, queryParam url.Values) (*libregraph.Group, error)
GetGroup implements the Backend Interface.
func (*CS3) GetGroupMembers ¶
func (i *CS3) GetGroupMembers(ctx context.Context, groupID string, _ *godata.GoDataRequest) ([]*libregraph.User, error)
GetGroupMembers implements the Backend Interface. It's currently not supported for the CS3 backend
func (*CS3) GetGroups ¶
func (i *CS3) GetGroups(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.Group, error)
GetGroups implements the Backend Interface.
func (*CS3) GetUser ¶
func (i *CS3) GetUser(ctx context.Context, userID string, _ *godata.GoDataRequest) (*libregraph.User, error)
GetUser implements the Backend Interface.
func (*CS3) GetUsers ¶
func (i *CS3) GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.User, error)
GetUsers implements the Backend Interface.
func (*CS3) RemoveMemberFromGroup ¶
RemoveMemberFromGroup implements the Backend Interface. It's currently not supported for the CS3 backend
func (*CS3) UpdateGroupName ¶
UpdateGroupName implements the Backend Interface. It's currently not supported for the CS3 backend
func (*CS3) UpdateLastSignInDate ¶
UpdateLastSignInDate implements the Backend Interface. It's currently not supported for the CS3 backend
func (*CS3) UpdateUser ¶
func (i *CS3) UpdateUser(ctx context.Context, nameOrID string, user libregraph.UserUpdate) (*libregraph.User, error)
UpdateUser implements the Backend Interface. It's currently not supported for the CS3 backend
type DisableUserMechanismType ¶
type DisableUserMechanismType int64
DisableUserMechanismType is used instead of directly using the string values from the configuration.
const ( DisableMechanismNone DisableUserMechanismType = iota DisableMechanismAttribute DisableMechanismGroup )
The different DisableMechanism* constants are used for managing the enabling/disabling of users.
func ParseDisableMechanismType ¶
func ParseDisableMechanismType(disableMechanism string) (DisableUserMechanismType, error)
ParseDisableMechanismType checks that the configuration option for how to disable users is correct.
type EducationBackend ¶
type EducationBackend interface {
// CreateEducationSchool creates the supplied school in the identity backend.
CreateEducationSchool(ctx context.Context, group libregraph.EducationSchool) (*libregraph.EducationSchool, error)
// DeleteEducationSchool deletes a given school, identified by id
DeleteEducationSchool(ctx context.Context, id string) error
// GetEducationSchool reads a given school by id
GetEducationSchool(ctx context.Context, nameOrID string) (*libregraph.EducationSchool, error)
// GetEducationSchools lists all schools
GetEducationSchools(ctx context.Context) ([]*libregraph.EducationSchool, error)
// UpdateEducationSchool updates attributes of a school
UpdateEducationSchool(ctx context.Context, numberOrID string, school libregraph.EducationSchool) (*libregraph.EducationSchool, error)
// GetEducationSchoolUsers lists all members of a school
GetEducationSchoolUsers(ctx context.Context, id string) ([]*libregraph.EducationUser, error)
// AddUsersToEducationSchool adds new members (reference by a slice of IDs) to supplied school in the identity backend.
AddUsersToEducationSchool(ctx context.Context, schoolID string, memberID []string) error
// RemoveUserFromEducationSchool removes a single member (by ID) from a school
RemoveUserFromEducationSchool(ctx context.Context, schoolID string, memberID string) error
// GetEducationSchoolClasses lists all classes in a school
GetEducationSchoolClasses(ctx context.Context, schoolNumberOrID string) ([]*libregraph.EducationClass, error)
// AddClassesToEducationSchool adds new classes (referenced by a slice of IDs) to supplied school in the identity backend.
AddClassesToEducationSchool(ctx context.Context, schoolNumberOrID string, memberIDs []string) error
// RemoveClassFromEducationSchool removes a class from a school.
RemoveClassFromEducationSchool(ctx context.Context, schoolNumberOrID string, memberID string) error
// GetEducationClasses lists all classes
GetEducationClasses(ctx context.Context) ([]*libregraph.EducationClass, error)
// GetEducationClass reads a given class by id
GetEducationClass(ctx context.Context, namedOrID string) (*libregraph.EducationClass, error)
// CreateEducationClass creates the supplied education class in the identity backend.
CreateEducationClass(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error)
// DeleteEducationClass deletes the supplied education class in the identity backend.
DeleteEducationClass(ctx context.Context, nameOrID string) error
// GetEducationClassMembers returns the EducationUser members for an EducationClass
GetEducationClassMembers(ctx context.Context, nameOrID string) ([]*libregraph.EducationUser, error)
// UpdateEducationClass updates properties of the supplied class in the identity backend.
UpdateEducationClass(ctx context.Context, id string, class libregraph.EducationClass) (*libregraph.EducationClass, error)
// CreateEducationUser creates a given education user in the identity backend.
CreateEducationUser(ctx context.Context, user libregraph.EducationUser) (*libregraph.EducationUser, error)
// DeleteEducationUser deletes a given education user, identified by username or id, from the backend
DeleteEducationUser(ctx context.Context, nameOrID string) error
// UpdateEducationUser applies changes to given education user, identified by username or id
UpdateEducationUser(ctx context.Context, nameOrID string, user libregraph.EducationUser) (*libregraph.EducationUser, error)
// GetEducationUser reads an education user by id or name
GetEducationUser(ctx context.Context, nameOrID string) (*libregraph.EducationUser, error)
// GetEducationUsers lists all education users
GetEducationUsers(ctx context.Context) ([]*libregraph.EducationUser, error)
// GetEducationClassTeachers returns the EducationUser teachers for an EducationClass
GetEducationClassTeachers(ctx context.Context, classID string) ([]*libregraph.EducationUser, error)
// AddTeacherToEducationClass adds a teacher (by ID) to class in the identity backend.
AddTeacherToEducationClass(ctx context.Context, classID string, teacherID string) error
// RemoveTeacherFromEducationClass removes teacher (by ID) from a class
RemoveTeacherFromEducationClass(ctx context.Context, classID string, teacherID string) error
}
EducationBackend defines the Interface for an EducationBackend implementation
type ErrEducationBackend ¶
type ErrEducationBackend struct{}
ErrEducationBackend is a dummy EducationBackend, doing nothing
func (*ErrEducationBackend) AddClassesToEducationSchool ¶
func (i *ErrEducationBackend) AddClassesToEducationSchool(ctx context.Context, schoolNumberOrID string, memberIDs []string) error
AddClassesToEducationSchool implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) AddTeacherToEducationClass ¶
func (i *ErrEducationBackend) AddTeacherToEducationClass(ctx context.Context, classID string, teacherID string) error
AddTeacherToEducationClass implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) AddUsersToEducationSchool ¶
func (i *ErrEducationBackend) AddUsersToEducationSchool(ctx context.Context, schoolID string, memberID []string) error
AddUsersToEducationSchool adds new members (reference by a slice of IDs) to supplied school in the identity backend.
func (*ErrEducationBackend) CreateEducationClass ¶
func (i *ErrEducationBackend) CreateEducationClass(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error)
CreateEducationClass implements the EducationBackend interface
func (*ErrEducationBackend) CreateEducationSchool ¶
func (i *ErrEducationBackend) CreateEducationSchool(ctx context.Context, school libregraph.EducationSchool) (*libregraph.EducationSchool, error)
CreateEducationSchool creates the supplied school in the identity backend.
func (*ErrEducationBackend) CreateEducationUser ¶
func (i *ErrEducationBackend) CreateEducationUser(ctx context.Context, user libregraph.EducationUser) (*libregraph.EducationUser, error)
CreateEducationUser creates a given education user in the identity backend.
func (*ErrEducationBackend) DeleteEducationClass ¶
func (i *ErrEducationBackend) DeleteEducationClass(ctx context.Context, nameOrID string) error
DeleteEducationClass implements the EducationBackend interface
func (*ErrEducationBackend) DeleteEducationSchool ¶
func (i *ErrEducationBackend) DeleteEducationSchool(ctx context.Context, id string) error
DeleteEducationSchool deletes a given school, identified by id
func (*ErrEducationBackend) DeleteEducationUser ¶
func (i *ErrEducationBackend) DeleteEducationUser(ctx context.Context, nameOrID string) error
DeleteEducationUser deletes a given education user, identified by username or id, from the backend
func (*ErrEducationBackend) GetEducationClass ¶
func (i *ErrEducationBackend) GetEducationClass(ctx context.Context, namedOrID string) (*libregraph.EducationClass, error)
GetEducationClass implements the EducationBackend interface
func (*ErrEducationBackend) GetEducationClassMembers ¶
func (i *ErrEducationBackend) GetEducationClassMembers(ctx context.Context, nameOrID string) ([]*libregraph.EducationUser, error)
GetEducationClassMembers implements the EducationBackend interface
func (*ErrEducationBackend) GetEducationClassTeachers ¶
func (i *ErrEducationBackend) GetEducationClassTeachers(ctx context.Context, classID string) ([]*libregraph.EducationUser, error)
GetEducationClassTeachers implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) GetEducationClasses ¶
func (i *ErrEducationBackend) GetEducationClasses(ctx context.Context) ([]*libregraph.EducationClass, error)
GetEducationClasses implements the EducationBackend interface
func (*ErrEducationBackend) GetEducationSchool ¶
func (i *ErrEducationBackend) GetEducationSchool(ctx context.Context, nameOrID string) (*libregraph.EducationSchool, error)
GetEducationSchool implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) GetEducationSchoolClasses ¶
func (i *ErrEducationBackend) GetEducationSchoolClasses(ctx context.Context, schoolNumberOrID string) ([]*libregraph.EducationClass, error)
GetEducationSchoolClasses implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) GetEducationSchoolUsers ¶
func (i *ErrEducationBackend) GetEducationSchoolUsers(ctx context.Context, id string) ([]*libregraph.EducationUser, error)
GetEducationSchoolUsers implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) GetEducationSchools ¶
func (i *ErrEducationBackend) GetEducationSchools(ctx context.Context) ([]*libregraph.EducationSchool, error)
GetEducationSchools implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) GetEducationUser ¶
func (i *ErrEducationBackend) GetEducationUser(ctx context.Context, nameOrID string) (*libregraph.EducationUser, error)
GetEducationUser implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) GetEducationUsers ¶
func (i *ErrEducationBackend) GetEducationUsers(ctx context.Context) ([]*libregraph.EducationUser, error)
GetEducationUsers implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) RemoveClassFromEducationSchool ¶
func (i *ErrEducationBackend) RemoveClassFromEducationSchool(ctx context.Context, schoolNumberOrID string, memberID string) error
RemoveClassFromEducationSchool implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) RemoveTeacherFromEducationClass ¶
func (i *ErrEducationBackend) RemoveTeacherFromEducationClass(ctx context.Context, classID string, teacherID string) error
RemoveTeacherFromEducationClass implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) RemoveUserFromEducationSchool ¶
func (i *ErrEducationBackend) RemoveUserFromEducationSchool(ctx context.Context, schoolID string, memberID string) error
RemoveUserFromEducationSchool removes a single member (by ID) from a school
func (*ErrEducationBackend) UpdateEducationClass ¶
func (i *ErrEducationBackend) UpdateEducationClass(ctx context.Context, id string, class libregraph.EducationClass) (*libregraph.EducationClass, error)
UpdateEducationClass implements the EducationBackend interface
func (*ErrEducationBackend) UpdateEducationSchool ¶
func (i *ErrEducationBackend) UpdateEducationSchool(ctx context.Context, numberOrID string, school libregraph.EducationSchool) (*libregraph.EducationSchool, error)
UpdateEducationSchool implements the EducationBackend interface for the ErrEducationBackend backend.
func (*ErrEducationBackend) UpdateEducationUser ¶
func (i *ErrEducationBackend) UpdateEducationUser(ctx context.Context, nameOrID string, user libregraph.EducationUser) (*libregraph.EducationUser, error)
UpdateEducationUser applies changes to given education user, identified by username or id
type IdentityCache ¶
type IdentityCache struct {
// contains filtered or unexported fields
}
IdentityCache implements a simple ttl based cache for looking up users and groups by ID
func NewIdentityCache ¶
func NewIdentityCache(opts ...IdentityCacheOption) IdentityCache
NewIdentityCache instantiates a new IdentityCache and sets the supplied options
func (IdentityCache) GetAcceptedUser ¶
func (cache IdentityCache) GetAcceptedUser(ctx context.Context, userid string) (libregraph.User, error)
GetAcceptedUser looks up a user by id, if the user is not cached, yet it will do a lookup via the CS3 API
func (IdentityCache) GetGroup ¶
func (cache IdentityCache) GetGroup(ctx context.Context, groupID string) (libregraph.Group, error)
GetGroup looks up a group by id, if the group is not cached, yet it will do a lookup via the CS3 API
func (IdentityCache) GetUser ¶
func (cache IdentityCache) GetUser(ctx context.Context, userid string) (libregraph.User, error)
GetUser looks up a user by id, if the user is not cached, yet it will do a lookup via the CS3 API
type IdentityCacheOption ¶
type IdentityCacheOption func(o *identityCacheOptions)
IdentityCacheOption defines a single option function.
func IdentityCacheWithGatewaySelector ¶
func IdentityCacheWithGatewaySelector(gatewaySelector pool.Selectable[gateway.GatewayAPIClient]) IdentityCacheOption
IdentityCacheWithGatewaySelector set the gatewaySelector for the Identity Cache
func IdentityCacheWithGroupsTTL ¶
func IdentityCacheWithGroupsTTL(ttl time.Duration) IdentityCacheOption
IdentityCacheWithGroupsTTL sets the TTL for the groups cache
func IdentityCacheWithUsersTTL ¶
func IdentityCacheWithUsersTTL(ttl time.Duration) IdentityCacheOption
IdentityCacheWithUsersTTL sets the TTL for the users cache
type LDAP ¶
type LDAP struct {
// contains filtered or unexported fields
}
func NewLDAPBackend ¶
func (*LDAP) AddClassesToEducationSchool ¶
func (i *LDAP) AddClassesToEducationSchool(ctx context.Context, schoolNumberOrID string, memberIDs []string) error
AddClassesToEducationSchool adds new members (reference by a slice of IDs) to supplied school in the identity backend.
func (*LDAP) AddMembersToGroup ¶
AddMembersToGroup implements the Backend Interface for the LDAP backend. Currently, it is limited to adding Users as Group members. Adding other groups as members is not yet implemented
func (*LDAP) AddTeacherToEducationClass ¶
func (i *LDAP) AddTeacherToEducationClass(ctx context.Context, classID string, teacherID string) error
AddTeacherToEducationClass adds a teacher (by ID) to class in the identity backend.
func (*LDAP) AddUsersToEducationSchool ¶
func (i *LDAP) AddUsersToEducationSchool(ctx context.Context, schoolNumberOrID string, memberIDs []string) error
AddUsersToEducationSchool adds new members (reference by a slice of IDs) to supplied school in the identity backend.
func (*LDAP) CreateEducationClass ¶
func (i *LDAP) CreateEducationClass(ctx context.Context, class libregraph.EducationClass) (*libregraph.EducationClass, error)
CreateEducationClass implements the EducationBackend interface for the LDAP backend. An EducationClass is mapped to an LDAP entry of the "groupOfNames" structural ObjectClass. With a few additional Attributes added on top via the "openCloudEducationClass" auxiliary ObjectClass.
func (*LDAP) CreateEducationSchool ¶
func (i *LDAP) CreateEducationSchool(ctx context.Context, school libregraph.EducationSchool) (*libregraph.EducationSchool, error)
CreateEducationSchool creates the supplied school in the identity backend.
func (*LDAP) CreateEducationUser ¶
func (i *LDAP) CreateEducationUser(ctx context.Context, user libregraph.EducationUser) (*libregraph.EducationUser, error)
CreateEducationUser creates a given education user in the identity backend.
func (*LDAP) CreateGroup ¶
func (i *LDAP) CreateGroup(ctx context.Context, group libregraph.Group) (*libregraph.Group, error)
CreateGroup implements the Backend Interface for the LDAP Backend It is currently restricted to managing groups based on the "groupOfNames" ObjectClass. As "groupOfNames" requires a "member" Attribute to be present. Empty Groups (groups without a member) a represented by adding an empty DN as the single member.
func (*LDAP) CreateLDAPGroupByDN ¶
CreateLDAPGroupByDN is a helper method specifically intended for creating a "system" group for managing locally disabled users on service startup
func (*LDAP) CreateUser ¶
func (i *LDAP) CreateUser(ctx context.Context, user libregraph.User) (*libregraph.User, error)
CreateUser implements the Backend Interface. It converts the libregraph.User into an LDAP User Entry (using the inetOrgPerson LDAP Objectclass) add adds that to the configured LDAP server
func (*LDAP) DeleteEducationClass ¶
DeleteEducationClass implements the EducationBackend interface for the LDAP backend.
func (*LDAP) DeleteEducationSchool ¶
DeleteEducationSchool deletes a given school, identified by id
func (*LDAP) DeleteEducationUser ¶
DeleteEducationUser deletes a given education user, identified by username or id, from the backend
func (*LDAP) DeleteGroup ¶
DeleteGroup implements the Backend Interface.
func (*LDAP) DeleteUser ¶
DeleteUser implements the Backend Interface. It permanently deletes a User identified by name or id from the LDAP server
func (*LDAP) FilterUsers ¶
func (i *LDAP) FilterUsers(ctx context.Context, oreq *godata.GoDataRequest, filter *godata.ParseNode) ([]*libregraph.User, error)
FilterUsers implements the Backend Interface.
func (*LDAP) GetEducationClass ¶
func (i *LDAP) GetEducationClass(ctx context.Context, id string) (*libregraph.EducationClass, error)
GetEducationClass implements the EducationBackend interface for the LDAP backend.
func (*LDAP) GetEducationClassMembers ¶
func (i *LDAP) GetEducationClassMembers(ctx context.Context, id string) ([]*libregraph.EducationUser, error)
GetEducationClassMembers implements the EducationBackend interface for the LDAP backend.
func (*LDAP) GetEducationClassTeachers ¶
func (i *LDAP) GetEducationClassTeachers(ctx context.Context, classID string) ([]*libregraph.EducationUser, error)
GetEducationClassTeachers returns the EducationUser teachers for an EducationClass
func (*LDAP) GetEducationClasses ¶
func (i *LDAP) GetEducationClasses(ctx context.Context) ([]*libregraph.EducationClass, error)
GetEducationClasses implements the EducationBackend interface for the LDAP backend.
func (*LDAP) GetEducationSchool ¶
func (i *LDAP) GetEducationSchool(ctx context.Context, numberOrID string) (*libregraph.EducationSchool, error)
GetEducationSchool implements the EducationBackend interface for the LDAP backend.
func (*LDAP) GetEducationSchoolClasses ¶
func (i *LDAP) GetEducationSchoolClasses(ctx context.Context, schoolNumberOrID string) ([]*libregraph.EducationClass, error)
GetEducationSchoolClasses implements the EducationBackend interface for the LDAP backend.
func (*LDAP) GetEducationSchoolUsers ¶
func (i *LDAP) GetEducationSchoolUsers(ctx context.Context, schoolNumberOrID string) ([]*libregraph.EducationUser, error)
GetEducationSchoolUsers implements the EducationBackend interface for the LDAP backend.
func (*LDAP) GetEducationSchools ¶
func (i *LDAP) GetEducationSchools(ctx context.Context) ([]*libregraph.EducationSchool, error)
GetEducationSchools implements the EducationBackend interface for the LDAP backend.
func (*LDAP) GetEducationUser ¶
func (i *LDAP) GetEducationUser(ctx context.Context, nameOrID string) (*libregraph.EducationUser, error)
GetEducationUser implements the EducationBackend interface for the LDAP backend.
func (*LDAP) GetEducationUsers ¶
func (i *LDAP) GetEducationUsers(ctx context.Context) ([]*libregraph.EducationUser, error)
GetEducationUsers implements the EducationBackend interface for the LDAP backend.
func (*LDAP) GetGroup ¶
func (i *LDAP) GetGroup(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.Group, error)
GetGroup implements the Backend Interface for the LDAP Backend
func (*LDAP) GetGroupMembers ¶
func (i *LDAP) GetGroupMembers(ctx context.Context, groupID string, req *godata.GoDataRequest) ([]*libregraph.User, error)
GetGroupMembers implements the Backend Interface for the LDAP Backend
func (*LDAP) GetGroups ¶
func (i *LDAP) GetGroups(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.Group, error)
GetGroups implements the Backend Interface for the LDAP Backend
func (*LDAP) GetUser ¶
func (i *LDAP) GetUser(ctx context.Context, nameOrID string, oreq *godata.GoDataRequest) (*libregraph.User, error)
GetUser implements the Backend Interface.
func (*LDAP) GetUsers ¶
func (i *LDAP) GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.User, error)
GetUsers implements the Backend Interface.
func (*LDAP) RemoveClassFromEducationSchool ¶
func (i *LDAP) RemoveClassFromEducationSchool(ctx context.Context, schoolNumberOrID string, memberID string) error
RemoveClassFromEducationSchool removes a single member (by ID) from a school
func (*LDAP) RemoveMemberFromGroup ¶
RemoveMemberFromGroup implements the Backend Interface.
func (*LDAP) RemoveTeacherFromEducationClass ¶
func (i *LDAP) RemoveTeacherFromEducationClass(ctx context.Context, classID string, teacherID string) error
RemoveTeacherFromEducationClass removes teacher (by ID) from a class
func (*LDAP) RemoveUserFromEducationSchool ¶
func (i *LDAP) RemoveUserFromEducationSchool(ctx context.Context, schoolNumberOrID string, memberID string) error
RemoveUserFromEducationSchool removes a single member (by ID) from a school
func (*LDAP) UpdateEducationClass ¶
func (i *LDAP) UpdateEducationClass(ctx context.Context, id string, class libregraph.EducationClass) (*libregraph.EducationClass, error)
UpdateEducationClass implements the EducationBackend interface for the LDAP backend. Only the displayName and externalID are supported to change at this point.
func (*LDAP) UpdateEducationSchool ¶
func (i *LDAP) UpdateEducationSchool(ctx context.Context, numberOrID string, school libregraph.EducationSchool) (*libregraph.EducationSchool, error)
UpdateEducationSchool updates the supplied school in the identity backend
func (*LDAP) UpdateEducationUser ¶
func (i *LDAP) UpdateEducationUser(ctx context.Context, nameOrID string, user libregraph.EducationUser) (*libregraph.EducationUser, error)
UpdateEducationUser applies changes to given education user, identified by username or id
func (*LDAP) UpdateGroupName ¶
UpdateGroupName implements the Backend Interface.
func (*LDAP) UpdateLastSignInDate ¶
UpdateLastSignInDate implements the Backend Interface.
func (*LDAP) UpdateUser ¶
func (i *LDAP) UpdateUser(ctx context.Context, nameOrID string, user libregraph.UserUpdate) (*libregraph.User, error)
UpdateUser implements the Backend Interface for the LDAP Backend