enterprise

package
v0.0.0-...-044a9da Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RolePrivilege_ManageNodes          = "MANAGE_NODES"
	RolePrivilege_ManageUsers          = "MANAGE_USER"
	RolePrivilege_ManageLicences       = "MANAGE_LICENCES"
	RolePrivilege_ManageRoles          = "MANAGE_ROLES"
	RolePrivilege_ManageTeams          = "MANAGE_TEAMS"
	RolePrivilege_RunSecurityReports   = "RUN_REPORTS"
	RolePrivilege_ManageBridge         = "MANAGE_BRIDGE"
	RolePrivilege_ApproveDevice        = "APPROVE_DEVICE"
	RolePrivilege_ManageRecordTypes    = "MANAGE_RECORD_TYPES"
	RolePrivilege_RunComplianceReports = "RUN_COMPLIANCE_REPORTS"
	RolePrivilege_ManageCompanies      = "MANAGE_COMPANIES"
	RolePrivilege_TransferAccount      = "TRANSFER_ACCOUNT"
	RolePrivilege_SharingAdministrator = "SHARING_ADMINISTRATOR"
)

Variables

This section is empty.

Functions

func AvailableRolePrivileges

func AvailableRolePrivileges() []string

func GetEnterpriseIds

func GetEnterpriseIds(keeperAuth auth.IKeeperAuth, numberRequested int) (eids []int64, err error)

Types

type EncryptedData

type EncryptedData struct {
	DisplayName string `json:"displayname,omitempty"`
}

type EnterpriseEntityData

type EnterpriseEntityData struct {
	Type int64  `db:"type"`
	Key  string `db:"key"`
	Data []byte `db:"data"`
}

type EnterpriseSettings

type EnterpriseSettings struct {
	ContinuationToken []byte `db:"continuation_token"`
}

type IEnterpriseData

type IEnterpriseData interface {
	EnterpriseInfo() IEnterpriseInfo
	Nodes() IEnterpriseEntity[INode, int64]
	Roles() IEnterpriseEntity[IRole, int64]
	Users() IEnterpriseEntity[IUser, int64]
	Teams() IEnterpriseEntity[ITeam, string]
	TeamUsers() IEnterpriseLink[ITeamUser, string, int64]
	RoleUsers() IEnterpriseLink[IRoleUser, int64, int64]
	RolePrivileges() IEnterpriseLink[IRolePrivilege, int64, int64]
	//RoleEnforcements() map[int64]*RoleEnforcement
	//ManagedNodes() map[int64][]*ManagedNode
	//GetRoleKey(roleId int64) []byte
	GetRootNode() INode
}

type IEnterpriseEntity

type IEnterpriseEntity[T interface{}, K comparable] interface {
	GetAllEntities(func(T) bool)
	GetEntity(K) T
}

type IEnterpriseInfo

type IEnterpriseInfo interface {
	EnterpriseName() string
	IsDistributor() bool
	TreeKey() []byte
	RsaPrivateKey() *rsa.PrivateKey
	EcPrivateKey() *ecdh.PrivateKey
}
type IEnterpriseLink[T interface{}, KS comparable, KO comparable] interface {
	GetLink(KS, KO) T
	GetLinksBySubject(KS, func(T) bool)
	GetLinksByObject(KO, func(T) bool)
	GetAllLinks(func(T) bool)
}

type IEnterpriseLoader

type IEnterpriseLoader interface {
	Storage() IEnterpriseStorage
	EnterpriseData() IEnterpriseData
	KeeperAuth() auth.IKeeperAuth
	Load() error
}

func NewEnterpriseLoader

func NewEnterpriseLoader(keeperAuth auth.IKeeperAuth, storage IEnterpriseStorage) IEnterpriseLoader

type IEnterpriseManagement

type IEnterpriseManagement interface {
	GetEnterpriseId() (int64, error)
	EnterpriseData() IEnterpriseData
	ModifyNodes(nodesToAdd []INode, nodesToUpdate []INode, nodesToDelete []int64) []error
	ModifyRoles(rolesToAdd []IRole, rolesToUpdate []IRole, rolesToDelete []int64) []error
	ModifyTeams(teamsToAdd []ITeam, teamsToUpdate []ITeam, teamsToDelete []string) []error
	ModifyTeamUsers(teamUsersToAdd []ITeamUser, teamUsersToRemove []ITeamUser) []error
}

func NewSyncEnterpriseManagement

func NewSyncEnterpriseManagement(loader IEnterpriseLoader) IEnterpriseManagement

type IEnterpriseStorage

type IEnterpriseStorage interface {
	ContinuationToken() ([]byte, error)
	SetContinuationToken([]byte) error
	GetEntities(func(int32, []byte) bool) error
	PutEntity(int32, string, []byte) error
	DeleteEntity(int32, string) error
	Flush() error
	Clear()
}

func NewSqliteEnterpriseStorage

func NewSqliteEnterpriseStorage(getConnection func() *sqlx.DB, enterpriseId int64) (storage IEnterpriseStorage, err error)

type IManagedNode

type IManagedNode interface {
	RoleId() int64
	ManagedNodeId() int64
	CascadeNodeManagement() bool
}

type INode

type INode interface {
	NodeId() int64
	Name() string
	ParentId() int64
	BridgeId() int64
	ScimId() int64
	LicenseId() int64
	DuoEnabled() bool
	RsaEnabled() bool
	RestrictVisibility() bool
	SsoServiceProviderId() []int64
	EncryptedData() string
}

type INodeEdit

type INodeEdit interface {
	INode
	SetName(string)
	SetParentId(int64)
	SetRestrictVisibility(bool)
}

func CloneNode

func CloneNode(n INode) INodeEdit

func NewNode

func NewNode(nodeId int64) INodeEdit

type IRole

type IRole interface {
	RoleId() int64
	Name() string
	NodeId() int64
	KeyType() string
	VisibleBelow() bool
	NewUserInherit() bool
	RoleType() string
	EncryptedData() string
}

type IRoleEdit

type IRoleEdit interface {
	IRole
	SetName(string)
	SetNodeId(int64)
	SetKeyType(string)
	SetVisibleBelow(bool)
	SetNewUserInherit(bool)
}

func CloneRole

func CloneRole(r IRole) IRoleEdit

func NewRole

func NewRole(roleId int64) IRoleEdit

type IRoleEnforcement

type IRoleEnforcement interface {
	RoleId() int64
	Enforcements() map[string]string
}

type IRolePrivilege

type IRolePrivilege interface {
	RoleId() int64
	ManagedNodeId() int64
	Privileges() []string
}

type IRolePrivilegeEdit

type IRolePrivilegeEdit interface {
	IRolePrivilege
	SetPrivilege(string)
	RemovePrivilege(string)
}

type IRoleUser

type IRoleUser interface {
	RoleId() int64
	EnterpriseUserId() int64
}

type ITeam

type ITeam interface {
	TeamUid() string
	Name() string
	NodeId() int64
	RestrictEdit() bool
	RestrictShare() bool
	RestrictView() bool
	EncryptedTeamKey() []byte
}

type ITeamEdit

type ITeamEdit interface {
	ITeam
	SetName(string)
	SetNodeId(int64)
	SetRestrictEdit(bool)
	SetRestrictShare(bool)
	SetRestrictView(bool)
}

func CloneTeam

func CloneTeam(t ITeam) ITeamEdit

func NewTeam

func NewTeam(teamUid string) ITeamEdit

type ITeamUser

type ITeamUser interface {
	TeamUid() string
	EnterpriseUserId() int64
	UserType() string
}

type IUser

type IUser interface {
	EnterpriseUserId() int64
	Username() string
	FullName() string
	JobTitle() string
	NodeId() int64
	Status() string
	Lock() int32
	UserId() int32
	AccountShareExpiration() int64
	TfaEnabled() bool
	TransferAcceptanceStatus() int32
}

type LinkKey

type LinkKey[KS comparable, KO comparable] struct {
	V1 KS
	V2 KO
}

Jump to

Keyboard shortcuts

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