mock_server

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ManagementServiceServerMock

type ManagementServiceServerMock struct {
	proto.UnimplementedManagementServiceServer

	LoginFunc                      func(context.Context, *proto.EncryptedMessage) (*proto.EncryptedMessage, error)
	SyncFunc                       func(*proto.EncryptedMessage, proto.ManagementService_SyncServer)
	GetServerKeyFunc               func(context.Context, *proto.Empty) (*proto.ServerKeyResponse, error)
	IsHealthyFunc                  func(context.Context, *proto.Empty) (*proto.Empty, error)
	GetDeviceAuthorizationFlowFunc func(ctx context.Context, req *proto.EncryptedMessage) (*proto.EncryptedMessage, error)
	GetPKCEAuthorizationFlowFunc   func(ctx context.Context, req *proto.EncryptedMessage) (*proto.EncryptedMessage, error)
	SyncMetaFunc                   func(ctx context.Context, req *proto.EncryptedMessage) (*proto.Empty, error)
}

func (ManagementServiceServerMock) GetDeviceAuthorizationFlow

func (m ManagementServiceServerMock) GetDeviceAuthorizationFlow(ctx context.Context, req *proto.EncryptedMessage) (*proto.EncryptedMessage, error)

func (ManagementServiceServerMock) GetPKCEAuthorizationFlow added in v0.22.0

func (ManagementServiceServerMock) GetServerKey

func (ManagementServiceServerMock) IsHealthy

func (m ManagementServiceServerMock) IsHealthy(ctx context.Context, empty *proto.Empty) (*proto.Empty, error)

func (ManagementServiceServerMock) Login

func (ManagementServiceServerMock) Sync

func (ManagementServiceServerMock) SyncMeta added in v0.28.0

type MockAccountManager

type MockAccountManager struct {
	GetOrCreateAccountByUserFunc func(ctx context.Context, userId, domain string) (*types.Account, error)
	GetAccountFunc               func(ctx context.Context, accountID string) (*types.Account, error)
	CreateSetupKeyFunc           func(ctx context.Context, accountId string, keyName string, keyType types.SetupKeyType,
		expiresIn time.Duration, autoGroups []string, usageLimit int, userID string, ephemeral bool, allowExtraDNSLabels bool) (*types.SetupKey, error)
	GetSetupKeyFunc                     func(ctx context.Context, accountID, userID, keyID string) (*types.SetupKey, error)
	AccountExistsFunc                   func(ctx context.Context, accountID string) (bool, error)
	GetAccountIDByUserIdFunc            func(ctx context.Context, userId, domain string) (string, error)
	GetUserFromUserAuthFunc             func(ctx context.Context, userAuth nbcontext.UserAuth) (*types.User, error)
	ListUsersFunc                       func(ctx context.Context, accountID string) ([]*types.User, error)
	GetPeersFunc                        func(ctx context.Context, accountID, userID string) ([]*nbpeer.Peer, error)
	MarkPeerConnectedFunc               func(ctx context.Context, peerKey string, connected bool, realIP net.IP) error
	SyncAndMarkPeerFunc                 func(ctx context.Context, accountID string, peerPubKey string, meta nbpeer.PeerSystemMeta, realIP net.IP) (*nbpeer.Peer, *types.NetworkMap, []*posture.Checks, error)
	DeletePeerFunc                      func(ctx context.Context, accountID, peerKey, userID string) error
	GetNetworkMapFunc                   func(ctx context.Context, peerKey string) (*types.NetworkMap, error)
	GetPeerNetworkFunc                  func(ctx context.Context, peerKey string) (*types.Network, error)
	AddPeerFunc                         func(ctx context.Context, setupKey string, userId string, peer *nbpeer.Peer) (*nbpeer.Peer, *types.NetworkMap, []*posture.Checks, error)
	GetGroupFunc                        func(ctx context.Context, accountID, groupID, userID string) (*types.Group, error)
	GetAllGroupsFunc                    func(ctx context.Context, accountID, userID string) ([]*types.Group, error)
	GetGroupByNameFunc                  func(ctx context.Context, accountID, groupName string) (*types.Group, error)
	SaveGroupFunc                       func(ctx context.Context, accountID, userID string, group *types.Group) error
	SaveGroupsFunc                      func(ctx context.Context, accountID, userID string, groups []*types.Group) error
	DeleteGroupFunc                     func(ctx context.Context, accountID, userId, groupID string) error
	DeleteGroupsFunc                    func(ctx context.Context, accountId, userId string, groupIDs []string) error
	GroupAddPeerFunc                    func(ctx context.Context, accountID, groupID, peerID string) error
	GroupDeletePeerFunc                 func(ctx context.Context, accountID, groupID, peerID string) error
	GetPeerGroupsFunc                   func(ctx context.Context, accountID, peerID string) ([]*types.Group, error)
	DeleteRuleFunc                      func(ctx context.Context, accountID, ruleID, userID string) error
	GetPolicyFunc                       func(ctx context.Context, accountID, policyID, userID string) (*types.Policy, error)
	SavePolicyFunc                      func(ctx context.Context, accountID, userID string, policy *types.Policy) (*types.Policy, error)
	DeletePolicyFunc                    func(ctx context.Context, accountID, policyID, userID string) error
	ListPoliciesFunc                    func(ctx context.Context, accountID, userID string) ([]*types.Policy, error)
	GetUsersFromAccountFunc             func(ctx context.Context, accountID, userID string) (map[string]*types.UserInfo, error)
	UpdatePeerMetaFunc                  func(ctx context.Context, peerID string, meta nbpeer.PeerSystemMeta) error
	UpdatePeerFunc                      func(ctx context.Context, accountID, userID string, peer *nbpeer.Peer) (*nbpeer.Peer, error)
	CreateRouteFunc                     func(ctx context.Context, accountID string, prefix netip.Prefix, networkType route.NetworkType, domains domain.List, peer string, peerGroups []string, description string, netID route.NetID, masquerade bool, metric int, groups, accessControlGroupIDs []string, enabled bool, userID string, keepRoute bool) (*route.Route, error)
	GetRouteFunc                        func(ctx context.Context, accountID string, routeID route.ID, userID string) (*route.Route, error)
	SaveRouteFunc                       func(ctx context.Context, accountID string, userID string, route *route.Route) error
	DeleteRouteFunc                     func(ctx context.Context, accountID string, routeID route.ID, userID string) error
	ListRoutesFunc                      func(ctx context.Context, accountID, userID string) ([]*route.Route, error)
	SaveSetupKeyFunc                    func(ctx context.Context, accountID string, key *types.SetupKey, userID string) (*types.SetupKey, error)
	ListSetupKeysFunc                   func(ctx context.Context, accountID, userID string) ([]*types.SetupKey, error)
	SaveUserFunc                        func(ctx context.Context, accountID, userID string, user *types.User) (*types.UserInfo, error)
	SaveOrAddUserFunc                   func(ctx context.Context, accountID, userID string, user *types.User, addIfNotExists bool) (*types.UserInfo, error)
	SaveOrAddUsersFunc                  func(ctx context.Context, accountID, initiatorUserID string, update []*types.User, addIfNotExists bool) ([]*types.UserInfo, error)
	DeleteUserFunc                      func(ctx context.Context, accountID string, initiatorUserID string, targetUserID string) error
	DeleteRegularUsersFunc              func(ctx context.Context, accountID, initiatorUserID string, targetUserIDs []string, userInfos map[string]*types.UserInfo) error
	CreatePATFunc                       func(ctx context.Context, accountID string, initiatorUserID string, targetUserId string, tokenName string, expiresIn int) (*types.PersonalAccessTokenGenerated, error)
	DeletePATFunc                       func(ctx context.Context, accountID string, initiatorUserID string, targetUserId string, tokenID string) error
	GetPATFunc                          func(ctx context.Context, accountID string, initiatorUserID string, targetUserId string, tokenID string) (*types.PersonalAccessToken, error)
	GetAllPATsFunc                      func(ctx context.Context, accountID string, initiatorUserID string, targetUserId string) ([]*types.PersonalAccessToken, error)
	GetNameServerGroupFunc              func(ctx context.Context, accountID, userID, nsGroupID string) (*nbdns.NameServerGroup, error)
	CreateNameServerGroupFunc           func(ctx context.Context, accountID string, name, description string, nameServerList []nbdns.NameServer, groups []string, primary bool, domains []string, enabled bool, userID string, searchDomainsEnabled bool) (*nbdns.NameServerGroup, error)
	SaveNameServerGroupFunc             func(ctx context.Context, accountID, userID string, nsGroupToSave *nbdns.NameServerGroup) error
	DeleteNameServerGroupFunc           func(ctx context.Context, accountID, nsGroupID, userID string) error
	ListNameServerGroupsFunc            func(ctx context.Context, accountID string, userID string) ([]*nbdns.NameServerGroup, error)
	CreateUserFunc                      func(ctx context.Context, accountID, userID string, key *types.UserInfo) (*types.UserInfo, error)
	GetAccountIDFromUserAuthFunc        func(ctx context.Context, userAuth nbcontext.UserAuth) (string, string, error)
	DeleteAccountFunc                   func(ctx context.Context, accountID, userID string) error
	GetDNSDomainFunc                    func() string
	StoreEventFunc                      func(ctx context.Context, initiatorID, targetID, accountID string, activityID activity.ActivityDescriber, meta map[string]any)
	GetEventsFunc                       func(ctx context.Context, accountID, userID string) ([]*activity.Event, error)
	GetDNSSettingsFunc                  func(ctx context.Context, accountID, userID string) (*types.DNSSettings, error)
	SaveDNSSettingsFunc                 func(ctx context.Context, accountID, userID string, dnsSettingsToSave *types.DNSSettings) error
	GetPeerFunc                         func(ctx context.Context, accountID, peerID, userID string) (*nbpeer.Peer, error)
	UpdateAccountSettingsFunc           func(ctx context.Context, accountID, userID string, newSettings *types.Settings) (*types.Account, error)
	LoginPeerFunc                       func(ctx context.Context, login server.PeerLogin) (*nbpeer.Peer, *types.NetworkMap, []*posture.Checks, error)
	SyncPeerFunc                        func(ctx context.Context, sync server.PeerSync, accountID string) (*nbpeer.Peer, *types.NetworkMap, []*posture.Checks, error)
	InviteUserFunc                      func(ctx context.Context, accountID string, initiatorUserID string, targetUserEmail string) error
	GetAllConnectedPeersFunc            func() (map[string]struct{}, error)
	HasConnectedChannelFunc             func(peerID string) bool
	GetExternalCacheManagerFunc         func() server.ExternalCacheManager
	GetPostureChecksFunc                func(ctx context.Context, accountID, postureChecksID, userID string) (*posture.Checks, error)
	SavePostureChecksFunc               func(ctx context.Context, accountID, userID string, postureChecks *posture.Checks) (*posture.Checks, error)
	DeletePostureChecksFunc             func(ctx context.Context, accountID, postureChecksID, userID string) error
	ListPostureChecksFunc               func(ctx context.Context, accountID, userID string) ([]*posture.Checks, error)
	GetIdpManagerFunc                   func() idp.Manager
	UpdateIntegratedValidatorGroupsFunc func(ctx context.Context, accountID string, userID string, groups []string) error
	GroupValidationFunc                 func(ctx context.Context, accountId string, groups []string) (bool, error)
	SyncPeerMetaFunc                    func(ctx context.Context, peerPubKey string, meta nbpeer.PeerSystemMeta) error
	FindExistingPostureCheckFunc        func(accountID string, checks *posture.ChecksDefinition) (*posture.Checks, error)
	GetAccountIDForPeerKeyFunc          func(ctx context.Context, peerKey string) (string, error)
	GetAccountByIDFunc                  func(ctx context.Context, accountID string, userID string) (*types.Account, error)
	GetUserByIDFunc                     func(ctx context.Context, id string) (*types.User, error)
	GetAccountSettingsFunc              func(ctx context.Context, accountID string, userID string) (*types.Settings, error)
	DeleteSetupKeyFunc                  func(ctx context.Context, accountID, userID, keyID string) error
	BuildUserInfosForAccountFunc        func(ctx context.Context, accountID, initiatorUserID string, accountUsers []*types.User) (map[string]*types.UserInfo, error)
}

func (*MockAccountManager) AccountExists

func (am *MockAccountManager) AccountExists(ctx context.Context, accountID string) (bool, error)

AccountExists mock implementation of AccountExists from server.AccountManager interface

func (*MockAccountManager) AddPeer

func (am *MockAccountManager) AddPeer(
	ctx context.Context,
	setupKey string,
	userId string,
	peer *nbpeer.Peer,
) (*nbpeer.Peer, *types.NetworkMap, []*posture.Checks, error)

AddPeer mock implementation of AddPeer from server.AccountManager interface

func (*MockAccountManager) BuildUserInfosForAccount added in v0.37.0

func (am *MockAccountManager) BuildUserInfosForAccount(ctx context.Context, accountID, initiatorUserID string, accountUsers []*types.User) (map[string]*types.UserInfo, error)

BuildUserInfosForAccount mocks BuildUserInfosForAccount of the AccountManager interface

func (*MockAccountManager) CreateNameServerGroup added in v0.9.8

func (am *MockAccountManager) CreateNameServerGroup(ctx context.Context, accountID string, name, description string, nameServerList []nbdns.NameServer, groups []string, primary bool, domains []string, enabled bool, userID string, searchDomainsEnabled bool) (*nbdns.NameServerGroup, error)

CreateNameServerGroup mocks CreateNameServerGroup of the AccountManager interface

func (*MockAccountManager) CreatePAT added in v0.14.6

func (am *MockAccountManager) CreatePAT(ctx context.Context, accountID string, initiatorUserID string, targetUserID string, name string, expiresIn int) (*types.PersonalAccessTokenGenerated, error)

CreatePAT mock implementation of GetPAT from server.AccountManager interface

func (*MockAccountManager) CreateRoute added in v0.8.9

func (am *MockAccountManager) CreateRoute(ctx context.Context, accountID string, prefix netip.Prefix, networkType route.NetworkType, domains domain.List, peerID string, peerGroupIDs []string, description string, netID route.NetID, masquerade bool, metric int, groups, accessControlGroupID []string, enabled bool, userID string, keepRoute bool) (*route.Route, error)

CreateRoute mock implementation of CreateRoute from server.AccountManager interface

func (*MockAccountManager) CreateSetupKey added in v0.9.2

func (am *MockAccountManager) CreateSetupKey(
	ctx context.Context,
	accountID string,
	keyName string,
	keyType types.SetupKeyType,
	expiresIn time.Duration,
	autoGroups []string,
	usageLimit int,
	userID string,
	ephemeral bool,
	allowExtraDNSLabels bool,
) (*types.SetupKey, error)

CreateSetupKey mock implementation of CreateSetupKey from server.AccountManager interface

func (*MockAccountManager) CreateUser added in v0.9.8

func (am *MockAccountManager) CreateUser(ctx context.Context, accountID, userID string, invite *types.UserInfo) (*types.UserInfo, error)

CreateUser mocks CreateUser of the AccountManager interface

func (*MockAccountManager) DeleteAccount added in v0.24.4

func (am *MockAccountManager) DeleteAccount(ctx context.Context, accountID, userID string) error

DeleteAccount mock implementation of DeleteAccount from server.AccountManager interface

func (*MockAccountManager) DeleteGroup

func (am *MockAccountManager) DeleteGroup(ctx context.Context, accountId, userId, groupID string) error

DeleteGroup mock implementation of DeleteGroup from server.AccountManager interface

func (*MockAccountManager) DeleteGroups added in v0.28.8

func (am *MockAccountManager) DeleteGroups(ctx context.Context, accountId, userId string, groupIDs []string) error

DeleteGroups mock implementation of DeleteGroups from server.AccountManager interface

func (*MockAccountManager) DeleteNameServerGroup added in v0.9.8

func (am *MockAccountManager) DeleteNameServerGroup(ctx context.Context, accountID, nsGroupID, userID string) error

DeleteNameServerGroup mocks DeleteNameServerGroup of the AccountManager interface

func (*MockAccountManager) DeletePAT added in v0.14.5

func (am *MockAccountManager) DeletePAT(ctx context.Context, accountID string, initiatorUserID string, targetUserID string, tokenID string) error

DeletePAT mock implementation of DeletePAT from server.AccountManager interface

func (*MockAccountManager) DeletePeer

func (am *MockAccountManager) DeletePeer(ctx context.Context, accountID, peerID, userID string) error

DeletePeer mock implementation of DeletePeer from server.AccountManager interface

func (*MockAccountManager) DeletePolicy added in v0.14.5

func (am *MockAccountManager) DeletePolicy(ctx context.Context, accountID, policyID, userID string) error

DeletePolicy mock implementation of DeletePolicy from server.AccountManager interface

func (*MockAccountManager) DeletePostureChecks added in v0.26.0

func (am *MockAccountManager) DeletePostureChecks(ctx context.Context, accountID, postureChecksID, userID string) error

DeletePostureChecks mocks DeletePostureChecks of the AccountManager interface

func (*MockAccountManager) DeleteRegularUsers added in v0.28.8

func (am *MockAccountManager) DeleteRegularUsers(ctx context.Context, accountID, initiatorUserID string, targetUserIDs []string, userInfos map[string]*types.UserInfo) error

DeleteRegularUsers mocks DeleteRegularUsers of the AccountManager interface

func (*MockAccountManager) DeleteRoute added in v0.8.9

func (am *MockAccountManager) DeleteRoute(ctx context.Context, accountID string, routeID route.ID, userID string) error

DeleteRoute mock implementation of DeleteRoute from server.AccountManager interface

func (*MockAccountManager) DeleteRule

func (am *MockAccountManager) DeleteRule(ctx context.Context, accountID, ruleID, userID string) error

DeleteRule mock implementation of DeleteRule from server.AccountManager interface

func (*MockAccountManager) DeleteSetupKey added in v0.31.0

func (am *MockAccountManager) DeleteSetupKey(ctx context.Context, accountID, userID, keyID string) error

func (*MockAccountManager) DeleteUser added in v0.17.0

func (am *MockAccountManager) DeleteUser(ctx context.Context, accountID string, initiatorUserID string, targetUserID string) error

DeleteUser mocks DeleteUser of the AccountManager interface

func (*MockAccountManager) FindExistingPostureCheck added in v0.28.0

func (am *MockAccountManager) FindExistingPostureCheck(accountID string, checks *posture.ChecksDefinition) (*posture.Checks, error)

FindExistingPostureCheck mocks FindExistingPostureCheck of the AccountManager interface

func (*MockAccountManager) GetAccount added in v0.30.0

func (am *MockAccountManager) GetAccount(ctx context.Context, accountID string) (*types.Account, error)

func (*MockAccountManager) GetAccountByID added in v0.30.0

func (am *MockAccountManager) GetAccountByID(ctx context.Context, accountID string, userID string) (*types.Account, error)

GetAccountByID mocks GetAccountByID of the AccountManager interface

func (*MockAccountManager) GetAccountIDByUserID added in v0.30.0

func (am *MockAccountManager) GetAccountIDByUserID(ctx context.Context, userId, domain string) (string, error)

GetAccountIDByUserID mock implementation of GetAccountIDByUserID from server.AccountManager interface

func (*MockAccountManager) GetAccountIDForPeerKey added in v0.28.4

func (am *MockAccountManager) GetAccountIDForPeerKey(ctx context.Context, peerKey string) (string, error)

GetAccountIDForPeerKey mocks GetAccountIDForPeerKey of the AccountManager interface

func (*MockAccountManager) GetAccountIDFromUserAuth added in v0.37.0

func (am *MockAccountManager) GetAccountIDFromUserAuth(ctx context.Context, userAuth nbcontext.UserAuth) (string, string, error)

func (*MockAccountManager) GetAccountSettings added in v0.30.0

func (am *MockAccountManager) GetAccountSettings(ctx context.Context, accountID string, userID string) (*types.Settings, error)

func (*MockAccountManager) GetAllConnectedPeers added in v0.23.9

func (am *MockAccountManager) GetAllConnectedPeers() (map[string]struct{}, error)

GetAllConnectedPeers mocks GetAllConnectedPeers of the AccountManager interface

func (*MockAccountManager) GetAllGroups added in v0.26.4

func (am *MockAccountManager) GetAllGroups(ctx context.Context, accountID, userID string) ([]*types.Group, error)

GetAllGroups mock implementation of GetAllGroups from server.AccountManager interface

func (*MockAccountManager) GetAllPATs added in v0.14.6

func (am *MockAccountManager) GetAllPATs(ctx context.Context, accountID string, initiatorUserID string, targetUserID string) ([]*types.PersonalAccessToken, error)

GetAllPATs mock implementation of GetAllPATs from server.AccountManager interface

func (*MockAccountManager) GetDNSDomain added in v0.10.10

func (am *MockAccountManager) GetDNSDomain() string

GetDNSDomain mocks GetDNSDomain of the AccountManager interface

func (*MockAccountManager) GetDNSSettings added in v0.12.0

func (am *MockAccountManager) GetDNSSettings(ctx context.Context, accountID string, userID string) (*types.DNSSettings, error)

GetDNSSettings mocks GetDNSSettings of the AccountManager interface

func (*MockAccountManager) GetEvents added in v0.12.0

func (am *MockAccountManager) GetEvents(ctx context.Context, accountID, userID string) ([]*activity.Event, error)

GetEvents mocks GetEvents of the AccountManager interface

func (*MockAccountManager) GetExternalCacheManager added in v0.24.3

func (am *MockAccountManager) GetExternalCacheManager() server.ExternalCacheManager

GetExternalCacheManager mocks GetExternalCacheManager of the AccountManager interface

func (*MockAccountManager) GetGroup

func (am *MockAccountManager) GetGroup(ctx context.Context, accountId, groupID, userID string) (*types.Group, error)

GetGroup mock implementation of GetGroup from server.AccountManager interface

func (*MockAccountManager) GetGroupByName added in v0.25.5

func (am *MockAccountManager) GetGroupByName(ctx context.Context, accountID, groupName string) (*types.Group, error)

GetGroupByName mock implementation of GetGroupByName from server.AccountManager interface

func (*MockAccountManager) GetIdpManager added in v0.26.3

func (am *MockAccountManager) GetIdpManager() idp.Manager

GetIdpManager mocks GetIdpManager of the AccountManager interface

func (*MockAccountManager) GetNameServerGroup added in v0.9.8

func (am *MockAccountManager) GetNameServerGroup(ctx context.Context, accountID, userID, nsGroupID string) (*nbdns.NameServerGroup, error)

GetNameServerGroup mocks GetNameServerGroup of the AccountManager interface

func (*MockAccountManager) GetNetworkMap

func (am *MockAccountManager) GetNetworkMap(ctx context.Context, peerKey string) (*types.NetworkMap, error)

GetNetworkMap mock implementation of GetNetworkMap from server.AccountManager interface

func (*MockAccountManager) GetOrCreateAccountByUser

func (am *MockAccountManager) GetOrCreateAccountByUser(
	ctx context.Context, userId, domain string,
) (*types.Account, error)

GetOrCreateAccountByUser mock implementation of GetOrCreateAccountByUser from server.AccountManager interface

func (*MockAccountManager) GetPAT added in v0.14.6

func (am *MockAccountManager) GetPAT(ctx context.Context, accountID string, initiatorUserID string, targetUserID string, tokenID string) (*types.PersonalAccessToken, error)

GetPAT mock implementation of GetPAT from server.AccountManager interface

func (*MockAccountManager) GetPeer

func (am *MockAccountManager) GetPeer(ctx context.Context, accountID, peerID, userID string) (*nbpeer.Peer, error)

GetPeer mocks GetPeer of the AccountManager interface

func (*MockAccountManager) GetPeerGroups added in v0.36.4

func (am *MockAccountManager) GetPeerGroups(ctx context.Context, accountID, peerID string) ([]*types.Group, error)

GetPeerGroups mocks GetPeerGroups of the AccountManager interface

func (*MockAccountManager) GetPeerNetwork added in v0.8.0

func (am *MockAccountManager) GetPeerNetwork(ctx context.Context, peerKey string) (*types.Network, error)

GetPeerNetwork mock implementation of GetPeerNetwork from server.AccountManager interface

func (*MockAccountManager) GetPeers added in v0.10.5

func (am *MockAccountManager) GetPeers(ctx context.Context, accountID, userID string) ([]*nbpeer.Peer, error)

GetPeers mocks GetPeers of the AccountManager interface

func (*MockAccountManager) GetPolicy added in v0.14.5

func (am *MockAccountManager) GetPolicy(ctx context.Context, accountID, policyID, userID string) (*types.Policy, error)

GetPolicy mock implementation of GetPolicy from server.AccountManager interface

func (*MockAccountManager) GetPostureChecks added in v0.26.0

func (am *MockAccountManager) GetPostureChecks(ctx context.Context, accountID, postureChecksID, userID string) (*posture.Checks, error)

GetPostureChecks mocks GetPostureChecks of the AccountManager interface

func (*MockAccountManager) GetRoute added in v0.8.9

func (am *MockAccountManager) GetRoute(ctx context.Context, accountID string, routeID route.ID, userID string) (*route.Route, error)

GetRoute mock implementation of GetRoute from server.AccountManager interface

func (*MockAccountManager) GetSetupKey added in v0.9.2

func (am *MockAccountManager) GetSetupKey(ctx context.Context, accountID, userID, keyID string) (*types.SetupKey, error)

GetSetupKey mocks GetSetupKey of the AccountManager interface

func (*MockAccountManager) GetUserByID added in v0.30.0

func (am *MockAccountManager) GetUserByID(ctx context.Context, id string) (*types.User, error)

GetUserByID mocks GetUserByID of the AccountManager interface

func (*MockAccountManager) GetUserFromUserAuth added in v0.37.0

func (am *MockAccountManager) GetUserFromUserAuth(ctx context.Context, userAuth nbcontext.UserAuth) (*types.User, error)

GetUser mock implementation of GetUser from server.AccountManager interface

func (*MockAccountManager) GetUsersFromAccount

func (am *MockAccountManager) GetUsersFromAccount(ctx context.Context, accountID string, userID string) (map[string]*types.UserInfo, error)

GetUsersFromAccount mock implementation of GetUsersFromAccount from server.AccountManager interface

func (*MockAccountManager) GetValidatedPeers added in v0.26.5

func (am *MockAccountManager) GetValidatedPeers(ctx context.Context, accountID string) (map[string]struct{}, error)

func (*MockAccountManager) GroupAddPeer

func (am *MockAccountManager) GroupAddPeer(ctx context.Context, accountID, groupID, peerID string) error

GroupAddPeer mock implementation of GroupAddPeer from server.AccountManager interface

func (*MockAccountManager) GroupDeletePeer

func (am *MockAccountManager) GroupDeletePeer(ctx context.Context, accountID, groupID, peerID string) error

GroupDeletePeer mock implementation of GroupDeletePeer from server.AccountManager interface

func (*MockAccountManager) GroupValidation added in v0.26.5

func (am *MockAccountManager) GroupValidation(ctx context.Context, accountId string, groups []string) (bool, error)

GroupValidation mocks GroupValidation of the AccountManager interface

func (*MockAccountManager) HasConnectedChannel added in v0.24.4

func (am *MockAccountManager) HasConnectedChannel(peerID string) bool

HasConnectedChannel mocks HasConnectedChannel of the AccountManager interface

func (*MockAccountManager) InviteUser added in v0.21.9

func (am *MockAccountManager) InviteUser(ctx context.Context, accountID string, initiatorUserID string, targetUserID string) error

func (*MockAccountManager) ListNameServerGroups added in v0.9.8

func (am *MockAccountManager) ListNameServerGroups(ctx context.Context, accountID string, userID string) ([]*nbdns.NameServerGroup, error)

ListNameServerGroups mocks ListNameServerGroups of the AccountManager interface

func (*MockAccountManager) ListPolicies added in v0.14.5

func (am *MockAccountManager) ListPolicies(ctx context.Context, accountID, userID string) ([]*types.Policy, error)

ListPolicies mock implementation of ListPolicies from server.AccountManager interface

func (*MockAccountManager) ListPostureChecks added in v0.26.0

func (am *MockAccountManager) ListPostureChecks(ctx context.Context, accountID, userID string) ([]*posture.Checks, error)

ListPostureChecks mocks ListPostureChecks of the AccountManager interface

func (*MockAccountManager) ListRoutes added in v0.8.9

func (am *MockAccountManager) ListRoutes(ctx context.Context, accountID, userID string) ([]*route.Route, error)

ListRoutes mock implementation of ListRoutes from server.AccountManager interface

func (*MockAccountManager) ListSetupKeys added in v0.9.2

func (am *MockAccountManager) ListSetupKeys(ctx context.Context, accountID, userID string) ([]*types.SetupKey, error)

ListSetupKeys mocks ListSetupKeys of the AccountManager interface

func (*MockAccountManager) ListUsers added in v0.24.3

func (am *MockAccountManager) ListUsers(ctx context.Context, accountID string) ([]*types.User, error)

func (*MockAccountManager) LoginPeer added in v0.14.3

LoginPeer mocks LoginPeer of the AccountManager interface

func (*MockAccountManager) MarkPeerConnected

func (am *MockAccountManager) MarkPeerConnected(ctx context.Context, peerKey string, connected bool, realIP net.IP, accountID string) error

MarkPeerConnected mock implementation of MarkPeerConnected from server.AccountManager interface

func (*MockAccountManager) OnPeerDisconnected added in v0.28.7

func (am *MockAccountManager) OnPeerDisconnected(_ context.Context, accountID string, peerPubKey string) error

func (*MockAccountManager) SaveDNSSettings added in v0.12.0

func (am *MockAccountManager) SaveDNSSettings(ctx context.Context, accountID string, userID string, dnsSettingsToSave *types.DNSSettings) error

SaveDNSSettings mocks SaveDNSSettings of the AccountManager interface

func (*MockAccountManager) SaveGroup

func (am *MockAccountManager) SaveGroup(ctx context.Context, accountID, userID string, group *types.Group) error

SaveGroup mock implementation of SaveGroup from server.AccountManager interface

func (*MockAccountManager) SaveGroups added in v0.28.5

func (am *MockAccountManager) SaveGroups(ctx context.Context, accountID, userID string, groups []*types.Group) error

SaveGroups mock implementation of SaveGroups from server.AccountManager interface

func (*MockAccountManager) SaveNameServerGroup added in v0.9.8

func (am *MockAccountManager) SaveNameServerGroup(ctx context.Context, accountID, userID string, nsGroupToSave *nbdns.NameServerGroup) error

SaveNameServerGroup mocks SaveNameServerGroup of the AccountManager interface

func (*MockAccountManager) SaveOrAddUser added in v0.24.3

func (am *MockAccountManager) SaveOrAddUser(ctx context.Context, accountID, userID string, user *types.User, addIfNotExists bool) (*types.UserInfo, error)

SaveOrAddUser mocks SaveOrAddUser of the AccountManager interface

func (*MockAccountManager) SaveOrAddUsers added in v0.28.5

func (am *MockAccountManager) SaveOrAddUsers(ctx context.Context, accountID, userID string, users []*types.User, addIfNotExists bool) ([]*types.UserInfo, error)

SaveOrAddUsers mocks SaveOrAddUsers of the AccountManager interface

func (*MockAccountManager) SavePolicy added in v0.14.5

func (am *MockAccountManager) SavePolicy(ctx context.Context, accountID, userID string, policy *types.Policy) (*types.Policy, error)

SavePolicy mock implementation of SavePolicy from server.AccountManager interface

func (*MockAccountManager) SavePostureChecks added in v0.26.0

func (am *MockAccountManager) SavePostureChecks(ctx context.Context, accountID, userID string, postureChecks *posture.Checks) (*posture.Checks, error)

SavePostureChecks mocks SavePostureChecks of the AccountManager interface

func (*MockAccountManager) SaveRoute added in v0.8.9

func (am *MockAccountManager) SaveRoute(ctx context.Context, accountID string, userID string, route *route.Route) error

SaveRoute mock implementation of SaveRoute from server.AccountManager interface

func (*MockAccountManager) SaveSetupKey added in v0.9.2

func (am *MockAccountManager) SaveSetupKey(ctx context.Context, accountID string, key *types.SetupKey, userID string) (*types.SetupKey, error)

SaveSetupKey mocks SaveSetupKey of the AccountManager interface

func (*MockAccountManager) SaveUser added in v0.9.4

func (am *MockAccountManager) SaveUser(ctx context.Context, accountID, userID string, user *types.User) (*types.UserInfo, error)

SaveUser mocks SaveUser of the AccountManager interface

func (*MockAccountManager) StoreEvent added in v0.24.3

func (am *MockAccountManager) StoreEvent(ctx context.Context, initiatorID, targetID, accountID string, activityID activity.ActivityDescriber, meta map[string]any)

StoreEvent mocks StoreEvent of the AccountManager interface

func (*MockAccountManager) SyncAndMarkPeer added in v0.27.5

func (am *MockAccountManager) SyncAndMarkPeer(ctx context.Context, accountID string, peerPubKey string, meta nbpeer.PeerSystemMeta, realIP net.IP) (*nbpeer.Peer, *types.NetworkMap, []*posture.Checks, error)

func (*MockAccountManager) SyncPeer added in v0.14.3

func (am *MockAccountManager) SyncPeer(ctx context.Context, sync server.PeerSync, accountID string) (*nbpeer.Peer, *types.NetworkMap, []*posture.Checks, error)

SyncPeer mocks SyncPeer of the AccountManager interface

func (*MockAccountManager) SyncPeerMeta added in v0.28.0

func (am *MockAccountManager) SyncPeerMeta(ctx context.Context, peerPubKey string, meta nbpeer.PeerSystemMeta) error

SyncPeerMeta mocks SyncPeerMeta of the AccountManager interface

func (*MockAccountManager) SyncUserJWTGroups added in v0.37.0

func (am *MockAccountManager) SyncUserJWTGroups(ctx context.Context, userAuth nbcontext.UserAuth) error

func (*MockAccountManager) UpdateAccountPeers added in v0.35.0

func (am *MockAccountManager) UpdateAccountPeers(ctx context.Context, accountID string)

func (*MockAccountManager) UpdateAccountSettings added in v0.14.0

func (am *MockAccountManager) UpdateAccountSettings(ctx context.Context, accountID, userID string, newSettings *types.Settings) (*types.Account, error)

UpdateAccountSettings mocks UpdateAccountSettings of the AccountManager interface

func (*MockAccountManager) UpdateIntegratedValidatorGroups added in v0.26.5

func (am *MockAccountManager) UpdateIntegratedValidatorGroups(ctx context.Context, accountID string, userID string, groups []string) error

UpdateIntegratedValidatorGroups mocks UpdateIntegratedApprovalGroups of the AccountManager interface

func (*MockAccountManager) UpdatePeer added in v0.8.0

func (am *MockAccountManager) UpdatePeer(ctx context.Context, accountID, userID string, peer *nbpeer.Peer) (*nbpeer.Peer, error)

UpdatePeer mocks UpdatePeerFunc function of the account manager

func (*MockAccountManager) UpdatePeerMeta

func (am *MockAccountManager) UpdatePeerMeta(ctx context.Context, peerID string, meta nbpeer.PeerSystemMeta) error

UpdatePeerMeta mock implementation of UpdatePeerMeta from server.AccountManager interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳