enterprise

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 22 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 AvailableRoleEnforcements

func AvailableRoleEnforcements(cb func(IEnforcement) bool)

func AvailableRolePrivileges

func AvailableRolePrivileges() []string

func GetEnterpriseIds

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

func ToEnforcementValue

func ToEnforcementValue(loader IEnterpriseLoader, eType string, eValue string) (value string, shouldRemove bool, err error)

Types

type IBridge

type IBridge interface {
	BridgeId() int64
	NodeId() int64
	WanIpEnforcement() string
	LanIpEnforcement() string
	Status() string
	storage.IUid[int64]
}

type IEmailProvision

type IEmailProvision interface {
	Id() int64
	NodeId() int64
	Domain() string
	Method() string
	storage.IUid[int64]
}

type IEnforcement

type IEnforcement interface {
	Id() int
	Name() string
	ValueType() string
	Group() string
}

const (

RoleEnforcementGroup_LoginSettings           = "LOGIN_SETTINGS"
RoleEnforcementGroup_AccountSettings         = "ACCOUNT_SETTINGS"
RoleEnforcementGroup_TwoFactorAuthentication = "TWO_FACTOR_AUTHENTICATION"
RoleEnforcementGroup_PlatformRestriction     = "PLATFORM_RESTRICTION"
RoleEnforcementGroup_VaultFeatures           = "VAULT_FEATURES"
RoleEnforcementGroup_RecordTypes             = "RECORD_TYPES"
RoleEnforcementGroup_SharingAndUploading     = "SHARING_AND_UPLOADING"
RoleEnforcementGroup_SharingAndCreating      = "CREATING_AND_SHARING"
RoleEnforcementGroup_KeeperFill              = "KEEPER_FILL"
RoleEnforcementGroup_Allow_IP_List           = "ALLOW_IP_LIST"

) const (

RoleEnforcementType_Boolean           = "BOOLEAN"
RoleEnforcementType_Long              = "LONG"
RoleEnforcementType_String            = "STRING"
RoleEnforcementType_Json              = "JSON"
RoleEnforcementType_JsonArray         = "JSONARRAY"
RoleEnforcementType_TernaryDen        = "TERNARY_DEN"
RoleEnforcementType_TernaryEdn        = "TERNARY_EDN"
RoleEnforcementType_AccountShare      = "ACCOUNT_SHARE"
RoleEnforcementType_IP_WhiteList      = "IP_WHITELIST"
RoleEnforcementType_TwoFactorDuration = "TWO_FACTOR_DURATION"
RoleEnforcementType_RecordTypes       = "RECORD_TYPES"

)

type IEnterpriseEntity

type IEnterpriseEntity[T storage.IUid[K], K storage.Key] 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 storage.IUidLink[KS, KO], KS storage.Key, KO storage.Key] 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
	LoadRoleKeys(map[int64][]byte) error
	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
	ModifyRoleUsers(roleUsersToAdd []IRoleUser, roleUsersToRemove []IRoleUser) []error
	ModifyRoleTeams(roleTeamsToAdd []IRoleTeam, roleTeamsToRemove []IRoleTeam) []error
	ModifyManagedNodes(managedNodesToAdd []IManagedNode, managedNodesToUpdate []IManagedNode, managedNodesToRemove []IManagedNode) []error
	ModifyRolePrivileges(privileges []IRolePrivilege) []error
	ModifyRoleEnforcements(enforcementsToSet []IRoleEnforcement) []error

	Commit() []error
}

func NewSyncEnterpriseManagement

func NewSyncEnterpriseManagement(loader IEnterpriseLoader) IEnterpriseManagement

type IEnterpriseStorage

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

func NewSqliteEnterpriseStorage

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

type ILicense

type ILicense interface {
	EnterpriseLicenseId() int64
	LicenseKeyId() int32
	ProductTypeId() int32
	FilePlanId() int32
	Name() string
	NumberOfSeats() int32
	SeatsAllocated() int32
	SeatsPending() int32
	AddOns() []ILicenseAddOn
	LicenseStatus() string
	NextBillingDate() int64
	Expiration() int64
	StorageExpiration() int64
	Distributor() bool
	MspPermits() []IMspPermits
	ManagedBy() IMspContact
	storage.IUid[int64]
}

type ILicenseAddOn

type ILicenseAddOn interface {
	Name() string
	Enabled() bool
	IncludedInProduct() bool
	IsTrial() bool
	Seats() int32
	ApiCallCount() int32
	Created() int64
	ActivationTime() int64
	Expiration() int64
}

type IManageNodeEdit

type IManageNodeEdit interface {
	IManagedNode
	SetCascadeNodeManagement(bool)
}

func NewManagedNode

func NewManagedNode(roleId int64, nodeId int64) IManageNodeEdit

type IManagedCompany

type IManagedCompany interface {
	McEnterpriseId() int64
	McEnterpriseName() string
	MspNodeId() int64
	NumberOfSeats() int32
	NumberOfUsers() int32
	ProductId() string
	IsExpired() bool
	TreeKey() string
	TreeKeyRole() int64
	FilePlanType() string
	AddOns() []ILicenseAddOn
	storage.IUid[int64]
}

type IManagedNode

type IManagedNode interface {
	RoleId() int64
	ManagedNodeId() int64
	CascadeNodeManagement() bool
	storage.IUidLink[int64, int64]
}

type IMcDefault

type IMcDefault interface {
	McProduct() string
	FilePlanType() string
	MaxLicenses() int32
	Addons() []string
	FixedMaxLicenses() bool
}

type IMspContact

type IMspContact interface {
	EnterpriseId() int32
	EnterpriseName() string
}

type IMspPermits

type IMspPermits interface {
	Restricted() bool
	MaxFilePlanType() string
	AllowUnlimitedLicenses() bool
	AllowedMcProducts() []string
	AllowedAddOns() []string
	McDefaults() []IMcDefault
}

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
	storage.IUid[int64]
}

type INodeEdit

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

func CloneNode

func CloneNode(n INode) INodeEdit

func NewNode

func NewNode(nodeId int64) INodeEdit

type IQueuedTeam

type IQueuedTeam interface {
	TeamUid() string
	Name() string
	NodeId() int64
	EncryptedData() string
	storage.IUid[string]
}

type IQueuedTeamUser

type IQueuedTeamUser interface {
	TeamUid() string
	EnterpriseUserId() int64
	storage.IUidLink[string, int64]
}

type IRole

type IRole interface {
	RoleId() int64
	Name() string
	NodeId() int64
	KeyType() string
	VisibleBelow() bool
	NewUserInherit() bool
	RoleType() string
	EncryptedData() string
	storage.IUid[int64]
}

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
	EnforcementType() string
	Value() string
	storage.IUidLink[int64, string]
}

type IRoleEnforcementEdit

type IRoleEnforcementEdit interface {
	IRoleEnforcement
	SetValue(string)
}

func CloneRoleEnforcement

func CloneRoleEnforcement(other IRoleEnforcement) IRoleEnforcementEdit

func NewRoleEnforcement

func NewRoleEnforcement(roleId int64, enforcementType string) IRoleEnforcementEdit

type IRolePrivilege

type IRolePrivilege interface {
	RoleId() int64
	ManagedNodeId() int64
	ManageNodes() bool
	ManageUsers() bool
	ManageRoles() bool
	ManageTeams() bool
	RunReports() bool
	ManageBridge() bool
	ApproveDevices() bool
	ManageRecordTypes() bool
	SharingAdministrator() bool
	RunComplianceReport() bool
	TransferAccount() bool
	ManageCompanies() bool
	ToSet() api.Set[string]
	storage.IUidLink[int64, int64]
}

type IRolePrivilegeEdit

type IRolePrivilegeEdit interface {
	IRolePrivilege
	SetManageNodes(bool)
	SetManageUsers(bool)
	SetManageRoles(bool)
	SetManageTeams(bool)
	SetRunReports(bool)
	SetManageBridge(bool)
	SetApproveDevices(bool)
	SetManageRecordTypes(bool)
	SetSharingAdministrator(bool)
	SetRunComplianceReport(bool)
	SetTransferAccount(bool)
	SetManageCompanies(bool)
	SetPrivilege(string, bool)
}

func NewRolePrivilege

func NewRolePrivilege(roleId int64, nodeId int64) IRolePrivilegeEdit

type IRoleTeam

type IRoleTeam interface {
	RoleId() int64
	TeamUid() string
	storage.IUidLink[int64, string]
}

func NewRoleTeam

func NewRoleTeam(roleId int64, teamUid string) IRoleTeam

type IRoleUser

type IRoleUser interface {
	RoleId() int64
	EnterpriseUserId() int64
	storage.IUidLink[int64, int64]
}

func NewRoleUser

func NewRoleUser(roleId int64, enterpriseUserId int64) IRoleUser

type IScim

type IScim interface {
	ScimId() int64
	NodeId() int64
	Status() string
	LastSynced() int64
	RolePrefix() string
	UniqueGroups() bool
	storage.IUid[int64]
}

type ISsoService

type ISsoService interface {
	SsoServiceProviderId() int64
	NodeId() int64
	Name() string
	SpUrl() string
	InviteNewUsers() bool
	Active() bool
	IsCloud() bool
	storage.IUid[int64]
}

type ITeam

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

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
	storage.IUidLink[string, int64]
}

type ITeamUserEdit

type ITeamUserEdit interface {
	ITeamUser
	SetUserType(string)
}

func NewTeamUser

func NewTeamUser(teamUid string, enterpriseUserId int64) ITeamUserEdit

type IUser

type IUser interface {
	EnterpriseUserId() int64
	Username() string
	FullName() string
	JobTitle() string
	NodeId() int64
	Status() UserStatus
	Lock() UserLock
	UserId() int32
	AccountShareExpiration() int64
	TfaEnabled() bool
	TransferAcceptanceStatus() int32
	storage.IUid[int64]
}

type IUserAlias

type IUserAlias interface {
	EnterpriseUserId() int64
	Username() string
	storage.IUidLink[int64, string]
}

type IUserEdit

type IUserEdit interface {
	IUser
	SetFullName(string)
	SetJobTitle(string)
	SetNodeId(int64)
	SetLock(UserLock)
}

func NewUser

func NewUser(enterpriseUserId int64, username string, status UserStatus) IUserEdit

type LinkKey

type LinkKey[KS storage.Key, KO storage.Key] struct {
	V1 KS
	V2 KO
}

type UserLock

type UserLock int32
const (
	UserLock_Unlocked UserLock = 0
	UserLock_Locked   UserLock = 1
	UserLock_Disabled UserLock = 2
)

type UserStatus

type UserStatus string
const (
	UserStatus_Active   UserStatus = "active"
	UserStatus_Inactive UserStatus = "inactive"
)

Jump to

Keyboard shortcuts

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