models

package
v4.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL idm.ACL

func (*ACL) Equals

func (a *ACL) Equals(o merger.Differ) bool

func (*ACL) GetUniqueId

func (a *ACL) GetUniqueId() string

func (*ACL) IsDeletable

func (a *ACL) IsDeletable(m map[string]string) bool

func (*ACL) IsMergeable

func (a *ACL) IsMergeable(o merger.Differ) bool

IsMergeable tests if two user can be mergeable whose the same login name and auth source

func (*ACL) Merge

func (a *ACL) Merge(o merger.Differ, options map[string]string) (merger.Differ, error)

type ACLDiff

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

func (*ACLDiff) Add

func (a *ACLDiff) Add(vs ...interface{})

func (*ACLDiff) Delete

func (a *ACLDiff) Delete(vs ...interface{})

func (*ACLDiff) ToAdd

func (a *ACLDiff) ToAdd() []interface{}

func (*ACLDiff) ToDelete

func (a *ACLDiff) ToDelete() []interface{}

func (*ACLDiff) ToUpdate

func (a *ACLDiff) ToUpdate() []interface{}

func (*ACLDiff) Update

func (a *ACLDiff) Update(vs ...interface{})

type GroupDiff

type GroupDiff struct {
	// List of user to be updated
	Update map[string]*idm.User

	// List of user to be deleted
	Delete map[string]*idm.User

	// List of user to be created
	Create map[string]*idm.User
}

type MergeOptions

type MergeOptions struct {
	SyncType   MergeSyncType
	Origin     string
	AuthSource string
	RolePrefix string
}

func (*MergeOptions) ToMap

func (m *MergeOptions) ToMap() map[string]string

type MergeSyncType

type MergeSyncType int
const (
	FULLSYNC MergeSyncType = iota
	CREATEONLYSYNC
	NODELETESYNC
)

type PhpUserMeta

type PhpUserMeta struct {
	NodeName string
	UserName string
	Meta     map[string]interface{}
}

func Map2LocalMeta

func Map2LocalMeta(m map[string]interface{}) (out []*PhpUserMeta, e error)

func UserMetasFromPhpData

func UserMetasFromPhpData(serializedData []byte) (metas []*PhpUserMeta, outErr error)

type ReadableStore

type ReadableStore interface {
	ListUsers(context.Context, map[string]interface{}, chan float32) (map[string]*idm.User, error)
	ListGroups(context.Context, map[string]interface{}) ([]*idm.User, error)
	ListRoles(context.Context, ReadableStore, map[string]interface{}) ([]*idm.Role, error)
	ListACLs(context.Context, map[string]interface{}) ([]*idm.ACL, error)

	ListShares(context.Context, map[string]interface{}) ([]*SyncShare, error)
	CrossLoadShare(context.Context, *SyncShare, ReadableStore, map[string]interface{}) error

	GetUserInfo(c context.Context, userName string, params map[string]interface{}) (u *idm.User, aclCtxt context.Context, e error)
	GetGroupInfo(c context.Context, groupPath string, params map[string]interface{}) (u *idm.User, e error)
	ReadNode(c context.Context, wsUuid string, wsPath string) (*tree.Node, error)
}

ReadableStore interface defines the objects to be able to list from a store

type Role

type Role idm.Role

func (*Role) Equals

func (r *Role) Equals(differ merger.Differ) bool

func (*Role) GetUniqueId

func (r *Role) GetUniqueId() string

func (*Role) IsDeletable

func (r *Role) IsDeletable(m map[string]string) bool

func (*Role) IsMergeable

func (r *Role) IsMergeable(d merger.Differ) bool

func (*Role) Merge

func (r *Role) Merge(differ merger.Differ, params map[string]string) (merger.Differ, error)

type RoleDiff

type RoleDiff struct {
	// List of user to be updated
	Updates map[string]*idm.Role

	// List of user to be deleted
	Deletes map[string]*idm.Role

	// List of user to be created
	Creates map[string]*idm.Role
}

func NewRolesDiff

func NewRolesDiff() *RoleDiff

func (*RoleDiff) Add

func (a *RoleDiff) Add(vs ...interface{})

func (*RoleDiff) Delete

func (a *RoleDiff) Delete(vs ...interface{})

func (*RoleDiff) ToAdd

func (a *RoleDiff) ToAdd() []interface{}

func (*RoleDiff) ToDelete

func (a *RoleDiff) ToDelete() []interface{}

func (*RoleDiff) ToUpdate

func (a *RoleDiff) ToUpdate() []interface{}

func (*RoleDiff) Update

func (a *RoleDiff) Update(vs ...interface{})

type ShareDiff

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

func (*ShareDiff) Add

func (a *ShareDiff) Add(vs ...interface{})

func (*ShareDiff) Delete

func (a *ShareDiff) Delete(vs ...interface{})

func (*ShareDiff) ToAdd

func (a *ShareDiff) ToAdd() []interface{}

func (*ShareDiff) ToDelete

func (a *ShareDiff) ToDelete() []interface{}

func (*ShareDiff) ToUpdate

func (a *ShareDiff) ToUpdate() []interface{}

func (*ShareDiff) Update

func (a *ShareDiff) Update(vs ...interface{})

type SyncShare

type SyncShare struct {
	OwnerUser    *idm.User
	OwnerContext context.Context

	Cell           *rest.Cell
	Link           *rest.ShareLink
	LinkPassword   string
	PasswordHashed bool

	InternalData interface{}
}

func (*SyncShare) Equals

func (s *SyncShare) Equals(o merger.Differ) bool

func (*SyncShare) GetInternalData

func (s *SyncShare) GetInternalData() interface{}

func (*SyncShare) GetUniqueId

func (s *SyncShare) GetUniqueId() string

func (*SyncShare) IsDeletable

func (s *SyncShare) IsDeletable(m map[string]string) bool

func (*SyncShare) IsMergeable

func (s *SyncShare) IsMergeable(o merger.Differ) bool

func (*SyncShare) Merge

func (s *SyncShare) Merge(o merger.Differ, options map[string]string) (merger.Differ, error)

type User

type User struct {
	*idm.User
}

func (*User) Equal

func (u *User) Equal(other *idm.User) bool

func (*User) GetUniqueId

func (u *User) GetUniqueId() string

func (*User) IsEmpty

func (u *User) IsEmpty() bool

func (*User) IsMergeable

func (u *User) IsMergeable(other *idm.User) bool

IsMergeable test if two user can be mergeable whose the same login name and auth source

func (*User) Merge

func (u *User) Merge(idmUser *idm.User, options *MergeOptions) (*idm.User, error, bool)

type UserDiff

type UserDiff struct {
	// List of user to be updated
	Update map[string]*idm.User

	// List of user to be deleted
	Delete map[string]*idm.User

	// List of user to be created
	Create map[string]*idm.User
}

func NewUserDiff

func NewUserDiff() *UserDiff

type WritableStore

type WritableStore interface {
	ReadableStore

	CreateUser(context.Context, *idm.User) (*idm.User, error)
	UpdateUser(context.Context, *idm.User) (*idm.User, error)
	DeleteUser(context.Context, *idm.User) error
	PutGroup(context.Context, *idm.User) error
	DeleteGroup(context.Context, *idm.User) error
	PutRole(context.Context, *idm.Role) (*idm.Role, error)
	DeleteRole(context.Context, *idm.Role) error
	PutACL(context.Context, *idm.ACL) error
	DeleteACL(context.Context, *idm.ACL) error
	PutShare(context.Context, *SyncShare) error
}

WritableStore defines the function required to write to a store

Jump to

Keyboard shortcuts

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