identity

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUserModelFromCS3

func CreateUserModelFromCS3(u *cs3.User) *libregraph.User

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.User) (*libregraph.User, error)
	GetUser(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.User, error)
	GetUsers(ctx context.Context, queryParam url.Values) ([]*libregraph.User, 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
	GetGroup(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.Group, error)
	GetGroups(ctx context.Context, queryParam url.Values) ([]*libregraph.Group, error)
	GetGroupMembers(ctx context.Context, id string) ([]*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
}

type CS3

type CS3 struct {
	Config *shared.Reva
	Logger *log.Logger
}

func (*CS3) AddMembersToGroup

func (i *CS3) AddMembersToGroup(ctx context.Context, groupID string, memberID []string) error

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

func (i *CS3) DeleteGroup(ctx context.Context, id string) error

DeleteGroup implements the Backend Interface. It's currently not supported for the CS3 backend

func (*CS3) DeleteUser

func (i *CS3) DeleteUser(ctx context.Context, nameOrID string) error

DeleteUser 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)

func (*CS3) GetGroupMembers

func (i *CS3) GetGroupMembers(ctx context.Context, groupID string) ([]*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, queryParam url.Values) ([]*libregraph.Group, error)

func (*CS3) GetUser

func (i *CS3) GetUser(ctx context.Context, userID string, queryParam url.Values) (*libregraph.User, error)

func (*CS3) GetUsers

func (i *CS3) GetUsers(ctx context.Context, queryParam url.Values) ([]*libregraph.User, error)

func (*CS3) RemoveMemberFromGroup

func (i *CS3) RemoveMemberFromGroup(ctx context.Context, groupID string, memberID string) error

RemoveMemberFromGroup 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.User) (*libregraph.User, error)

UpdateUser implements the Backend Interface. It's currently not suported for the CS3 backend

type LDAP

type LDAP struct {
	// contains filtered or unexported fields
}

func NewLDAPBackend

func NewLDAPBackend(lc ldap.Client, config config.LDAP, logger *log.Logger) (*LDAP, error)

func (*LDAP) AddMembersToGroup

func (i *LDAP) AddMembersToGroup(ctx context.Context, groupID string, memberIDs []string) error

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) 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) 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) DeleteGroup

func (i *LDAP) DeleteGroup(ctx context.Context, id string) error

DeleteGroup implements the Backend Interface.

func (*LDAP) DeleteUser

func (i *LDAP) DeleteUser(ctx context.Context, nameOrID string) error

DeleteUser implements the Backend Interface. It permanently deletes a User identified by name or id from the LDAP server

func (*LDAP) GetGroup

func (i *LDAP) GetGroup(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.Group, error)

func (*LDAP) GetGroupMembers

func (i *LDAP) GetGroupMembers(ctx context.Context, groupID string) ([]*libregraph.User, error)

GetGroupMembers implements the Backend Interface for the LDAP Backend

func (*LDAP) GetGroups

func (i *LDAP) GetGroups(ctx context.Context, queryParam url.Values) ([]*libregraph.Group, error)

func (*LDAP) GetUser

func (i *LDAP) GetUser(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.User, error)

func (*LDAP) GetUsers

func (i *LDAP) GetUsers(ctx context.Context, queryParam url.Values) ([]*libregraph.User, error)

func (*LDAP) RemoveMemberFromGroup

func (i *LDAP) RemoveMemberFromGroup(ctx context.Context, groupID string, memberID string) error

RemoveMemberFromGroup implements the Backend Interface.

func (*LDAP) UpdateUser

func (i *LDAP) UpdateUser(ctx context.Context, nameOrID string, user libregraph.User) (*libregraph.User, error)

UpdateUser implements the Backend Interface for the LDAP Backend

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL