2021-08-24 21:49:56 +00:00
|
|
|
// Automatically generated by mockimpl. DO NOT EDIT!
|
|
|
|
|
|
|
|
package mock
|
|
|
|
|
|
|
|
import (
|
2021-09-14 12:11:07 +00:00
|
|
|
"context"
|
2021-08-24 21:49:56 +00:00
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/fleetdm/fleet/v4/server/fleet"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ fleet.Datastore = (*DataStore)(nil)
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewCarveFunc func(ctx context.Context, metadata *fleet.CarveMetadata) (*fleet.CarveMetadata, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type UpdateCarveFunc func(ctx context.Context, metadata *fleet.CarveMetadata) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type CarveFunc func(ctx context.Context, carveId int64) (*fleet.CarveMetadata, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type CarveBySessionIdFunc func(ctx context.Context, sessionId string) (*fleet.CarveMetadata, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type CarveByNameFunc func(ctx context.Context, name string) (*fleet.CarveMetadata, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListCarvesFunc func(ctx context.Context, opt fleet.CarveListOptions) ([]*fleet.CarveMetadata, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewBlockFunc func(ctx context.Context, metadata *fleet.CarveMetadata, blockId int64, data []byte) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type GetBlockFunc func(ctx context.Context, metadata *fleet.CarveMetadata, blockId int64) ([]byte, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type CleanupCarvesFunc func(ctx context.Context, now time.Time) (expired int, err error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewUserFunc func(ctx context.Context, user *fleet.User) (*fleet.User, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListUsersFunc func(ctx context.Context, opt fleet.UserListOptions) ([]*fleet.User, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type UserByEmailFunc func(ctx context.Context, email string) (*fleet.User, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type UserByIDFunc func(ctx context.Context, id uint) (*fleet.User, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SaveUserFunc func(ctx context.Context, user *fleet.User) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SaveUsersFunc func(ctx context.Context, users []*fleet.User) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeleteUserFunc func(ctx context.Context, id uint) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type PendingEmailChangeFunc func(ctx context.Context, userID uint, newEmail string, token string) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ConfirmPendingEmailChangeFunc func(ctx context.Context, userID uint, token string) (string, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ApplyQueriesFunc func(ctx context.Context, authorID uint, queries []*fleet.Query) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewQueryFunc func(ctx context.Context, query *fleet.Query, opts ...fleet.OptionalArg) (*fleet.Query, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SaveQueryFunc func(ctx context.Context, query *fleet.Query) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeleteQueryFunc func(ctx context.Context, name string) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeleteQueriesFunc func(ctx context.Context, ids []uint) (uint, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type QueryFunc func(ctx context.Context, id uint) (*fleet.Query, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-20 16:07:51 +00:00
|
|
|
type ListQueriesFunc func(ctx context.Context, opt fleet.ListQueryOptions) ([]*fleet.Query, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type QueryByNameFunc func(ctx context.Context, name string, opts ...fleet.OptionalArg) (*fleet.Query, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewDistributedQueryCampaignFunc func(ctx context.Context, camp *fleet.DistributedQueryCampaign) (*fleet.DistributedQueryCampaign, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DistributedQueryCampaignFunc func(ctx context.Context, id uint) (*fleet.DistributedQueryCampaign, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SaveDistributedQueryCampaignFunc func(ctx context.Context, camp *fleet.DistributedQueryCampaign) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DistributedQueryCampaignTargetIDsFunc func(ctx context.Context, id uint) (targets *fleet.HostTargets, err error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewDistributedQueryCampaignTargetFunc func(ctx context.Context, target *fleet.DistributedQueryCampaignTarget) (*fleet.DistributedQueryCampaignTarget, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type CleanupDistributedQueryCampaignsFunc func(ctx context.Context, now time.Time) (expired uint, err error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-10-26 14:33:31 +00:00
|
|
|
type DistributedQueryCampaignsForQueryFunc func(ctx context.Context, queryID uint) ([]*fleet.DistributedQueryCampaign, error)
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ApplyPackSpecsFunc func(ctx context.Context, specs []*fleet.PackSpec) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type GetPackSpecsFunc func(ctx context.Context) ([]*fleet.PackSpec, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type GetPackSpecFunc func(ctx context.Context, name string) (*fleet.PackSpec, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewPackFunc func(ctx context.Context, pack *fleet.Pack, opts ...fleet.OptionalArg) (*fleet.Pack, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SavePackFunc func(ctx context.Context, pack *fleet.Pack) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeletePackFunc func(ctx context.Context, name string) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type PackFunc func(ctx context.Context, pid uint) (*fleet.Pack, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListPacksFunc func(ctx context.Context, opt fleet.PackListOptions) ([]*fleet.Pack, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type PackByNameFunc func(ctx context.Context, name string, opts ...fleet.OptionalArg) (*fleet.Pack, bool, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListPacksForHostFunc func(ctx context.Context, hid uint) (packs []*fleet.Pack, err error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type EnsureGlobalPackFunc func(ctx context.Context) (*fleet.Pack, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type EnsureTeamPackFunc func(ctx context.Context, teamID uint) (*fleet.Pack, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ApplyLabelSpecsFunc func(ctx context.Context, specs []*fleet.LabelSpec) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type GetLabelSpecsFunc func(ctx context.Context) ([]*fleet.LabelSpec, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type GetLabelSpecFunc func(ctx context.Context, name string) (*fleet.LabelSpec, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewLabelFunc func(ctx context.Context, Label *fleet.Label, opts ...fleet.OptionalArg) (*fleet.Label, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SaveLabelFunc func(ctx context.Context, label *fleet.Label) (*fleet.Label, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeleteLabelFunc func(ctx context.Context, name string) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type LabelFunc func(ctx context.Context, lid uint) (*fleet.Label, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListLabelsFunc func(ctx context.Context, filter fleet.TeamFilter, opt fleet.ListOptions) ([]*fleet.Label, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-21 17:21:44 +00:00
|
|
|
type LabelQueriesForHostFunc func(ctx context.Context, host *fleet.Host) (map[string]string, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-11-09 14:35:36 +00:00
|
|
|
type RecordLabelQueryExecutionsFunc func(ctx context.Context, host *fleet.Host, results map[uint]*bool, t time.Time, deferredSaveHost bool) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListLabelsForHostFunc func(ctx context.Context, hid uint) ([]*fleet.Label, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListHostsInLabelFunc func(ctx context.Context, filter fleet.TeamFilter, lid uint, opt fleet.HostListOptions) ([]*fleet.Host, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListUniqueHostsInLabelsFunc func(ctx context.Context, filter fleet.TeamFilter, labels []uint) ([]*fleet.Host, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SearchLabelsFunc func(ctx context.Context, filter fleet.TeamFilter, query string, omit ...uint) ([]*fleet.Label, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type LabelIDsByNameFunc func(ctx context.Context, labels []string) ([]uint, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-11-01 18:13:16 +00:00
|
|
|
type AsyncBatchInsertLabelMembershipFunc func(ctx context.Context, batch [][2]uint) error
|
|
|
|
|
|
|
|
type AsyncBatchDeleteLabelMembershipFunc func(ctx context.Context, batch [][2]uint) error
|
|
|
|
|
|
|
|
type AsyncBatchUpdateLabelTimestampFunc func(ctx context.Context, ids []uint, ts time.Time) error
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewHostFunc func(ctx context.Context, host *fleet.Host) (*fleet.Host, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SaveHostFunc func(ctx context.Context, host *fleet.Host) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-11-08 14:42:37 +00:00
|
|
|
type SerialSaveHostFunc func(ctx context.Context, host *fleet.Host) error
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeleteHostFunc func(ctx context.Context, hid uint) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
type HostFunc func(ctx context.Context, id uint, skipLoadingExtras bool) (*fleet.Host, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type EnrollHostFunc func(ctx context.Context, osqueryHostId string, nodeKey string, teamID *uint, cooldown time.Duration) (*fleet.Host, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListHostsFunc func(ctx context.Context, filter fleet.TeamFilter, opt fleet.HostListOptions) ([]*fleet.Host, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type AuthenticateHostFunc func(ctx context.Context, nodeKey string) (*fleet.Host, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type MarkHostsSeenFunc func(ctx context.Context, hostIDs []uint, t time.Time) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SearchHostsFunc func(ctx context.Context, filter fleet.TeamFilter, query string, omit ...uint) ([]*fleet.Host, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type CleanupIncomingHostsFunc func(ctx context.Context, now time.Time) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-11-09 14:35:36 +00:00
|
|
|
type GenerateHostStatusStatisticsFunc func(ctx context.Context, filter fleet.TeamFilter, now time.Time) (*fleet.HostSummary, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type HostIDsByNameFunc func(ctx context.Context, filter fleet.TeamFilter, hostnames []string) ([]uint, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type HostByIdentifierFunc func(ctx context.Context, identifier string) (*fleet.Host, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type AddHostsToTeamFunc func(ctx context.Context, teamID *uint, hostIDs []uint) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-12-03 13:54:17 +00:00
|
|
|
type TotalAndUnseenHostsSinceFunc func(ctx context.Context, daysCount int) (total int, unseen int, err error)
|
2021-08-27 14:15:36 +00:00
|
|
|
|
2021-09-29 16:13:23 +00:00
|
|
|
type DeleteHostsFunc func(ctx context.Context, ids []uint) error
|
|
|
|
|
2021-10-07 11:25:35 +00:00
|
|
|
type CountHostsFunc func(ctx context.Context, filter fleet.TeamFilter, opt fleet.HostListOptions) (int, error)
|
|
|
|
|
|
|
|
type CountHostsInLabelFunc func(ctx context.Context, filter fleet.TeamFilter, lid uint, opt fleet.HostListOptions) (int, error)
|
|
|
|
|
2021-12-21 20:36:19 +00:00
|
|
|
type ListHostDeviceMappingFunc func(ctx context.Context, id uint) ([]*fleet.HostDeviceMapping, error)
|
|
|
|
|
|
|
|
type ReplaceHostDeviceMappingFunc func(ctx context.Context, id uint, mappings []*fleet.HostDeviceMapping) error
|
|
|
|
|
2021-12-03 18:33:33 +00:00
|
|
|
type ListPoliciesForHostFunc func(ctx context.Context, host *fleet.Host) ([]*fleet.HostPolicy, error)
|
2021-10-07 11:11:10 +00:00
|
|
|
|
2021-12-21 12:37:58 +00:00
|
|
|
type SetOrUpdateMunkiVersionFunc func(ctx context.Context, hostID uint, version string) error
|
|
|
|
|
|
|
|
type SetOrUpdateMDMDataFunc func(ctx context.Context, hostID uint, enrolled bool, serverURL string, installedFromDep bool) error
|
|
|
|
|
|
|
|
type GetMunkiVersionFunc func(ctx context.Context, hostID uint) (string, error)
|
|
|
|
|
|
|
|
type GetMDMFunc func(ctx context.Context, hostID uint) (enrolled bool, serverURL string, installedFromDep bool, err error)
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type CountHostsInTargetsFunc func(ctx context.Context, filter fleet.TeamFilter, targets fleet.HostTargets, now time.Time) (fleet.TargetMetrics, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type HostIDsInTargetsFunc func(ctx context.Context, filter fleet.TeamFilter, targets fleet.HostTargets) ([]uint, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewPasswordResetRequestFunc func(ctx context.Context, req *fleet.PasswordResetRequest) (*fleet.PasswordResetRequest, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeletePasswordResetRequestsForUserFunc func(ctx context.Context, userID uint) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type FindPassswordResetByTokenFunc func(ctx context.Context, token string) (*fleet.PasswordResetRequest, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SessionByKeyFunc func(ctx context.Context, key string) (*fleet.Session, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SessionByIDFunc func(ctx context.Context, id uint) (*fleet.Session, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListSessionsForUserFunc func(ctx context.Context, id uint) ([]*fleet.Session, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewSessionFunc func(ctx context.Context, session *fleet.Session) (*fleet.Session, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DestroySessionFunc func(ctx context.Context, session *fleet.Session) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DestroyAllSessionsForUserFunc func(ctx context.Context, id uint) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type MarkSessionAccessedFunc func(ctx context.Context, session *fleet.Session) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewAppConfigFunc func(ctx context.Context, info *fleet.AppConfig) (*fleet.AppConfig, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type AppConfigFunc func(ctx context.Context) (*fleet.AppConfig, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SaveAppConfigFunc func(ctx context.Context, info *fleet.AppConfig) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type VerifyEnrollSecretFunc func(ctx context.Context, secret string) (*fleet.EnrollSecret, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type GetEnrollSecretsFunc func(ctx context.Context, teamID *uint) ([]*fleet.EnrollSecret, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ApplyEnrollSecretsFunc func(ctx context.Context, teamID *uint, secrets []*fleet.EnrollSecret) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewInviteFunc func(ctx context.Context, i *fleet.Invite) (*fleet.Invite, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListInvitesFunc func(ctx context.Context, opt fleet.ListOptions) ([]*fleet.Invite, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type InviteFunc func(ctx context.Context, id uint) (*fleet.Invite, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type InviteByEmailFunc func(ctx context.Context, email string) (*fleet.Invite, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type InviteByTokenFunc func(ctx context.Context, token string) (*fleet.Invite, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeleteInviteFunc func(ctx context.Context, id uint) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-11-11 20:33:06 +00:00
|
|
|
type UpdateInviteFunc func(ctx context.Context, id uint, i *fleet.Invite) (*fleet.Invite, error)
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListScheduledQueriesInPackFunc func(ctx context.Context, id uint, opts fleet.ListOptions) ([]*fleet.ScheduledQuery, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewScheduledQueryFunc func(ctx context.Context, sq *fleet.ScheduledQuery, opts ...fleet.OptionalArg) (*fleet.ScheduledQuery, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SaveScheduledQueryFunc func(ctx context.Context, sq *fleet.ScheduledQuery) (*fleet.ScheduledQuery, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeleteScheduledQueryFunc func(ctx context.Context, id uint) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ScheduledQueryFunc func(ctx context.Context, id uint) (*fleet.ScheduledQuery, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-10-19 20:47:37 +00:00
|
|
|
type CleanupExpiredHostsFunc func(ctx context.Context) error
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewTeamFunc func(ctx context.Context, team *fleet.Team) (*fleet.Team, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SaveTeamFunc func(ctx context.Context, team *fleet.Team) (*fleet.Team, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type TeamFunc func(ctx context.Context, tid uint) (*fleet.Team, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeleteTeamFunc func(ctx context.Context, tid uint) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type TeamByNameFunc func(ctx context.Context, name string) (*fleet.Team, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListTeamsFunc func(ctx context.Context, filter fleet.TeamFilter, opt fleet.ListOptions) ([]*fleet.Team, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SearchTeamsFunc func(ctx context.Context, filter fleet.TeamFilter, matchQuery string, omit ...uint) ([]*fleet.Team, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type TeamEnrollSecretsFunc func(ctx context.Context, teamID uint) ([]*fleet.EnrollSecret, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type SaveHostSoftwareFunc func(ctx context.Context, host *fleet.Host) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type LoadHostSoftwareFunc func(ctx context.Context, host *fleet.Host) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type AllSoftwareWithoutCPEIteratorFunc func(ctx context.Context) (fleet.SoftwareIterator, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type AddCPEForSoftwareFunc func(ctx context.Context, software fleet.Software, cpe string) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type AllCPEsFunc func(ctx context.Context) ([]string, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type InsertCVEForCPEFunc func(ctx context.Context, cve string, cpes []string) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-10-12 18:59:01 +00:00
|
|
|
type SoftwareByIDFunc func(ctx context.Context, id uint) (*fleet.Software, error)
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type NewActivityFunc func(ctx context.Context, user *fleet.User, activityType string, details *map[string]interface{}) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListActivitiesFunc func(ctx context.Context, opt fleet.ListOptions) ([]*fleet.Activity, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-12-06 20:39:00 +00:00
|
|
|
type ShouldSendStatisticsFunc func(ctx context.Context, frequency time.Duration, license *fleet.LicenseInfo) (fleet.StatisticsPayload, bool, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type RecordStatisticsSentFunc func(ctx context.Context) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
type NewGlobalPolicyFunc func(ctx context.Context, authorID *uint, args fleet.PolicyPayload) (*fleet.Policy, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type PolicyFunc func(ctx context.Context, id uint) (*fleet.Policy, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
type SavePolicyFunc func(ctx context.Context, p *fleet.Policy) error
|
|
|
|
|
2021-12-23 21:26:55 +00:00
|
|
|
type FlippingPoliciesForHostFunc func(ctx context.Context, hostID uint, incomingResults map[uint]*bool) (newFailing []uint, newPassing []uint, err error)
|
|
|
|
|
2021-11-09 14:35:36 +00:00
|
|
|
type RecordPolicyQueryExecutionsFunc func(ctx context.Context, host *fleet.Host, results map[uint]*bool, updated time.Time, deferredSaveHost bool) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type ListGlobalPoliciesFunc func(ctx context.Context) ([]*fleet.Policy, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type DeleteGlobalPoliciesFunc func(ctx context.Context, ids []uint) ([]uint, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type PolicyQueriesForHostFunc func(ctx context.Context, host *fleet.Host) (map[string]string, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
type ApplyPolicySpecsFunc func(ctx context.Context, authorID uint, specs []*fleet.PolicySpec) error
|
2021-10-15 10:34:11 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type MigrateTablesFunc func(ctx context.Context) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
type MigrateDataFunc func(ctx context.Context) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-11-22 17:06:12 +00:00
|
|
|
type MigrationStatusFunc func(ctx context.Context) (*fleet.MigrationStatus, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-10-20 21:01:20 +00:00
|
|
|
type ListSoftwareFunc func(ctx context.Context, opt fleet.SoftwareListOptions) ([]fleet.Software, error)
|
2021-09-14 13:58:48 +00:00
|
|
|
|
2021-12-03 13:54:17 +00:00
|
|
|
type CountSoftwareFunc func(ctx context.Context, opt fleet.SoftwareListOptions) (int, error)
|
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
type NewTeamPolicyFunc func(ctx context.Context, teamID uint, authorID *uint, args fleet.PolicyPayload) (*fleet.Policy, error)
|
2021-09-20 14:00:57 +00:00
|
|
|
|
|
|
|
type ListTeamPoliciesFunc func(ctx context.Context, teamID uint) ([]*fleet.Policy, error)
|
|
|
|
|
|
|
|
type DeleteTeamPoliciesFunc func(ctx context.Context, teamID uint, ids []uint) ([]uint, error)
|
|
|
|
|
|
|
|
type TeamPolicyFunc func(ctx context.Context, teamID uint, policyID uint) (*fleet.Policy, error)
|
|
|
|
|
2021-09-28 13:01:53 +00:00
|
|
|
type LockFunc func(ctx context.Context, name string, owner string, expiration time.Duration) (bool, error)
|
|
|
|
|
|
|
|
type UnlockFunc func(ctx context.Context, name string, owner string) error
|
|
|
|
|
2021-12-06 14:26:01 +00:00
|
|
|
type DBLocksFunc func(ctx context.Context) ([]*fleet.DBLock, error)
|
|
|
|
|
2021-10-20 21:35:38 +00:00
|
|
|
type UpdateScheduledQueryAggregatedStatsFunc func(ctx context.Context) error
|
|
|
|
|
|
|
|
type UpdateQueryAggregatedStatsFunc func(ctx context.Context) error
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
type DataStore struct {
|
|
|
|
NewCarveFunc NewCarveFunc
|
|
|
|
NewCarveFuncInvoked bool
|
|
|
|
|
|
|
|
UpdateCarveFunc UpdateCarveFunc
|
|
|
|
UpdateCarveFuncInvoked bool
|
|
|
|
|
|
|
|
CarveFunc CarveFunc
|
|
|
|
CarveFuncInvoked bool
|
|
|
|
|
|
|
|
CarveBySessionIdFunc CarveBySessionIdFunc
|
|
|
|
CarveBySessionIdFuncInvoked bool
|
|
|
|
|
|
|
|
CarveByNameFunc CarveByNameFunc
|
|
|
|
CarveByNameFuncInvoked bool
|
|
|
|
|
|
|
|
ListCarvesFunc ListCarvesFunc
|
|
|
|
ListCarvesFuncInvoked bool
|
|
|
|
|
|
|
|
NewBlockFunc NewBlockFunc
|
|
|
|
NewBlockFuncInvoked bool
|
|
|
|
|
|
|
|
GetBlockFunc GetBlockFunc
|
|
|
|
GetBlockFuncInvoked bool
|
|
|
|
|
|
|
|
CleanupCarvesFunc CleanupCarvesFunc
|
|
|
|
CleanupCarvesFuncInvoked bool
|
|
|
|
|
|
|
|
NewUserFunc NewUserFunc
|
|
|
|
NewUserFuncInvoked bool
|
|
|
|
|
|
|
|
ListUsersFunc ListUsersFunc
|
|
|
|
ListUsersFuncInvoked bool
|
|
|
|
|
|
|
|
UserByEmailFunc UserByEmailFunc
|
|
|
|
UserByEmailFuncInvoked bool
|
|
|
|
|
|
|
|
UserByIDFunc UserByIDFunc
|
|
|
|
UserByIDFuncInvoked bool
|
|
|
|
|
|
|
|
SaveUserFunc SaveUserFunc
|
|
|
|
SaveUserFuncInvoked bool
|
|
|
|
|
|
|
|
SaveUsersFunc SaveUsersFunc
|
|
|
|
SaveUsersFuncInvoked bool
|
|
|
|
|
|
|
|
DeleteUserFunc DeleteUserFunc
|
|
|
|
DeleteUserFuncInvoked bool
|
|
|
|
|
|
|
|
PendingEmailChangeFunc PendingEmailChangeFunc
|
|
|
|
PendingEmailChangeFuncInvoked bool
|
|
|
|
|
|
|
|
ConfirmPendingEmailChangeFunc ConfirmPendingEmailChangeFunc
|
|
|
|
ConfirmPendingEmailChangeFuncInvoked bool
|
|
|
|
|
|
|
|
ApplyQueriesFunc ApplyQueriesFunc
|
|
|
|
ApplyQueriesFuncInvoked bool
|
|
|
|
|
|
|
|
NewQueryFunc NewQueryFunc
|
|
|
|
NewQueryFuncInvoked bool
|
|
|
|
|
|
|
|
SaveQueryFunc SaveQueryFunc
|
|
|
|
SaveQueryFuncInvoked bool
|
|
|
|
|
|
|
|
DeleteQueryFunc DeleteQueryFunc
|
|
|
|
DeleteQueryFuncInvoked bool
|
|
|
|
|
|
|
|
DeleteQueriesFunc DeleteQueriesFunc
|
|
|
|
DeleteQueriesFuncInvoked bool
|
|
|
|
|
|
|
|
QueryFunc QueryFunc
|
|
|
|
QueryFuncInvoked bool
|
|
|
|
|
|
|
|
ListQueriesFunc ListQueriesFunc
|
|
|
|
ListQueriesFuncInvoked bool
|
|
|
|
|
|
|
|
QueryByNameFunc QueryByNameFunc
|
|
|
|
QueryByNameFuncInvoked bool
|
|
|
|
|
|
|
|
NewDistributedQueryCampaignFunc NewDistributedQueryCampaignFunc
|
|
|
|
NewDistributedQueryCampaignFuncInvoked bool
|
|
|
|
|
|
|
|
DistributedQueryCampaignFunc DistributedQueryCampaignFunc
|
|
|
|
DistributedQueryCampaignFuncInvoked bool
|
|
|
|
|
|
|
|
SaveDistributedQueryCampaignFunc SaveDistributedQueryCampaignFunc
|
|
|
|
SaveDistributedQueryCampaignFuncInvoked bool
|
|
|
|
|
|
|
|
DistributedQueryCampaignTargetIDsFunc DistributedQueryCampaignTargetIDsFunc
|
|
|
|
DistributedQueryCampaignTargetIDsFuncInvoked bool
|
|
|
|
|
|
|
|
NewDistributedQueryCampaignTargetFunc NewDistributedQueryCampaignTargetFunc
|
|
|
|
NewDistributedQueryCampaignTargetFuncInvoked bool
|
|
|
|
|
|
|
|
CleanupDistributedQueryCampaignsFunc CleanupDistributedQueryCampaignsFunc
|
|
|
|
CleanupDistributedQueryCampaignsFuncInvoked bool
|
|
|
|
|
2021-10-26 14:33:31 +00:00
|
|
|
DistributedQueryCampaignsForQueryFunc DistributedQueryCampaignsForQueryFunc
|
|
|
|
DistributedQueryCampaignsForQueryFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
ApplyPackSpecsFunc ApplyPackSpecsFunc
|
|
|
|
ApplyPackSpecsFuncInvoked bool
|
|
|
|
|
|
|
|
GetPackSpecsFunc GetPackSpecsFunc
|
|
|
|
GetPackSpecsFuncInvoked bool
|
|
|
|
|
|
|
|
GetPackSpecFunc GetPackSpecFunc
|
|
|
|
GetPackSpecFuncInvoked bool
|
|
|
|
|
|
|
|
NewPackFunc NewPackFunc
|
|
|
|
NewPackFuncInvoked bool
|
|
|
|
|
|
|
|
SavePackFunc SavePackFunc
|
|
|
|
SavePackFuncInvoked bool
|
|
|
|
|
|
|
|
DeletePackFunc DeletePackFunc
|
|
|
|
DeletePackFuncInvoked bool
|
|
|
|
|
|
|
|
PackFunc PackFunc
|
|
|
|
PackFuncInvoked bool
|
|
|
|
|
|
|
|
ListPacksFunc ListPacksFunc
|
|
|
|
ListPacksFuncInvoked bool
|
|
|
|
|
|
|
|
PackByNameFunc PackByNameFunc
|
|
|
|
PackByNameFuncInvoked bool
|
|
|
|
|
|
|
|
ListPacksForHostFunc ListPacksForHostFunc
|
|
|
|
ListPacksForHostFuncInvoked bool
|
|
|
|
|
|
|
|
EnsureGlobalPackFunc EnsureGlobalPackFunc
|
|
|
|
EnsureGlobalPackFuncInvoked bool
|
|
|
|
|
|
|
|
EnsureTeamPackFunc EnsureTeamPackFunc
|
|
|
|
EnsureTeamPackFuncInvoked bool
|
|
|
|
|
|
|
|
ApplyLabelSpecsFunc ApplyLabelSpecsFunc
|
|
|
|
ApplyLabelSpecsFuncInvoked bool
|
|
|
|
|
|
|
|
GetLabelSpecsFunc GetLabelSpecsFunc
|
|
|
|
GetLabelSpecsFuncInvoked bool
|
|
|
|
|
|
|
|
GetLabelSpecFunc GetLabelSpecFunc
|
|
|
|
GetLabelSpecFuncInvoked bool
|
|
|
|
|
|
|
|
NewLabelFunc NewLabelFunc
|
|
|
|
NewLabelFuncInvoked bool
|
|
|
|
|
|
|
|
SaveLabelFunc SaveLabelFunc
|
|
|
|
SaveLabelFuncInvoked bool
|
|
|
|
|
|
|
|
DeleteLabelFunc DeleteLabelFunc
|
|
|
|
DeleteLabelFuncInvoked bool
|
|
|
|
|
|
|
|
LabelFunc LabelFunc
|
|
|
|
LabelFuncInvoked bool
|
|
|
|
|
|
|
|
ListLabelsFunc ListLabelsFunc
|
|
|
|
ListLabelsFuncInvoked bool
|
|
|
|
|
|
|
|
LabelQueriesForHostFunc LabelQueriesForHostFunc
|
|
|
|
LabelQueriesForHostFuncInvoked bool
|
|
|
|
|
|
|
|
RecordLabelQueryExecutionsFunc RecordLabelQueryExecutionsFunc
|
|
|
|
RecordLabelQueryExecutionsFuncInvoked bool
|
|
|
|
|
|
|
|
ListLabelsForHostFunc ListLabelsForHostFunc
|
|
|
|
ListLabelsForHostFuncInvoked bool
|
|
|
|
|
|
|
|
ListHostsInLabelFunc ListHostsInLabelFunc
|
|
|
|
ListHostsInLabelFuncInvoked bool
|
|
|
|
|
|
|
|
ListUniqueHostsInLabelsFunc ListUniqueHostsInLabelsFunc
|
|
|
|
ListUniqueHostsInLabelsFuncInvoked bool
|
|
|
|
|
|
|
|
SearchLabelsFunc SearchLabelsFunc
|
|
|
|
SearchLabelsFuncInvoked bool
|
|
|
|
|
|
|
|
LabelIDsByNameFunc LabelIDsByNameFunc
|
|
|
|
LabelIDsByNameFuncInvoked bool
|
|
|
|
|
2021-11-01 18:13:16 +00:00
|
|
|
AsyncBatchInsertLabelMembershipFunc AsyncBatchInsertLabelMembershipFunc
|
|
|
|
AsyncBatchInsertLabelMembershipFuncInvoked bool
|
|
|
|
|
|
|
|
AsyncBatchDeleteLabelMembershipFunc AsyncBatchDeleteLabelMembershipFunc
|
|
|
|
AsyncBatchDeleteLabelMembershipFuncInvoked bool
|
|
|
|
|
|
|
|
AsyncBatchUpdateLabelTimestampFunc AsyncBatchUpdateLabelTimestampFunc
|
|
|
|
AsyncBatchUpdateLabelTimestampFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
NewHostFunc NewHostFunc
|
|
|
|
NewHostFuncInvoked bool
|
|
|
|
|
|
|
|
SaveHostFunc SaveHostFunc
|
|
|
|
SaveHostFuncInvoked bool
|
|
|
|
|
2021-11-08 14:42:37 +00:00
|
|
|
SerialSaveHostFunc SerialSaveHostFunc
|
|
|
|
SerialSaveHostFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
DeleteHostFunc DeleteHostFunc
|
|
|
|
DeleteHostFuncInvoked bool
|
|
|
|
|
|
|
|
HostFunc HostFunc
|
|
|
|
HostFuncInvoked bool
|
|
|
|
|
|
|
|
EnrollHostFunc EnrollHostFunc
|
|
|
|
EnrollHostFuncInvoked bool
|
|
|
|
|
|
|
|
ListHostsFunc ListHostsFunc
|
|
|
|
ListHostsFuncInvoked bool
|
|
|
|
|
|
|
|
AuthenticateHostFunc AuthenticateHostFunc
|
|
|
|
AuthenticateHostFuncInvoked bool
|
|
|
|
|
|
|
|
MarkHostsSeenFunc MarkHostsSeenFunc
|
|
|
|
MarkHostsSeenFuncInvoked bool
|
|
|
|
|
|
|
|
SearchHostsFunc SearchHostsFunc
|
|
|
|
SearchHostsFuncInvoked bool
|
|
|
|
|
|
|
|
CleanupIncomingHostsFunc CleanupIncomingHostsFunc
|
|
|
|
CleanupIncomingHostsFuncInvoked bool
|
|
|
|
|
|
|
|
GenerateHostStatusStatisticsFunc GenerateHostStatusStatisticsFunc
|
|
|
|
GenerateHostStatusStatisticsFuncInvoked bool
|
|
|
|
|
|
|
|
HostIDsByNameFunc HostIDsByNameFunc
|
|
|
|
HostIDsByNameFuncInvoked bool
|
|
|
|
|
|
|
|
HostByIdentifierFunc HostByIdentifierFunc
|
|
|
|
HostByIdentifierFuncInvoked bool
|
|
|
|
|
|
|
|
AddHostsToTeamFunc AddHostsToTeamFunc
|
|
|
|
AddHostsToTeamFuncInvoked bool
|
|
|
|
|
2021-08-27 14:15:36 +00:00
|
|
|
TotalAndUnseenHostsSinceFunc TotalAndUnseenHostsSinceFunc
|
|
|
|
TotalAndUnseenHostsSinceFuncInvoked bool
|
|
|
|
|
2021-09-29 16:13:23 +00:00
|
|
|
DeleteHostsFunc DeleteHostsFunc
|
|
|
|
DeleteHostsFuncInvoked bool
|
|
|
|
|
2021-10-07 11:25:35 +00:00
|
|
|
CountHostsFunc CountHostsFunc
|
|
|
|
CountHostsFuncInvoked bool
|
|
|
|
|
|
|
|
CountHostsInLabelFunc CountHostsInLabelFunc
|
|
|
|
CountHostsInLabelFuncInvoked bool
|
|
|
|
|
2021-12-21 20:36:19 +00:00
|
|
|
ListHostDeviceMappingFunc ListHostDeviceMappingFunc
|
|
|
|
ListHostDeviceMappingFuncInvoked bool
|
|
|
|
|
|
|
|
ReplaceHostDeviceMappingFunc ReplaceHostDeviceMappingFunc
|
|
|
|
ReplaceHostDeviceMappingFuncInvoked bool
|
|
|
|
|
2021-10-07 11:11:10 +00:00
|
|
|
ListPoliciesForHostFunc ListPoliciesForHostFunc
|
|
|
|
ListPoliciesForHostFuncInvoked bool
|
|
|
|
|
2021-12-21 12:37:58 +00:00
|
|
|
SetOrUpdateMunkiVersionFunc SetOrUpdateMunkiVersionFunc
|
|
|
|
SetOrUpdateMunkiVersionFuncInvoked bool
|
|
|
|
|
|
|
|
SetOrUpdateMDMDataFunc SetOrUpdateMDMDataFunc
|
|
|
|
SetOrUpdateMDMDataFuncInvoked bool
|
|
|
|
|
|
|
|
GetMunkiVersionFunc GetMunkiVersionFunc
|
|
|
|
GetMunkiVersionFuncInvoked bool
|
|
|
|
|
|
|
|
GetMDMFunc GetMDMFunc
|
|
|
|
GetMDMFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
CountHostsInTargetsFunc CountHostsInTargetsFunc
|
|
|
|
CountHostsInTargetsFuncInvoked bool
|
|
|
|
|
|
|
|
HostIDsInTargetsFunc HostIDsInTargetsFunc
|
|
|
|
HostIDsInTargetsFuncInvoked bool
|
|
|
|
|
|
|
|
NewPasswordResetRequestFunc NewPasswordResetRequestFunc
|
|
|
|
NewPasswordResetRequestFuncInvoked bool
|
|
|
|
|
|
|
|
DeletePasswordResetRequestsForUserFunc DeletePasswordResetRequestsForUserFunc
|
|
|
|
DeletePasswordResetRequestsForUserFuncInvoked bool
|
|
|
|
|
|
|
|
FindPassswordResetByTokenFunc FindPassswordResetByTokenFunc
|
|
|
|
FindPassswordResetByTokenFuncInvoked bool
|
|
|
|
|
|
|
|
SessionByKeyFunc SessionByKeyFunc
|
|
|
|
SessionByKeyFuncInvoked bool
|
|
|
|
|
|
|
|
SessionByIDFunc SessionByIDFunc
|
|
|
|
SessionByIDFuncInvoked bool
|
|
|
|
|
|
|
|
ListSessionsForUserFunc ListSessionsForUserFunc
|
|
|
|
ListSessionsForUserFuncInvoked bool
|
|
|
|
|
|
|
|
NewSessionFunc NewSessionFunc
|
|
|
|
NewSessionFuncInvoked bool
|
|
|
|
|
|
|
|
DestroySessionFunc DestroySessionFunc
|
|
|
|
DestroySessionFuncInvoked bool
|
|
|
|
|
|
|
|
DestroyAllSessionsForUserFunc DestroyAllSessionsForUserFunc
|
|
|
|
DestroyAllSessionsForUserFuncInvoked bool
|
|
|
|
|
|
|
|
MarkSessionAccessedFunc MarkSessionAccessedFunc
|
|
|
|
MarkSessionAccessedFuncInvoked bool
|
|
|
|
|
|
|
|
NewAppConfigFunc NewAppConfigFunc
|
|
|
|
NewAppConfigFuncInvoked bool
|
|
|
|
|
|
|
|
AppConfigFunc AppConfigFunc
|
|
|
|
AppConfigFuncInvoked bool
|
|
|
|
|
|
|
|
SaveAppConfigFunc SaveAppConfigFunc
|
|
|
|
SaveAppConfigFuncInvoked bool
|
|
|
|
|
|
|
|
VerifyEnrollSecretFunc VerifyEnrollSecretFunc
|
|
|
|
VerifyEnrollSecretFuncInvoked bool
|
|
|
|
|
|
|
|
GetEnrollSecretsFunc GetEnrollSecretsFunc
|
|
|
|
GetEnrollSecretsFuncInvoked bool
|
|
|
|
|
|
|
|
ApplyEnrollSecretsFunc ApplyEnrollSecretsFunc
|
|
|
|
ApplyEnrollSecretsFuncInvoked bool
|
|
|
|
|
|
|
|
NewInviteFunc NewInviteFunc
|
|
|
|
NewInviteFuncInvoked bool
|
|
|
|
|
|
|
|
ListInvitesFunc ListInvitesFunc
|
|
|
|
ListInvitesFuncInvoked bool
|
|
|
|
|
|
|
|
InviteFunc InviteFunc
|
|
|
|
InviteFuncInvoked bool
|
|
|
|
|
|
|
|
InviteByEmailFunc InviteByEmailFunc
|
|
|
|
InviteByEmailFuncInvoked bool
|
|
|
|
|
|
|
|
InviteByTokenFunc InviteByTokenFunc
|
|
|
|
InviteByTokenFuncInvoked bool
|
|
|
|
|
|
|
|
DeleteInviteFunc DeleteInviteFunc
|
|
|
|
DeleteInviteFuncInvoked bool
|
|
|
|
|
2021-11-11 20:33:06 +00:00
|
|
|
UpdateInviteFunc UpdateInviteFunc
|
|
|
|
UpdateInviteFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
ListScheduledQueriesInPackFunc ListScheduledQueriesInPackFunc
|
|
|
|
ListScheduledQueriesInPackFuncInvoked bool
|
|
|
|
|
|
|
|
NewScheduledQueryFunc NewScheduledQueryFunc
|
|
|
|
NewScheduledQueryFuncInvoked bool
|
|
|
|
|
|
|
|
SaveScheduledQueryFunc SaveScheduledQueryFunc
|
|
|
|
SaveScheduledQueryFuncInvoked bool
|
|
|
|
|
|
|
|
DeleteScheduledQueryFunc DeleteScheduledQueryFunc
|
|
|
|
DeleteScheduledQueryFuncInvoked bool
|
|
|
|
|
|
|
|
ScheduledQueryFunc ScheduledQueryFunc
|
|
|
|
ScheduledQueryFuncInvoked bool
|
|
|
|
|
2021-10-19 20:47:37 +00:00
|
|
|
CleanupExpiredHostsFunc CleanupExpiredHostsFunc
|
|
|
|
CleanupExpiredHostsFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
NewTeamFunc NewTeamFunc
|
|
|
|
NewTeamFuncInvoked bool
|
|
|
|
|
|
|
|
SaveTeamFunc SaveTeamFunc
|
|
|
|
SaveTeamFuncInvoked bool
|
|
|
|
|
|
|
|
TeamFunc TeamFunc
|
|
|
|
TeamFuncInvoked bool
|
|
|
|
|
|
|
|
DeleteTeamFunc DeleteTeamFunc
|
|
|
|
DeleteTeamFuncInvoked bool
|
|
|
|
|
|
|
|
TeamByNameFunc TeamByNameFunc
|
|
|
|
TeamByNameFuncInvoked bool
|
|
|
|
|
|
|
|
ListTeamsFunc ListTeamsFunc
|
|
|
|
ListTeamsFuncInvoked bool
|
|
|
|
|
|
|
|
SearchTeamsFunc SearchTeamsFunc
|
|
|
|
SearchTeamsFuncInvoked bool
|
|
|
|
|
|
|
|
TeamEnrollSecretsFunc TeamEnrollSecretsFunc
|
|
|
|
TeamEnrollSecretsFuncInvoked bool
|
|
|
|
|
|
|
|
SaveHostSoftwareFunc SaveHostSoftwareFunc
|
|
|
|
SaveHostSoftwareFuncInvoked bool
|
|
|
|
|
|
|
|
LoadHostSoftwareFunc LoadHostSoftwareFunc
|
|
|
|
LoadHostSoftwareFuncInvoked bool
|
|
|
|
|
|
|
|
AllSoftwareWithoutCPEIteratorFunc AllSoftwareWithoutCPEIteratorFunc
|
|
|
|
AllSoftwareWithoutCPEIteratorFuncInvoked bool
|
|
|
|
|
|
|
|
AddCPEForSoftwareFunc AddCPEForSoftwareFunc
|
|
|
|
AddCPEForSoftwareFuncInvoked bool
|
|
|
|
|
|
|
|
AllCPEsFunc AllCPEsFunc
|
|
|
|
AllCPEsFuncInvoked bool
|
|
|
|
|
|
|
|
InsertCVEForCPEFunc InsertCVEForCPEFunc
|
|
|
|
InsertCVEForCPEFuncInvoked bool
|
|
|
|
|
2021-10-12 18:59:01 +00:00
|
|
|
SoftwareByIDFunc SoftwareByIDFunc
|
|
|
|
SoftwareByIDFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
NewActivityFunc NewActivityFunc
|
|
|
|
NewActivityFuncInvoked bool
|
|
|
|
|
|
|
|
ListActivitiesFunc ListActivitiesFunc
|
|
|
|
ListActivitiesFuncInvoked bool
|
|
|
|
|
|
|
|
ShouldSendStatisticsFunc ShouldSendStatisticsFunc
|
|
|
|
ShouldSendStatisticsFuncInvoked bool
|
|
|
|
|
|
|
|
RecordStatisticsSentFunc RecordStatisticsSentFunc
|
|
|
|
RecordStatisticsSentFuncInvoked bool
|
|
|
|
|
|
|
|
NewGlobalPolicyFunc NewGlobalPolicyFunc
|
|
|
|
NewGlobalPolicyFuncInvoked bool
|
|
|
|
|
|
|
|
PolicyFunc PolicyFunc
|
|
|
|
PolicyFuncInvoked bool
|
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
SavePolicyFunc SavePolicyFunc
|
|
|
|
SavePolicyFuncInvoked bool
|
|
|
|
|
2021-12-23 21:26:55 +00:00
|
|
|
FlippingPoliciesForHostFunc FlippingPoliciesForHostFunc
|
|
|
|
FlippingPoliciesForHostFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
RecordPolicyQueryExecutionsFunc RecordPolicyQueryExecutionsFunc
|
|
|
|
RecordPolicyQueryExecutionsFuncInvoked bool
|
|
|
|
|
|
|
|
ListGlobalPoliciesFunc ListGlobalPoliciesFunc
|
|
|
|
ListGlobalPoliciesFuncInvoked bool
|
|
|
|
|
|
|
|
DeleteGlobalPoliciesFunc DeleteGlobalPoliciesFunc
|
|
|
|
DeleteGlobalPoliciesFuncInvoked bool
|
|
|
|
|
|
|
|
PolicyQueriesForHostFunc PolicyQueriesForHostFunc
|
|
|
|
PolicyQueriesForHostFuncInvoked bool
|
|
|
|
|
2021-10-15 10:34:11 +00:00
|
|
|
ApplyPolicySpecsFunc ApplyPolicySpecsFunc
|
|
|
|
ApplyPolicySpecsFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
MigrateTablesFunc MigrateTablesFunc
|
|
|
|
MigrateTablesFuncInvoked bool
|
|
|
|
|
|
|
|
MigrateDataFunc MigrateDataFunc
|
|
|
|
MigrateDataFuncInvoked bool
|
|
|
|
|
|
|
|
MigrationStatusFunc MigrationStatusFunc
|
|
|
|
MigrationStatusFuncInvoked bool
|
2021-09-14 13:58:48 +00:00
|
|
|
|
|
|
|
ListSoftwareFunc ListSoftwareFunc
|
|
|
|
ListSoftwareFuncInvoked bool
|
2021-09-20 14:00:57 +00:00
|
|
|
|
2021-12-03 13:54:17 +00:00
|
|
|
CountSoftwareFunc CountSoftwareFunc
|
|
|
|
CountSoftwareFuncInvoked bool
|
|
|
|
|
2021-09-20 14:00:57 +00:00
|
|
|
NewTeamPolicyFunc NewTeamPolicyFunc
|
|
|
|
NewTeamPolicyFuncInvoked bool
|
|
|
|
|
|
|
|
ListTeamPoliciesFunc ListTeamPoliciesFunc
|
|
|
|
ListTeamPoliciesFuncInvoked bool
|
|
|
|
|
|
|
|
DeleteTeamPoliciesFunc DeleteTeamPoliciesFunc
|
|
|
|
DeleteTeamPoliciesFuncInvoked bool
|
|
|
|
|
|
|
|
TeamPolicyFunc TeamPolicyFunc
|
|
|
|
TeamPolicyFuncInvoked bool
|
2021-09-28 13:01:53 +00:00
|
|
|
|
|
|
|
LockFunc LockFunc
|
|
|
|
LockFuncInvoked bool
|
|
|
|
|
|
|
|
UnlockFunc UnlockFunc
|
|
|
|
UnlockFuncInvoked bool
|
2021-10-20 21:35:38 +00:00
|
|
|
|
2021-12-06 14:26:01 +00:00
|
|
|
DBLocksFunc DBLocksFunc
|
|
|
|
DBLocksFuncInvoked bool
|
|
|
|
|
2021-10-20 21:35:38 +00:00
|
|
|
UpdateScheduledQueryAggregatedStatsFunc UpdateScheduledQueryAggregatedStatsFunc
|
|
|
|
UpdateScheduledQueryAggregatedStatsFuncInvoked bool
|
|
|
|
|
|
|
|
UpdateQueryAggregatedStatsFunc UpdateQueryAggregatedStatsFunc
|
|
|
|
UpdateQueryAggregatedStatsFuncInvoked bool
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewCarve(ctx context.Context, metadata *fleet.CarveMetadata) (*fleet.CarveMetadata, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewCarveFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewCarveFunc(ctx, metadata)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) UpdateCarve(ctx context.Context, metadata *fleet.CarveMetadata) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.UpdateCarveFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.UpdateCarveFunc(ctx, metadata)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) Carve(ctx context.Context, carveId int64) (*fleet.CarveMetadata, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.CarveFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.CarveFunc(ctx, carveId)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) CarveBySessionId(ctx context.Context, sessionId string) (*fleet.CarveMetadata, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.CarveBySessionIdFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.CarveBySessionIdFunc(ctx, sessionId)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) CarveByName(ctx context.Context, name string) (*fleet.CarveMetadata, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.CarveByNameFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.CarveByNameFunc(ctx, name)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListCarves(ctx context.Context, opt fleet.CarveListOptions) ([]*fleet.CarveMetadata, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListCarvesFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListCarvesFunc(ctx, opt)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewBlock(ctx context.Context, metadata *fleet.CarveMetadata, blockId int64, data []byte) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewBlockFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewBlockFunc(ctx, metadata, blockId, data)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) GetBlock(ctx context.Context, metadata *fleet.CarveMetadata, blockId int64) ([]byte, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.GetBlockFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.GetBlockFunc(ctx, metadata, blockId)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) CleanupCarves(ctx context.Context, now time.Time) (expired int, err error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.CleanupCarvesFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.CleanupCarvesFunc(ctx, now)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewUser(ctx context.Context, user *fleet.User) (*fleet.User, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewUserFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewUserFunc(ctx, user)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListUsers(ctx context.Context, opt fleet.UserListOptions) ([]*fleet.User, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListUsersFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListUsersFunc(ctx, opt)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) UserByEmail(ctx context.Context, email string) (*fleet.User, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.UserByEmailFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.UserByEmailFunc(ctx, email)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) UserByID(ctx context.Context, id uint) (*fleet.User, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.UserByIDFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.UserByIDFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SaveUser(ctx context.Context, user *fleet.User) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SaveUserFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SaveUserFunc(ctx, user)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SaveUsers(ctx context.Context, users []*fleet.User) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SaveUsersFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SaveUsersFunc(ctx, users)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeleteUser(ctx context.Context, id uint) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeleteUserFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeleteUserFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) PendingEmailChange(ctx context.Context, userID uint, newEmail string, token string) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.PendingEmailChangeFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.PendingEmailChangeFunc(ctx, userID, newEmail, token)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ConfirmPendingEmailChange(ctx context.Context, userID uint, token string) (string, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ConfirmPendingEmailChangeFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ConfirmPendingEmailChangeFunc(ctx, userID, token)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ApplyQueries(ctx context.Context, authorID uint, queries []*fleet.Query) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ApplyQueriesFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ApplyQueriesFunc(ctx, authorID, queries)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewQuery(ctx context.Context, query *fleet.Query, opts ...fleet.OptionalArg) (*fleet.Query, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewQueryFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewQueryFunc(ctx, query, opts...)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SaveQuery(ctx context.Context, query *fleet.Query) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SaveQueryFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SaveQueryFunc(ctx, query)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeleteQuery(ctx context.Context, name string) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeleteQueryFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeleteQueryFunc(ctx, name)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeleteQueries(ctx context.Context, ids []uint) (uint, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeleteQueriesFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeleteQueriesFunc(ctx, ids)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) Query(ctx context.Context, id uint) (*fleet.Query, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.QueryFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.QueryFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-20 16:07:51 +00:00
|
|
|
func (s *DataStore) ListQueries(ctx context.Context, opt fleet.ListQueryOptions) ([]*fleet.Query, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListQueriesFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListQueriesFunc(ctx, opt)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) QueryByName(ctx context.Context, name string, opts ...fleet.OptionalArg) (*fleet.Query, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.QueryByNameFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.QueryByNameFunc(ctx, name, opts...)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewDistributedQueryCampaign(ctx context.Context, camp *fleet.DistributedQueryCampaign) (*fleet.DistributedQueryCampaign, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewDistributedQueryCampaignFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewDistributedQueryCampaignFunc(ctx, camp)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DistributedQueryCampaign(ctx context.Context, id uint) (*fleet.DistributedQueryCampaign, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DistributedQueryCampaignFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DistributedQueryCampaignFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SaveDistributedQueryCampaign(ctx context.Context, camp *fleet.DistributedQueryCampaign) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SaveDistributedQueryCampaignFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SaveDistributedQueryCampaignFunc(ctx, camp)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DistributedQueryCampaignTargetIDs(ctx context.Context, id uint) (targets *fleet.HostTargets, err error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DistributedQueryCampaignTargetIDsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DistributedQueryCampaignTargetIDsFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewDistributedQueryCampaignTarget(ctx context.Context, target *fleet.DistributedQueryCampaignTarget) (*fleet.DistributedQueryCampaignTarget, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewDistributedQueryCampaignTargetFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewDistributedQueryCampaignTargetFunc(ctx, target)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) CleanupDistributedQueryCampaigns(ctx context.Context, now time.Time) (expired uint, err error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.CleanupDistributedQueryCampaignsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.CleanupDistributedQueryCampaignsFunc(ctx, now)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-10-26 14:33:31 +00:00
|
|
|
func (s *DataStore) DistributedQueryCampaignsForQuery(ctx context.Context, queryID uint) ([]*fleet.DistributedQueryCampaign, error) {
|
|
|
|
s.DistributedQueryCampaignsForQueryFuncInvoked = true
|
|
|
|
return s.DistributedQueryCampaignsForQueryFunc(ctx, queryID)
|
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ApplyPackSpecs(ctx context.Context, specs []*fleet.PackSpec) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ApplyPackSpecsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ApplyPackSpecsFunc(ctx, specs)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) GetPackSpecs(ctx context.Context) ([]*fleet.PackSpec, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.GetPackSpecsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.GetPackSpecsFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) GetPackSpec(ctx context.Context, name string) (*fleet.PackSpec, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.GetPackSpecFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.GetPackSpecFunc(ctx, name)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewPack(ctx context.Context, pack *fleet.Pack, opts ...fleet.OptionalArg) (*fleet.Pack, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewPackFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewPackFunc(ctx, pack, opts...)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SavePack(ctx context.Context, pack *fleet.Pack) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SavePackFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SavePackFunc(ctx, pack)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeletePack(ctx context.Context, name string) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeletePackFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeletePackFunc(ctx, name)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) Pack(ctx context.Context, pid uint) (*fleet.Pack, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.PackFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.PackFunc(ctx, pid)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListPacks(ctx context.Context, opt fleet.PackListOptions) ([]*fleet.Pack, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListPacksFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListPacksFunc(ctx, opt)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) PackByName(ctx context.Context, name string, opts ...fleet.OptionalArg) (*fleet.Pack, bool, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.PackByNameFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.PackByNameFunc(ctx, name, opts...)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListPacksForHost(ctx context.Context, hid uint) (packs []*fleet.Pack, err error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListPacksForHostFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListPacksForHostFunc(ctx, hid)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) EnsureGlobalPack(ctx context.Context) (*fleet.Pack, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.EnsureGlobalPackFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.EnsureGlobalPackFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) EnsureTeamPack(ctx context.Context, teamID uint) (*fleet.Pack, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.EnsureTeamPackFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.EnsureTeamPackFunc(ctx, teamID)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ApplyLabelSpecs(ctx context.Context, specs []*fleet.LabelSpec) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ApplyLabelSpecsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ApplyLabelSpecsFunc(ctx, specs)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) GetLabelSpecs(ctx context.Context) ([]*fleet.LabelSpec, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.GetLabelSpecsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.GetLabelSpecsFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) GetLabelSpec(ctx context.Context, name string) (*fleet.LabelSpec, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.GetLabelSpecFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.GetLabelSpecFunc(ctx, name)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewLabel(ctx context.Context, Label *fleet.Label, opts ...fleet.OptionalArg) (*fleet.Label, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewLabelFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewLabelFunc(ctx, Label, opts...)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SaveLabel(ctx context.Context, label *fleet.Label) (*fleet.Label, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SaveLabelFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SaveLabelFunc(ctx, label)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeleteLabel(ctx context.Context, name string) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeleteLabelFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeleteLabelFunc(ctx, name)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) Label(ctx context.Context, lid uint) (*fleet.Label, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.LabelFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.LabelFunc(ctx, lid)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListLabels(ctx context.Context, filter fleet.TeamFilter, opt fleet.ListOptions) ([]*fleet.Label, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListLabelsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListLabelsFunc(ctx, filter, opt)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-21 17:21:44 +00:00
|
|
|
func (s *DataStore) LabelQueriesForHost(ctx context.Context, host *fleet.Host) (map[string]string, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.LabelQueriesForHostFuncInvoked = true
|
2021-09-21 17:21:44 +00:00
|
|
|
return s.LabelQueriesForHostFunc(ctx, host)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-08 14:42:37 +00:00
|
|
|
func (s *DataStore) RecordLabelQueryExecutions(ctx context.Context, host *fleet.Host, results map[uint]*bool, t time.Time, deferredSaveHost bool) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.RecordLabelQueryExecutionsFuncInvoked = true
|
2021-11-09 14:35:36 +00:00
|
|
|
return s.RecordLabelQueryExecutionsFunc(ctx, host, results, t, deferredSaveHost)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListLabelsForHost(ctx context.Context, hid uint) ([]*fleet.Label, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListLabelsForHostFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListLabelsForHostFunc(ctx, hid)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListHostsInLabel(ctx context.Context, filter fleet.TeamFilter, lid uint, opt fleet.HostListOptions) ([]*fleet.Host, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListHostsInLabelFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListHostsInLabelFunc(ctx, filter, lid, opt)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListUniqueHostsInLabels(ctx context.Context, filter fleet.TeamFilter, labels []uint) ([]*fleet.Host, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListUniqueHostsInLabelsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListUniqueHostsInLabelsFunc(ctx, filter, labels)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SearchLabels(ctx context.Context, filter fleet.TeamFilter, query string, omit ...uint) ([]*fleet.Label, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SearchLabelsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SearchLabelsFunc(ctx, filter, query, omit...)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) LabelIDsByName(ctx context.Context, labels []string) ([]uint, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.LabelIDsByNameFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.LabelIDsByNameFunc(ctx, labels)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-01 18:13:16 +00:00
|
|
|
func (s *DataStore) AsyncBatchInsertLabelMembership(ctx context.Context, batch [][2]uint) error {
|
|
|
|
s.AsyncBatchInsertLabelMembershipFuncInvoked = true
|
|
|
|
return s.AsyncBatchInsertLabelMembershipFunc(ctx, batch)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) AsyncBatchDeleteLabelMembership(ctx context.Context, batch [][2]uint) error {
|
|
|
|
s.AsyncBatchDeleteLabelMembershipFuncInvoked = true
|
|
|
|
return s.AsyncBatchDeleteLabelMembershipFunc(ctx, batch)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) AsyncBatchUpdateLabelTimestamp(ctx context.Context, ids []uint, ts time.Time) error {
|
|
|
|
s.AsyncBatchUpdateLabelTimestampFuncInvoked = true
|
|
|
|
return s.AsyncBatchUpdateLabelTimestampFunc(ctx, ids, ts)
|
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewHost(ctx context.Context, host *fleet.Host) (*fleet.Host, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewHostFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewHostFunc(ctx, host)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SaveHost(ctx context.Context, host *fleet.Host) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SaveHostFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SaveHostFunc(ctx, host)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-08 14:42:37 +00:00
|
|
|
func (s *DataStore) SerialSaveHost(ctx context.Context, host *fleet.Host) error {
|
|
|
|
s.SerialSaveHostFuncInvoked = true
|
|
|
|
return s.SerialSaveHostFunc(ctx, host)
|
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeleteHost(ctx context.Context, hid uint) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeleteHostFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeleteHostFunc(ctx, hid)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-18 17:36:35 +00:00
|
|
|
func (s *DataStore) Host(ctx context.Context, id uint, skipLoadingExtras bool) (*fleet.Host, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.HostFuncInvoked = true
|
2021-11-24 17:16:42 +00:00
|
|
|
return s.HostFunc(ctx, id, skipLoadingExtras)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) EnrollHost(ctx context.Context, osqueryHostId string, nodeKey string, teamID *uint, cooldown time.Duration) (*fleet.Host, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.EnrollHostFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.EnrollHostFunc(ctx, osqueryHostId, nodeKey, teamID, cooldown)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListHosts(ctx context.Context, filter fleet.TeamFilter, opt fleet.HostListOptions) ([]*fleet.Host, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListHostsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListHostsFunc(ctx, filter, opt)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) AuthenticateHost(ctx context.Context, nodeKey string) (*fleet.Host, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.AuthenticateHostFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.AuthenticateHostFunc(ctx, nodeKey)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) MarkHostsSeen(ctx context.Context, hostIDs []uint, t time.Time) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.MarkHostsSeenFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.MarkHostsSeenFunc(ctx, hostIDs, t)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SearchHosts(ctx context.Context, filter fleet.TeamFilter, query string, omit ...uint) ([]*fleet.Host, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SearchHostsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SearchHostsFunc(ctx, filter, query, omit...)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) CleanupIncomingHosts(ctx context.Context, now time.Time) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.CleanupIncomingHostsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.CleanupIncomingHostsFunc(ctx, now)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-09 14:35:36 +00:00
|
|
|
func (s *DataStore) GenerateHostStatusStatistics(ctx context.Context, filter fleet.TeamFilter, now time.Time) (*fleet.HostSummary, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.GenerateHostStatusStatisticsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.GenerateHostStatusStatisticsFunc(ctx, filter, now)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) HostIDsByName(ctx context.Context, filter fleet.TeamFilter, hostnames []string) ([]uint, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.HostIDsByNameFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.HostIDsByNameFunc(ctx, filter, hostnames)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) HostByIdentifier(ctx context.Context, identifier string) (*fleet.Host, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.HostByIdentifierFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.HostByIdentifierFunc(ctx, identifier)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) AddHostsToTeam(ctx context.Context, teamID *uint, hostIDs []uint) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.AddHostsToTeamFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.AddHostsToTeamFunc(ctx, teamID, hostIDs)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-12-03 13:54:17 +00:00
|
|
|
func (s *DataStore) TotalAndUnseenHostsSince(ctx context.Context, daysCount int) (total int, unseen int, err error) {
|
2021-08-27 14:15:36 +00:00
|
|
|
s.TotalAndUnseenHostsSinceFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.TotalAndUnseenHostsSinceFunc(ctx, daysCount)
|
2021-08-27 14:15:36 +00:00
|
|
|
}
|
|
|
|
|
2021-09-29 16:13:23 +00:00
|
|
|
func (s *DataStore) DeleteHosts(ctx context.Context, ids []uint) error {
|
|
|
|
s.DeleteHostsFuncInvoked = true
|
|
|
|
return s.DeleteHostsFunc(ctx, ids)
|
|
|
|
}
|
|
|
|
|
2021-10-07 11:25:35 +00:00
|
|
|
func (s *DataStore) CountHosts(ctx context.Context, filter fleet.TeamFilter, opt fleet.HostListOptions) (int, error) {
|
|
|
|
s.CountHostsFuncInvoked = true
|
|
|
|
return s.CountHostsFunc(ctx, filter, opt)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) CountHostsInLabel(ctx context.Context, filter fleet.TeamFilter, lid uint, opt fleet.HostListOptions) (int, error) {
|
|
|
|
s.CountHostsInLabelFuncInvoked = true
|
|
|
|
return s.CountHostsInLabelFunc(ctx, filter, lid, opt)
|
|
|
|
}
|
|
|
|
|
2021-12-21 20:36:19 +00:00
|
|
|
func (s *DataStore) ListHostDeviceMapping(ctx context.Context, id uint) ([]*fleet.HostDeviceMapping, error) {
|
|
|
|
s.ListHostDeviceMappingFuncInvoked = true
|
|
|
|
return s.ListHostDeviceMappingFunc(ctx, id)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) ReplaceHostDeviceMapping(ctx context.Context, id uint, mappings []*fleet.HostDeviceMapping) error {
|
|
|
|
s.ReplaceHostDeviceMappingFuncInvoked = true
|
|
|
|
return s.ReplaceHostDeviceMappingFunc(ctx, id, mappings)
|
|
|
|
}
|
|
|
|
|
2021-12-03 18:33:33 +00:00
|
|
|
func (s *DataStore) ListPoliciesForHost(ctx context.Context, host *fleet.Host) ([]*fleet.HostPolicy, error) {
|
2021-10-07 11:11:10 +00:00
|
|
|
s.ListPoliciesForHostFuncInvoked = true
|
2021-12-03 18:33:33 +00:00
|
|
|
return s.ListPoliciesForHostFunc(ctx, host)
|
2021-10-07 11:11:10 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 12:37:58 +00:00
|
|
|
func (s *DataStore) SetOrUpdateMunkiVersion(ctx context.Context, hostID uint, version string) error {
|
|
|
|
s.SetOrUpdateMunkiVersionFuncInvoked = true
|
|
|
|
return s.SetOrUpdateMunkiVersionFunc(ctx, hostID, version)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) SetOrUpdateMDMData(ctx context.Context, hostID uint, enrolled bool, serverURL string, installedFromDep bool) error {
|
|
|
|
s.SetOrUpdateMDMDataFuncInvoked = true
|
|
|
|
return s.SetOrUpdateMDMDataFunc(ctx, hostID, enrolled, serverURL, installedFromDep)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) GetMunkiVersion(ctx context.Context, hostID uint) (string, error) {
|
|
|
|
s.GetMunkiVersionFuncInvoked = true
|
|
|
|
return s.GetMunkiVersionFunc(ctx, hostID)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) GetMDM(ctx context.Context, hostID uint) (enrolled bool, serverURL string, installedFromDep bool, err error) {
|
|
|
|
s.GetMDMFuncInvoked = true
|
|
|
|
return s.GetMDMFunc(ctx, hostID)
|
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) CountHostsInTargets(ctx context.Context, filter fleet.TeamFilter, targets fleet.HostTargets, now time.Time) (fleet.TargetMetrics, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.CountHostsInTargetsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.CountHostsInTargetsFunc(ctx, filter, targets, now)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) HostIDsInTargets(ctx context.Context, filter fleet.TeamFilter, targets fleet.HostTargets) ([]uint, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.HostIDsInTargetsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.HostIDsInTargetsFunc(ctx, filter, targets)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewPasswordResetRequest(ctx context.Context, req *fleet.PasswordResetRequest) (*fleet.PasswordResetRequest, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewPasswordResetRequestFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewPasswordResetRequestFunc(ctx, req)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeletePasswordResetRequestsForUser(ctx context.Context, userID uint) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeletePasswordResetRequestsForUserFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeletePasswordResetRequestsForUserFunc(ctx, userID)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) FindPassswordResetByToken(ctx context.Context, token string) (*fleet.PasswordResetRequest, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.FindPassswordResetByTokenFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.FindPassswordResetByTokenFunc(ctx, token)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SessionByKey(ctx context.Context, key string) (*fleet.Session, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SessionByKeyFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SessionByKeyFunc(ctx, key)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SessionByID(ctx context.Context, id uint) (*fleet.Session, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SessionByIDFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SessionByIDFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListSessionsForUser(ctx context.Context, id uint) ([]*fleet.Session, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListSessionsForUserFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListSessionsForUserFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewSession(ctx context.Context, session *fleet.Session) (*fleet.Session, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewSessionFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewSessionFunc(ctx, session)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DestroySession(ctx context.Context, session *fleet.Session) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DestroySessionFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DestroySessionFunc(ctx, session)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DestroyAllSessionsForUser(ctx context.Context, id uint) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DestroyAllSessionsForUserFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DestroyAllSessionsForUserFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) MarkSessionAccessed(ctx context.Context, session *fleet.Session) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.MarkSessionAccessedFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.MarkSessionAccessedFunc(ctx, session)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewAppConfig(ctx context.Context, info *fleet.AppConfig) (*fleet.AppConfig, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewAppConfigFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewAppConfigFunc(ctx, info)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) AppConfig(ctx context.Context) (*fleet.AppConfig, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.AppConfigFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.AppConfigFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SaveAppConfig(ctx context.Context, info *fleet.AppConfig) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SaveAppConfigFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SaveAppConfigFunc(ctx, info)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) VerifyEnrollSecret(ctx context.Context, secret string) (*fleet.EnrollSecret, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.VerifyEnrollSecretFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.VerifyEnrollSecretFunc(ctx, secret)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) GetEnrollSecrets(ctx context.Context, teamID *uint) ([]*fleet.EnrollSecret, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.GetEnrollSecretsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.GetEnrollSecretsFunc(ctx, teamID)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ApplyEnrollSecrets(ctx context.Context, teamID *uint, secrets []*fleet.EnrollSecret) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ApplyEnrollSecretsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ApplyEnrollSecretsFunc(ctx, teamID, secrets)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewInvite(ctx context.Context, i *fleet.Invite) (*fleet.Invite, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewInviteFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewInviteFunc(ctx, i)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListInvites(ctx context.Context, opt fleet.ListOptions) ([]*fleet.Invite, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListInvitesFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListInvitesFunc(ctx, opt)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) Invite(ctx context.Context, id uint) (*fleet.Invite, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.InviteFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.InviteFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) InviteByEmail(ctx context.Context, email string) (*fleet.Invite, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.InviteByEmailFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.InviteByEmailFunc(ctx, email)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) InviteByToken(ctx context.Context, token string) (*fleet.Invite, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.InviteByTokenFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.InviteByTokenFunc(ctx, token)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeleteInvite(ctx context.Context, id uint) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeleteInviteFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeleteInviteFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-11 20:33:06 +00:00
|
|
|
func (s *DataStore) UpdateInvite(ctx context.Context, id uint, i *fleet.Invite) (*fleet.Invite, error) {
|
|
|
|
s.UpdateInviteFuncInvoked = true
|
|
|
|
return s.UpdateInviteFunc(ctx, id, i)
|
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListScheduledQueriesInPack(ctx context.Context, id uint, opts fleet.ListOptions) ([]*fleet.ScheduledQuery, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListScheduledQueriesInPackFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListScheduledQueriesInPackFunc(ctx, id, opts)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewScheduledQuery(ctx context.Context, sq *fleet.ScheduledQuery, opts ...fleet.OptionalArg) (*fleet.ScheduledQuery, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewScheduledQueryFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewScheduledQueryFunc(ctx, sq, opts...)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SaveScheduledQuery(ctx context.Context, sq *fleet.ScheduledQuery) (*fleet.ScheduledQuery, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SaveScheduledQueryFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SaveScheduledQueryFunc(ctx, sq)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeleteScheduledQuery(ctx context.Context, id uint) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeleteScheduledQueryFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeleteScheduledQueryFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ScheduledQuery(ctx context.Context, id uint) (*fleet.ScheduledQuery, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ScheduledQueryFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ScheduledQueryFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-10-19 20:47:37 +00:00
|
|
|
func (s *DataStore) CleanupExpiredHosts(ctx context.Context) error {
|
|
|
|
s.CleanupExpiredHostsFuncInvoked = true
|
|
|
|
return s.CleanupExpiredHostsFunc(ctx)
|
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewTeam(ctx context.Context, team *fleet.Team) (*fleet.Team, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewTeamFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewTeamFunc(ctx, team)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SaveTeam(ctx context.Context, team *fleet.Team) (*fleet.Team, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SaveTeamFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SaveTeamFunc(ctx, team)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) Team(ctx context.Context, tid uint) (*fleet.Team, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.TeamFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.TeamFunc(ctx, tid)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeleteTeam(ctx context.Context, tid uint) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeleteTeamFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeleteTeamFunc(ctx, tid)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) TeamByName(ctx context.Context, name string) (*fleet.Team, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.TeamByNameFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.TeamByNameFunc(ctx, name)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListTeams(ctx context.Context, filter fleet.TeamFilter, opt fleet.ListOptions) ([]*fleet.Team, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListTeamsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListTeamsFunc(ctx, filter, opt)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SearchTeams(ctx context.Context, filter fleet.TeamFilter, matchQuery string, omit ...uint) ([]*fleet.Team, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SearchTeamsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SearchTeamsFunc(ctx, filter, matchQuery, omit...)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) TeamEnrollSecrets(ctx context.Context, teamID uint) ([]*fleet.EnrollSecret, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.TeamEnrollSecretsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.TeamEnrollSecretsFunc(ctx, teamID)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) SaveHostSoftware(ctx context.Context, host *fleet.Host) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.SaveHostSoftwareFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.SaveHostSoftwareFunc(ctx, host)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) LoadHostSoftware(ctx context.Context, host *fleet.Host) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.LoadHostSoftwareFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.LoadHostSoftwareFunc(ctx, host)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) AllSoftwareWithoutCPEIterator(ctx context.Context) (fleet.SoftwareIterator, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.AllSoftwareWithoutCPEIteratorFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.AllSoftwareWithoutCPEIteratorFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) AddCPEForSoftware(ctx context.Context, software fleet.Software, cpe string) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.AddCPEForSoftwareFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.AddCPEForSoftwareFunc(ctx, software, cpe)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) AllCPEs(ctx context.Context) ([]string, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.AllCPEsFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.AllCPEsFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) InsertCVEForCPE(ctx context.Context, cve string, cpes []string) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.InsertCVEForCPEFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.InsertCVEForCPEFunc(ctx, cve, cpes)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-10-12 18:59:01 +00:00
|
|
|
func (s *DataStore) SoftwareByID(ctx context.Context, id uint) (*fleet.Software, error) {
|
|
|
|
s.SoftwareByIDFuncInvoked = true
|
|
|
|
return s.SoftwareByIDFunc(ctx, id)
|
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) NewActivity(ctx context.Context, user *fleet.User, activityType string, details *map[string]interface{}) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewActivityFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.NewActivityFunc(ctx, user, activityType, details)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListActivities(ctx context.Context, opt fleet.ListOptions) ([]*fleet.Activity, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListActivitiesFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListActivitiesFunc(ctx, opt)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-12-06 20:39:00 +00:00
|
|
|
func (s *DataStore) ShouldSendStatistics(ctx context.Context, frequency time.Duration, license *fleet.LicenseInfo) (fleet.StatisticsPayload, bool, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ShouldSendStatisticsFuncInvoked = true
|
2021-12-06 20:39:00 +00:00
|
|
|
return s.ShouldSendStatisticsFunc(ctx, frequency, license)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) RecordStatisticsSent(ctx context.Context) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.RecordStatisticsSentFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.RecordStatisticsSentFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
func (s *DataStore) NewGlobalPolicy(ctx context.Context, authorID *uint, args fleet.PolicyPayload) (*fleet.Policy, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewGlobalPolicyFuncInvoked = true
|
2021-11-24 17:16:42 +00:00
|
|
|
return s.NewGlobalPolicyFunc(ctx, authorID, args)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) Policy(ctx context.Context, id uint) (*fleet.Policy, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.PolicyFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.PolicyFunc(ctx, id)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
func (s *DataStore) SavePolicy(ctx context.Context, p *fleet.Policy) error {
|
|
|
|
s.SavePolicyFuncInvoked = true
|
|
|
|
return s.SavePolicyFunc(ctx, p)
|
|
|
|
}
|
|
|
|
|
2021-12-23 21:26:55 +00:00
|
|
|
func (s *DataStore) FlippingPoliciesForHost(ctx context.Context, hostID uint, incomingResults map[uint]*bool) (newFailing []uint, newPassing []uint, err error) {
|
|
|
|
s.FlippingPoliciesForHostFuncInvoked = true
|
|
|
|
return s.FlippingPoliciesForHostFunc(ctx, hostID, incomingResults)
|
|
|
|
}
|
|
|
|
|
2021-11-08 14:42:37 +00:00
|
|
|
func (s *DataStore) RecordPolicyQueryExecutions(ctx context.Context, host *fleet.Host, results map[uint]*bool, updated time.Time, deferredSaveHost bool) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.RecordPolicyQueryExecutionsFuncInvoked = true
|
2021-11-09 14:35:36 +00:00
|
|
|
return s.RecordPolicyQueryExecutionsFunc(ctx, host, results, updated, deferredSaveHost)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) ListGlobalPolicies(ctx context.Context) ([]*fleet.Policy, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ListGlobalPoliciesFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.ListGlobalPoliciesFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) DeleteGlobalPolicies(ctx context.Context, ids []uint) ([]uint, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.DeleteGlobalPoliciesFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.DeleteGlobalPoliciesFunc(ctx, ids)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) PolicyQueriesForHost(ctx context.Context, host *fleet.Host) (map[string]string, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.PolicyQueriesForHostFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.PolicyQueriesForHostFunc(ctx, host)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
func (s *DataStore) ApplyPolicySpecs(ctx context.Context, authorID uint, specs []*fleet.PolicySpec) error {
|
2021-10-15 10:34:11 +00:00
|
|
|
s.ApplyPolicySpecsFuncInvoked = true
|
2021-11-24 17:16:42 +00:00
|
|
|
return s.ApplyPolicySpecsFunc(ctx, authorID, specs)
|
2021-10-15 10:34:11 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) MigrateTables(ctx context.Context) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.MigrateTablesFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.MigrateTablesFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-09-14 12:11:07 +00:00
|
|
|
func (s *DataStore) MigrateData(ctx context.Context) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.MigrateDataFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.MigrateDataFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2021-11-22 17:06:12 +00:00
|
|
|
func (s *DataStore) MigrationStatus(ctx context.Context) (*fleet.MigrationStatus, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.MigrationStatusFuncInvoked = true
|
2021-09-14 12:11:07 +00:00
|
|
|
return s.MigrationStatusFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
2021-09-14 13:58:48 +00:00
|
|
|
|
2021-10-20 21:01:20 +00:00
|
|
|
func (s *DataStore) ListSoftware(ctx context.Context, opt fleet.SoftwareListOptions) ([]fleet.Software, error) {
|
2021-09-14 13:58:48 +00:00
|
|
|
s.ListSoftwareFuncInvoked = true
|
2021-10-20 21:01:20 +00:00
|
|
|
return s.ListSoftwareFunc(ctx, opt)
|
2021-09-14 13:58:48 +00:00
|
|
|
}
|
2021-09-20 14:00:57 +00:00
|
|
|
|
2021-12-03 13:54:17 +00:00
|
|
|
func (s *DataStore) CountSoftware(ctx context.Context, opt fleet.SoftwareListOptions) (int, error) {
|
|
|
|
s.CountSoftwareFuncInvoked = true
|
|
|
|
return s.CountSoftwareFunc(ctx, opt)
|
|
|
|
}
|
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
func (s *DataStore) NewTeamPolicy(ctx context.Context, teamID uint, authorID *uint, args fleet.PolicyPayload) (*fleet.Policy, error) {
|
2021-09-20 14:00:57 +00:00
|
|
|
s.NewTeamPolicyFuncInvoked = true
|
2021-11-24 17:16:42 +00:00
|
|
|
return s.NewTeamPolicyFunc(ctx, teamID, authorID, args)
|
2021-09-20 14:00:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) ListTeamPolicies(ctx context.Context, teamID uint) ([]*fleet.Policy, error) {
|
|
|
|
s.ListTeamPoliciesFuncInvoked = true
|
|
|
|
return s.ListTeamPoliciesFunc(ctx, teamID)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) DeleteTeamPolicies(ctx context.Context, teamID uint, ids []uint) ([]uint, error) {
|
|
|
|
s.DeleteTeamPoliciesFuncInvoked = true
|
|
|
|
return s.DeleteTeamPoliciesFunc(ctx, teamID, ids)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) TeamPolicy(ctx context.Context, teamID uint, policyID uint) (*fleet.Policy, error) {
|
|
|
|
s.TeamPolicyFuncInvoked = true
|
|
|
|
return s.TeamPolicyFunc(ctx, teamID, policyID)
|
|
|
|
}
|
2021-09-28 13:01:53 +00:00
|
|
|
|
|
|
|
func (s *DataStore) Lock(ctx context.Context, name string, owner string, expiration time.Duration) (bool, error) {
|
|
|
|
s.LockFuncInvoked = true
|
|
|
|
return s.LockFunc(ctx, name, owner, expiration)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) Unlock(ctx context.Context, name string, owner string) error {
|
|
|
|
s.UnlockFuncInvoked = true
|
|
|
|
return s.UnlockFunc(ctx, name, owner)
|
|
|
|
}
|
2021-10-20 21:35:38 +00:00
|
|
|
|
2021-12-06 14:26:01 +00:00
|
|
|
func (s *DataStore) DBLocks(ctx context.Context) ([]*fleet.DBLock, error) {
|
|
|
|
s.DBLocksFuncInvoked = true
|
|
|
|
return s.DBLocksFunc(ctx)
|
|
|
|
}
|
|
|
|
|
2021-10-20 21:35:38 +00:00
|
|
|
func (s *DataStore) UpdateScheduledQueryAggregatedStats(ctx context.Context) error {
|
|
|
|
s.UpdateScheduledQueryAggregatedStatsFuncInvoked = true
|
|
|
|
return s.UpdateScheduledQueryAggregatedStatsFunc(ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) UpdateQueryAggregatedStats(ctx context.Context) error {
|
|
|
|
s.UpdateQueryAggregatedStatsFuncInvoked = true
|
|
|
|
return s.UpdateQueryAggregatedStatsFunc(ctx)
|
|
|
|
}
|