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"
|
2022-01-18 01:52:09 +00:00
|
|
|
"encoding/json"
|
2021-08-24 21:49:56 +00:00
|
|
|
"time"
|
|
|
|
|
2022-07-21 01:54:10 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/server/config"
|
2021-08-24 21:49:56 +00:00
|
|
|
"github.com/fleetdm/fleet/v4/server/fleet"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ fleet.Datastore = (*DataStore)(nil)
|
|
|
|
|
2022-07-01 11:08:03 +00:00
|
|
|
type HealthCheckFunc func() error
|
|
|
|
|
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
|
|
|
|
2022-06-10 18:29:45 +00:00
|
|
|
type ObserverCanRunQueryFunc func(ctx context.Context, queryID uint) (bool, error)
|
|
|
|
|
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
|
|
|
|
2022-05-10 15:32:55 +00:00
|
|
|
type LabelsSummaryFunc func(ctx context.Context) ([]*fleet.LabelSummary, error)
|
|
|
|
|
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-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 DeleteHostFunc func(ctx context.Context, hid uint) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2022-05-25 16:30:03 +00:00
|
|
|
type HostFunc func(ctx context.Context, id uint) (*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 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
|
|
|
|
2022-06-13 20:29:32 +00:00
|
|
|
type EnrolledHostIDsFunc func(ctx context.Context) ([]uint, error)
|
|
|
|
|
|
|
|
type CountEnrolledHostsFunc func(ctx context.Context) (int, error)
|
|
|
|
|
|
|
|
type CleanupIncomingHostsFunc func(ctx context.Context, now time.Time) ([]uint, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2022-01-24 17:49:21 +00:00
|
|
|
type GenerateHostStatusStatisticsFunc func(ctx context.Context, filter fleet.TeamFilter, now time.Time, platform *string) (*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
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
type HostIDsByOSVersionFunc func(ctx context.Context, osVersion fleet.OSVersion, offset int, limit int) ([]uint, error)
|
|
|
|
|
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)
|
|
|
|
|
2022-06-28 18:11:49 +00:00
|
|
|
type ListHostBatteriesFunc func(ctx context.Context, id uint) ([]*fleet.HostBattery, error)
|
|
|
|
|
2022-09-08 18:04:02 +00:00
|
|
|
type LoadHostByDeviceAuthTokenFunc func(ctx context.Context, authToken string) (*fleet.Host, error)
|
2022-03-09 21:13:56 +00:00
|
|
|
|
2022-03-15 19:51:00 +00:00
|
|
|
type SetOrUpdateDeviceAuthTokenFunc func(ctx context.Context, hostID uint, authToken string) error
|
|
|
|
|
2022-09-12 19:37:38 +00:00
|
|
|
type FailingPoliciesCountFunc func(ctx context.Context, host *fleet.Host) (uint, 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
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
type GetHostMunkiVersionFunc func(ctx context.Context, hostID uint) (string, error)
|
2021-12-21 12:37:58 +00:00
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
type GetHostMunkiIssuesFunc func(ctx context.Context, hostID uint) ([]*fleet.HostMunkiIssue, error)
|
2022-08-29 18:40:16 +00:00
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
type GetHostMDMFunc func(ctx context.Context, hostID uint) (*fleet.HostMDM, error)
|
2021-12-21 12:37:58 +00:00
|
|
|
|
2022-02-07 17:53:33 +00:00
|
|
|
type AggregatedMunkiVersionFunc func(ctx context.Context, teamID *uint) ([]fleet.AggregatedMunkiVersion, time.Time, error)
|
2022-01-26 20:55:07 +00:00
|
|
|
|
2022-08-29 18:40:16 +00:00
|
|
|
type AggregatedMunkiIssuesFunc func(ctx context.Context, teamID *uint) ([]fleet.AggregatedMunkiIssue, time.Time, error)
|
|
|
|
|
2022-02-07 17:53:33 +00:00
|
|
|
type AggregatedMDMStatusFunc func(ctx context.Context, teamID *uint) (fleet.AggregatedMDMStatus, time.Time, error)
|
2022-01-26 20:55:07 +00:00
|
|
|
|
2022-08-10 19:15:01 +00:00
|
|
|
type AggregatedMDMSolutionsFunc func(ctx context.Context, teamID *uint) ([]fleet.AggregatedMDMSolutions, time.Time, error)
|
|
|
|
|
2022-01-26 20:55:07 +00:00
|
|
|
type GenerateAggregatedMunkiAndMDMFunc func(ctx context.Context) error
|
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
type GetMunkiIssueFunc func(ctx context.Context, munkiIssueID uint) (*fleet.MunkiIssue, error)
|
|
|
|
|
|
|
|
type GetMDMSolutionFunc func(ctx context.Context, mdmID uint) (*fleet.MDMSolution, error)
|
|
|
|
|
2022-08-22 19:34:00 +00:00
|
|
|
type OSVersionsFunc func(ctx context.Context, teamID *uint, platform *string, name *string, version *string) (*fleet.OSVersions, error)
|
2022-03-28 15:15:45 +00:00
|
|
|
|
|
|
|
type UpdateOSVersionsFunc func(ctx context.Context) 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
|
|
|
|
2022-03-08 16:27:38 +00:00
|
|
|
type FindPasswordResetByTokenFunc 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
|
|
|
|
Add read replica testing helpers and fix non-sso login bug (#4908)
not set on the INSERT.
- OUT: Only sets the ID on the passed session and returns it. (`CreatedAt`, `AccessedAt`, are not set.)
New version:
```go
func (ds *Datastore) NewSession(ctx context.Context, userID uint, sessionKey string) (*fleet.Session, error) {
sqlStatement := `
INSERT INTO sessions (
user_id,
` + "`key`" + `
)
VALUES(?,?)
`
result, err := ds.writer.ExecContext(ctx, sqlStatement, userID, sessionKey)
if err != nil {
return nil, ctxerr.Wrap(ctx, err, "inserting session")
}
id, _ := result.LastInsertId() // cannot fail with the mysql driver
return ds.sessionByID(ctx, ds.writer, uint(id))
}
```
- IN: Define arguments that are truly used when creating a session.
- OUT: Load and return the fleet.Session struct with all values set (using the `ds.writer` to support read replicas correctly).
PS: The new `NewSession` version mimics what we already do with other entities, like policies (`Datastore.NewGlobalPolicy`).
2022-04-04 23:52:05 +00:00
|
|
|
type NewSessionFunc func(ctx context.Context, userID uint, sessionKey string) (*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 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)
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
type ListScheduledQueriesInPackWithStatsFunc 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
|
|
|
|
2022-06-13 20:29:32 +00:00
|
|
|
type CleanupExpiredHostsFunc func(ctx context.Context) ([]uint, error)
|
2021-10-19 20:47:37 +00:00
|
|
|
|
2022-08-10 14:01:05 +00:00
|
|
|
type ScheduledQueryIDsByNameFunc func(ctx context.Context, batchSize int, packAndSchedQueryNames ...[2]string) ([]uint, 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
|
|
|
|
2022-01-13 19:57:44 +00:00
|
|
|
type TeamsSummaryFunc func(ctx context.Context) ([]*fleet.TeamSummary, error)
|
|
|
|
|
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
|
|
|
|
2022-06-13 14:04:47 +00:00
|
|
|
type DeleteIntegrationsFromTeamsFunc func(ctx context.Context, deletedIntgs fleet.Integrations) error
|
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
type ListSoftwareForVulnDetectionFunc func(ctx context.Context, hostID uint) ([]fleet.Software, error)
|
|
|
|
|
|
|
|
type ListSoftwareVulnerabilitiesFunc func(ctx context.Context, hostIDs []uint) (map[uint][]fleet.SoftwareVulnerability, error)
|
|
|
|
|
2022-06-01 16:06:57 +00:00
|
|
|
type LoadHostSoftwareFunc func(ctx context.Context, host *fleet.Host, includeCVEScores bool) error
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2022-08-04 13:24:44 +00:00
|
|
|
type AllSoftwareWithoutCPEIteratorFunc func(ctx context.Context, excludedPlatforms []string) (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
|
|
|
|
2022-08-24 17:10:58 +00:00
|
|
|
type ListSoftwareCPEsFunc func(ctx context.Context) ([]fleet.SoftwareCPE, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
type InsertVulnerabilitiesFunc func(ctx context.Context, vulns []fleet.SoftwareVulnerability, source fleet.VulnerabilitySource) (int64, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2022-05-20 16:58:40 +00:00
|
|
|
type SoftwareByIDFunc func(ctx context.Context, id uint, includeCVEScores bool) (*fleet.Software, error)
|
|
|
|
|
|
|
|
type ListSoftwareByHostIDShortFunc func(ctx context.Context, hostID uint) ([]fleet.Software, error)
|
2021-10-12 18:59:01 +00:00
|
|
|
|
2022-06-22 20:35:53 +00:00
|
|
|
type SyncHostsSoftwareFunc func(ctx context.Context, updatedAt time.Time) error
|
2022-01-26 14:47:56 +00:00
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
type HostsBySoftwareIDsFunc func(ctx context.Context, softwareIDs []uint) ([]*fleet.HostShort, error)
|
2022-04-11 20:42:16 +00:00
|
|
|
|
|
|
|
type HostsByCVEFunc func(ctx context.Context, cve string) ([]*fleet.HostShort, error)
|
2022-02-02 21:34:37 +00:00
|
|
|
|
2022-06-01 16:06:57 +00:00
|
|
|
type InsertCVEMetaFunc func(ctx context.Context, cveMeta []fleet.CVEMeta) error
|
2022-05-20 16:58:40 +00:00
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
type ListCVEsFunc func(ctx context.Context, maxAge time.Duration) ([]fleet.CVEMeta, error)
|
|
|
|
|
2022-08-09 18:34:41 +00:00
|
|
|
type ListOperatingSystemsFunc func(ctx context.Context) ([]fleet.OperatingSystem, error)
|
|
|
|
|
|
|
|
type UpdateHostOperatingSystemFunc func(ctx context.Context, hostID uint, hostOS fleet.OperatingSystem) error
|
|
|
|
|
2022-08-12 19:23:25 +00:00
|
|
|
type CleanupHostOperatingSystemsFunc func(ctx context.Context) 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
|
|
|
|
2022-07-21 01:54:10 +00:00
|
|
|
type ShouldSendStatisticsFunc func(ctx context.Context, frequency time.Duration, config config.FleetConfig, 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
|
|
|
|
2022-02-16 15:33:56 +00:00
|
|
|
type ApplyPolicySpecsFunc func(ctx context.Context, authorID uint, specs []*fleet.PolicySpec) error
|
|
|
|
|
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-09-14 12:11:07 +00:00
|
|
|
type ListGlobalPoliciesFunc func(ctx context.Context) ([]*fleet.Policy, error)
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2022-02-16 15:33:56 +00:00
|
|
|
type PoliciesByIDFunc func(ctx context.Context, ids []uint) (map[uint]*fleet.Policy, error)
|
|
|
|
|
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
|
|
|
|
2022-01-18 14:56:43 +00:00
|
|
|
type AsyncBatchInsertPolicyMembershipFunc func(ctx context.Context, batch []fleet.PolicyMembershipResult) error
|
|
|
|
|
|
|
|
type AsyncBatchUpdatePolicyTimestampFunc func(ctx context.Context, ids []uint, ts time.Time) error
|
|
|
|
|
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)
|
|
|
|
|
2022-06-23 20:44:45 +00:00
|
|
|
type DeleteSoftwareVulnerabilitiesFunc func(ctx context.Context, vulnerabilities []fleet.SoftwareVulnerability) error
|
2022-02-14 18:13:44 +00:00
|
|
|
|
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)
|
|
|
|
|
2022-02-23 21:10:37 +00:00
|
|
|
type CleanupPolicyMembershipFunc func(ctx context.Context, now time.Time) 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
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
type LoadHostByNodeKeyFunc func(ctx context.Context, nodeKey string) (*fleet.Host, error)
|
|
|
|
|
|
|
|
type HostLiteFunc func(ctx context.Context, hostID uint) (*fleet.Host, error)
|
|
|
|
|
|
|
|
type UpdateHostOsqueryIntervalsFunc func(ctx context.Context, hostID uint, intervals fleet.HostOsqueryIntervals) error
|
|
|
|
|
|
|
|
type TeamAgentOptionsFunc func(ctx context.Context, teamID uint) (*json.RawMessage, error)
|
|
|
|
|
2022-08-30 11:13:09 +00:00
|
|
|
type TeamFeaturesFunc func(ctx context.Context, teamID uint) (*fleet.Features, error)
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
type SaveHostPackStatsFunc func(ctx context.Context, hostID uint, stats []fleet.PackStats) error
|
|
|
|
|
2022-08-10 14:01:05 +00:00
|
|
|
type AsyncBatchSaveHostsScheduledQueryStatsFunc func(ctx context.Context, stats map[uint][]fleet.ScheduledQueryStats, batchSize int) (int, error)
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
type UpdateHostSoftwareFunc func(ctx context.Context, hostID uint, software []fleet.Software) error
|
|
|
|
|
|
|
|
type UpdateHostFunc func(ctx context.Context, host *fleet.Host) error
|
|
|
|
|
|
|
|
type ListScheduledQueriesInPackFunc func(ctx context.Context, packID uint) ([]*fleet.ScheduledQuery, error)
|
|
|
|
|
|
|
|
type UpdateHostRefetchRequestedFunc func(ctx context.Context, hostID uint, value bool) error
|
|
|
|
|
|
|
|
type FlippingPoliciesForHostFunc func(ctx context.Context, hostID uint, incomingResults map[uint]*bool) (newFailing []uint, newPassing []uint, err error)
|
|
|
|
|
|
|
|
type RecordPolicyQueryExecutionsFunc func(ctx context.Context, host *fleet.Host, results map[uint]*bool, updated time.Time, deferredSaveHost bool) error
|
|
|
|
|
|
|
|
type RecordLabelQueryExecutionsFunc func(ctx context.Context, host *fleet.Host, results map[uint]*bool, t time.Time, deferredSaveHost bool) error
|
|
|
|
|
|
|
|
type SaveHostUsersFunc func(ctx context.Context, hostID uint, users []fleet.HostUser) error
|
|
|
|
|
|
|
|
type SaveHostAdditionalFunc func(ctx context.Context, hostID uint, additional *json.RawMessage) error
|
|
|
|
|
2022-08-29 18:40:16 +00:00
|
|
|
type SetOrUpdateMunkiInfoFunc func(ctx context.Context, hostID uint, version string, errors []string, warnings []string) error
|
2022-01-18 01:52:09 +00:00
|
|
|
|
|
|
|
type SetOrUpdateMDMDataFunc func(ctx context.Context, hostID uint, enrolled bool, serverURL string, installedFromDep bool) error
|
|
|
|
|
|
|
|
type ReplaceHostDeviceMappingFunc func(ctx context.Context, id uint, mappings []*fleet.HostDeviceMapping) error
|
|
|
|
|
2022-06-28 18:11:49 +00:00
|
|
|
type ReplaceHostBatteriesFunc func(ctx context.Context, id uint, mappings []*fleet.HostBattery) error
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
type VerifyEnrollSecretFunc func(ctx context.Context, secret string) (*fleet.EnrollSecret, error)
|
|
|
|
|
|
|
|
type EnrollHostFunc func(ctx context.Context, osqueryHostId string, nodeKey string, teamID *uint, cooldown time.Duration) (*fleet.Host, error)
|
|
|
|
|
|
|
|
type SerialUpdateHostFunc func(ctx context.Context, host *fleet.Host) error
|
|
|
|
|
2022-04-05 16:56:15 +00:00
|
|
|
type NewJobFunc func(ctx context.Context, job *fleet.Job) (*fleet.Job, error)
|
|
|
|
|
|
|
|
type GetQueuedJobsFunc func(ctx context.Context, maxNumJobs int) ([]*fleet.Job, error)
|
|
|
|
|
|
|
|
type UpdateJobFunc func(ctx context.Context, id uint, job *fleet.Job) (*fleet.Job, error)
|
|
|
|
|
2022-02-03 17:56:22 +00:00
|
|
|
type InnoDBStatusFunc func(ctx context.Context) (string, error)
|
|
|
|
|
|
|
|
type ProcessListFunc func(ctx context.Context) ([]fleet.MySQLProcess, error)
|
|
|
|
|
2022-08-26 18:55:03 +00:00
|
|
|
type InsertWindowsUpdatesFunc func(ctx context.Context, hostID uint, updates []fleet.WindowsUpdate) error
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
type DataStore struct {
|
2022-07-01 11:08:03 +00:00
|
|
|
HealthCheckFunc HealthCheckFunc
|
|
|
|
HealthCheckFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
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
|
|
|
|
|
2022-06-10 18:29:45 +00:00
|
|
|
ObserverCanRunQueryFunc ObserverCanRunQueryFunc
|
|
|
|
ObserverCanRunQueryFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
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
|
|
|
|
|
2022-05-10 15:32:55 +00:00
|
|
|
LabelsSummaryFunc LabelsSummaryFunc
|
|
|
|
LabelsSummaryFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
LabelQueriesForHostFunc LabelQueriesForHostFunc
|
|
|
|
LabelQueriesForHostFuncInvoked 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
|
|
|
|
|
|
|
|
DeleteHostFunc DeleteHostFunc
|
|
|
|
DeleteHostFuncInvoked bool
|
|
|
|
|
|
|
|
HostFunc HostFunc
|
|
|
|
HostFuncInvoked bool
|
|
|
|
|
|
|
|
ListHostsFunc ListHostsFunc
|
|
|
|
ListHostsFuncInvoked bool
|
|
|
|
|
|
|
|
MarkHostsSeenFunc MarkHostsSeenFunc
|
|
|
|
MarkHostsSeenFuncInvoked bool
|
|
|
|
|
|
|
|
SearchHostsFunc SearchHostsFunc
|
|
|
|
SearchHostsFuncInvoked bool
|
|
|
|
|
2022-06-13 20:29:32 +00:00
|
|
|
EnrolledHostIDsFunc EnrolledHostIDsFunc
|
|
|
|
EnrolledHostIDsFuncInvoked bool
|
|
|
|
|
|
|
|
CountEnrolledHostsFunc CountEnrolledHostsFunc
|
|
|
|
CountEnrolledHostsFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
CleanupIncomingHostsFunc CleanupIncomingHostsFunc
|
|
|
|
CleanupIncomingHostsFuncInvoked bool
|
|
|
|
|
|
|
|
GenerateHostStatusStatisticsFunc GenerateHostStatusStatisticsFunc
|
|
|
|
GenerateHostStatusStatisticsFuncInvoked bool
|
|
|
|
|
|
|
|
HostIDsByNameFunc HostIDsByNameFunc
|
|
|
|
HostIDsByNameFuncInvoked bool
|
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
HostIDsByOSVersionFunc HostIDsByOSVersionFunc
|
|
|
|
HostIDsByOSVersionFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
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
|
|
|
|
|
2022-06-28 18:11:49 +00:00
|
|
|
ListHostBatteriesFunc ListHostBatteriesFunc
|
|
|
|
ListHostBatteriesFuncInvoked bool
|
|
|
|
|
2022-03-09 21:13:56 +00:00
|
|
|
LoadHostByDeviceAuthTokenFunc LoadHostByDeviceAuthTokenFunc
|
|
|
|
LoadHostByDeviceAuthTokenFuncInvoked bool
|
|
|
|
|
2022-03-15 19:51:00 +00:00
|
|
|
SetOrUpdateDeviceAuthTokenFunc SetOrUpdateDeviceAuthTokenFunc
|
|
|
|
SetOrUpdateDeviceAuthTokenFuncInvoked bool
|
|
|
|
|
2022-09-12 19:37:38 +00:00
|
|
|
FailingPoliciesCountFunc FailingPoliciesCountFunc
|
|
|
|
FailingPoliciesCountFuncInvoked bool
|
|
|
|
|
2021-10-07 11:11:10 +00:00
|
|
|
ListPoliciesForHostFunc ListPoliciesForHostFunc
|
|
|
|
ListPoliciesForHostFuncInvoked bool
|
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
GetHostMunkiVersionFunc GetHostMunkiVersionFunc
|
|
|
|
GetHostMunkiVersionFuncInvoked bool
|
2021-12-21 12:37:58 +00:00
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
GetHostMunkiIssuesFunc GetHostMunkiIssuesFunc
|
|
|
|
GetHostMunkiIssuesFuncInvoked bool
|
2022-08-29 18:40:16 +00:00
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
GetHostMDMFunc GetHostMDMFunc
|
|
|
|
GetHostMDMFuncInvoked bool
|
2021-12-21 12:37:58 +00:00
|
|
|
|
2022-01-26 20:55:07 +00:00
|
|
|
AggregatedMunkiVersionFunc AggregatedMunkiVersionFunc
|
|
|
|
AggregatedMunkiVersionFuncInvoked bool
|
|
|
|
|
2022-08-29 18:40:16 +00:00
|
|
|
AggregatedMunkiIssuesFunc AggregatedMunkiIssuesFunc
|
|
|
|
AggregatedMunkiIssuesFuncInvoked bool
|
|
|
|
|
2022-01-26 20:55:07 +00:00
|
|
|
AggregatedMDMStatusFunc AggregatedMDMStatusFunc
|
|
|
|
AggregatedMDMStatusFuncInvoked bool
|
|
|
|
|
2022-08-10 19:15:01 +00:00
|
|
|
AggregatedMDMSolutionsFunc AggregatedMDMSolutionsFunc
|
|
|
|
AggregatedMDMSolutionsFuncInvoked bool
|
|
|
|
|
2022-01-26 20:55:07 +00:00
|
|
|
GenerateAggregatedMunkiAndMDMFunc GenerateAggregatedMunkiAndMDMFunc
|
|
|
|
GenerateAggregatedMunkiAndMDMFuncInvoked bool
|
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
GetMunkiIssueFunc GetMunkiIssueFunc
|
|
|
|
GetMunkiIssueFuncInvoked bool
|
|
|
|
|
|
|
|
GetMDMSolutionFunc GetMDMSolutionFunc
|
|
|
|
GetMDMSolutionFuncInvoked bool
|
|
|
|
|
2022-03-28 15:15:45 +00:00
|
|
|
OSVersionsFunc OSVersionsFunc
|
|
|
|
OSVersionsFuncInvoked bool
|
|
|
|
|
|
|
|
UpdateOSVersionsFunc UpdateOSVersionsFunc
|
|
|
|
UpdateOSVersionsFuncInvoked 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
|
|
|
|
|
2022-03-08 16:27:38 +00:00
|
|
|
FindPasswordResetByTokenFunc FindPasswordResetByTokenFunc
|
|
|
|
FindPasswordResetByTokenFuncInvoked bool
|
2021-08-24 21:49:56 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
ListScheduledQueriesInPackWithStatsFunc ListScheduledQueriesInPackWithStatsFunc
|
|
|
|
ListScheduledQueriesInPackWithStatsFuncInvoked bool
|
2021-08-24 21:49:56 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-08-10 14:01:05 +00:00
|
|
|
ScheduledQueryIDsByNameFunc ScheduledQueryIDsByNameFunc
|
|
|
|
ScheduledQueryIDsByNameFuncInvoked 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
|
|
|
|
|
2022-01-13 19:57:44 +00:00
|
|
|
TeamsSummaryFunc TeamsSummaryFunc
|
|
|
|
TeamsSummaryFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
SearchTeamsFunc SearchTeamsFunc
|
|
|
|
SearchTeamsFuncInvoked bool
|
|
|
|
|
|
|
|
TeamEnrollSecretsFunc TeamEnrollSecretsFunc
|
|
|
|
TeamEnrollSecretsFuncInvoked bool
|
|
|
|
|
2022-06-13 14:04:47 +00:00
|
|
|
DeleteIntegrationsFromTeamsFunc DeleteIntegrationsFromTeamsFunc
|
|
|
|
DeleteIntegrationsFromTeamsFuncInvoked bool
|
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
ListSoftwareForVulnDetectionFunc ListSoftwareForVulnDetectionFunc
|
|
|
|
ListSoftwareForVulnDetectionFuncInvoked bool
|
|
|
|
|
|
|
|
ListSoftwareVulnerabilitiesFunc ListSoftwareVulnerabilitiesFunc
|
|
|
|
ListSoftwareVulnerabilitiesFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
LoadHostSoftwareFunc LoadHostSoftwareFunc
|
|
|
|
LoadHostSoftwareFuncInvoked bool
|
|
|
|
|
|
|
|
AllSoftwareWithoutCPEIteratorFunc AllSoftwareWithoutCPEIteratorFunc
|
|
|
|
AllSoftwareWithoutCPEIteratorFuncInvoked bool
|
|
|
|
|
|
|
|
AddCPEForSoftwareFunc AddCPEForSoftwareFunc
|
|
|
|
AddCPEForSoftwareFuncInvoked bool
|
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
ListSoftwareCPEsFunc ListSoftwareCPEsFunc
|
|
|
|
ListSoftwareCPEsFuncInvoked bool
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
InsertVulnerabilitiesFunc InsertVulnerabilitiesFunc
|
|
|
|
InsertVulnerabilitiesFuncInvoked bool
|
2021-08-24 21:49:56 +00:00
|
|
|
|
2021-10-12 18:59:01 +00:00
|
|
|
SoftwareByIDFunc SoftwareByIDFunc
|
|
|
|
SoftwareByIDFuncInvoked bool
|
|
|
|
|
2022-05-20 16:58:40 +00:00
|
|
|
ListSoftwareByHostIDShortFunc ListSoftwareByHostIDShortFunc
|
|
|
|
ListSoftwareByHostIDShortFuncInvoked bool
|
|
|
|
|
2022-06-22 20:35:53 +00:00
|
|
|
SyncHostsSoftwareFunc SyncHostsSoftwareFunc
|
|
|
|
SyncHostsSoftwareFuncInvoked bool
|
2022-01-26 14:47:56 +00:00
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
HostsBySoftwareIDsFunc HostsBySoftwareIDsFunc
|
|
|
|
HostsBySoftwareIDsFuncInvoked bool
|
2022-02-02 21:34:37 +00:00
|
|
|
|
2022-04-11 20:42:16 +00:00
|
|
|
HostsByCVEFunc HostsByCVEFunc
|
|
|
|
HostsByCVEFuncInvoked bool
|
|
|
|
|
2022-06-01 16:06:57 +00:00
|
|
|
InsertCVEMetaFunc InsertCVEMetaFunc
|
|
|
|
InsertCVEMetaFuncInvoked bool
|
2022-05-20 16:58:40 +00:00
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
ListCVEsFunc ListCVEsFunc
|
|
|
|
ListCVEsFuncInvoked bool
|
|
|
|
|
2022-08-09 18:34:41 +00:00
|
|
|
ListOperatingSystemsFunc ListOperatingSystemsFunc
|
|
|
|
ListOperatingSystemsFuncInvoked bool
|
|
|
|
|
|
|
|
UpdateHostOperatingSystemFunc UpdateHostOperatingSystemFunc
|
|
|
|
UpdateHostOperatingSystemFuncInvoked bool
|
|
|
|
|
2022-08-12 19:23:25 +00:00
|
|
|
CleanupHostOperatingSystemsFunc CleanupHostOperatingSystemsFunc
|
|
|
|
CleanupHostOperatingSystemsFuncInvoked 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
|
|
|
|
|
2022-02-16 15:33:56 +00:00
|
|
|
ApplyPolicySpecsFunc ApplyPolicySpecsFunc
|
|
|
|
ApplyPolicySpecsFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
NewGlobalPolicyFunc NewGlobalPolicyFunc
|
|
|
|
NewGlobalPolicyFuncInvoked bool
|
|
|
|
|
|
|
|
PolicyFunc PolicyFunc
|
|
|
|
PolicyFuncInvoked bool
|
|
|
|
|
2021-11-24 17:16:42 +00:00
|
|
|
SavePolicyFunc SavePolicyFunc
|
|
|
|
SavePolicyFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
ListGlobalPoliciesFunc ListGlobalPoliciesFunc
|
|
|
|
ListGlobalPoliciesFuncInvoked bool
|
|
|
|
|
2022-02-16 15:33:56 +00:00
|
|
|
PoliciesByIDFunc PoliciesByIDFunc
|
|
|
|
PoliciesByIDFuncInvoked bool
|
|
|
|
|
2021-08-24 21:49:56 +00:00
|
|
|
DeleteGlobalPoliciesFunc DeleteGlobalPoliciesFunc
|
|
|
|
DeleteGlobalPoliciesFuncInvoked bool
|
|
|
|
|
|
|
|
PolicyQueriesForHostFunc PolicyQueriesForHostFunc
|
|
|
|
PolicyQueriesForHostFuncInvoked bool
|
|
|
|
|
2022-01-18 14:56:43 +00:00
|
|
|
AsyncBatchInsertPolicyMembershipFunc AsyncBatchInsertPolicyMembershipFunc
|
|
|
|
AsyncBatchInsertPolicyMembershipFuncInvoked bool
|
|
|
|
|
|
|
|
AsyncBatchUpdatePolicyTimestampFunc AsyncBatchUpdatePolicyTimestampFunc
|
|
|
|
AsyncBatchUpdatePolicyTimestampFuncInvoked 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
|
|
|
|
|
2022-06-23 20:44:45 +00:00
|
|
|
DeleteSoftwareVulnerabilitiesFunc DeleteSoftwareVulnerabilitiesFunc
|
|
|
|
DeleteSoftwareVulnerabilitiesFuncInvoked bool
|
2022-02-14 18:13:44 +00:00
|
|
|
|
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
|
|
|
|
2022-02-23 21:10:37 +00:00
|
|
|
CleanupPolicyMembershipFunc CleanupPolicyMembershipFunc
|
|
|
|
CleanupPolicyMembershipFuncInvoked 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
|
2022-01-18 01:52:09 +00:00
|
|
|
|
|
|
|
LoadHostByNodeKeyFunc LoadHostByNodeKeyFunc
|
|
|
|
LoadHostByNodeKeyFuncInvoked bool
|
|
|
|
|
|
|
|
HostLiteFunc HostLiteFunc
|
|
|
|
HostLiteFuncInvoked bool
|
|
|
|
|
|
|
|
UpdateHostOsqueryIntervalsFunc UpdateHostOsqueryIntervalsFunc
|
|
|
|
UpdateHostOsqueryIntervalsFuncInvoked bool
|
|
|
|
|
|
|
|
TeamAgentOptionsFunc TeamAgentOptionsFunc
|
|
|
|
TeamAgentOptionsFuncInvoked bool
|
|
|
|
|
2022-08-30 11:13:09 +00:00
|
|
|
TeamFeaturesFunc TeamFeaturesFunc
|
|
|
|
TeamFeaturesFuncInvoked bool
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
SaveHostPackStatsFunc SaveHostPackStatsFunc
|
|
|
|
SaveHostPackStatsFuncInvoked bool
|
|
|
|
|
2022-08-10 14:01:05 +00:00
|
|
|
AsyncBatchSaveHostsScheduledQueryStatsFunc AsyncBatchSaveHostsScheduledQueryStatsFunc
|
|
|
|
AsyncBatchSaveHostsScheduledQueryStatsFuncInvoked bool
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
UpdateHostSoftwareFunc UpdateHostSoftwareFunc
|
|
|
|
UpdateHostSoftwareFuncInvoked bool
|
|
|
|
|
|
|
|
UpdateHostFunc UpdateHostFunc
|
|
|
|
UpdateHostFuncInvoked bool
|
|
|
|
|
|
|
|
ListScheduledQueriesInPackFunc ListScheduledQueriesInPackFunc
|
|
|
|
ListScheduledQueriesInPackFuncInvoked bool
|
|
|
|
|
|
|
|
UpdateHostRefetchRequestedFunc UpdateHostRefetchRequestedFunc
|
|
|
|
UpdateHostRefetchRequestedFuncInvoked bool
|
|
|
|
|
|
|
|
FlippingPoliciesForHostFunc FlippingPoliciesForHostFunc
|
|
|
|
FlippingPoliciesForHostFuncInvoked bool
|
|
|
|
|
|
|
|
RecordPolicyQueryExecutionsFunc RecordPolicyQueryExecutionsFunc
|
|
|
|
RecordPolicyQueryExecutionsFuncInvoked bool
|
|
|
|
|
|
|
|
RecordLabelQueryExecutionsFunc RecordLabelQueryExecutionsFunc
|
|
|
|
RecordLabelQueryExecutionsFuncInvoked bool
|
|
|
|
|
|
|
|
SaveHostUsersFunc SaveHostUsersFunc
|
|
|
|
SaveHostUsersFuncInvoked bool
|
|
|
|
|
|
|
|
SaveHostAdditionalFunc SaveHostAdditionalFunc
|
|
|
|
SaveHostAdditionalFuncInvoked bool
|
|
|
|
|
2022-08-29 18:40:16 +00:00
|
|
|
SetOrUpdateMunkiInfoFunc SetOrUpdateMunkiInfoFunc
|
|
|
|
SetOrUpdateMunkiInfoFuncInvoked bool
|
2022-01-18 01:52:09 +00:00
|
|
|
|
|
|
|
SetOrUpdateMDMDataFunc SetOrUpdateMDMDataFunc
|
|
|
|
SetOrUpdateMDMDataFuncInvoked bool
|
|
|
|
|
|
|
|
ReplaceHostDeviceMappingFunc ReplaceHostDeviceMappingFunc
|
|
|
|
ReplaceHostDeviceMappingFuncInvoked bool
|
|
|
|
|
2022-06-28 18:11:49 +00:00
|
|
|
ReplaceHostBatteriesFunc ReplaceHostBatteriesFunc
|
|
|
|
ReplaceHostBatteriesFuncInvoked bool
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
VerifyEnrollSecretFunc VerifyEnrollSecretFunc
|
|
|
|
VerifyEnrollSecretFuncInvoked bool
|
|
|
|
|
|
|
|
EnrollHostFunc EnrollHostFunc
|
|
|
|
EnrollHostFuncInvoked bool
|
|
|
|
|
|
|
|
SerialUpdateHostFunc SerialUpdateHostFunc
|
|
|
|
SerialUpdateHostFuncInvoked bool
|
2022-02-03 17:56:22 +00:00
|
|
|
|
2022-04-05 16:56:15 +00:00
|
|
|
NewJobFunc NewJobFunc
|
|
|
|
NewJobFuncInvoked bool
|
|
|
|
|
|
|
|
GetQueuedJobsFunc GetQueuedJobsFunc
|
|
|
|
GetQueuedJobsFuncInvoked bool
|
|
|
|
|
|
|
|
UpdateJobFunc UpdateJobFunc
|
|
|
|
UpdateJobFuncInvoked bool
|
|
|
|
|
2022-02-03 17:56:22 +00:00
|
|
|
InnoDBStatusFunc InnoDBStatusFunc
|
|
|
|
InnoDBStatusFuncInvoked bool
|
|
|
|
|
|
|
|
ProcessListFunc ProcessListFunc
|
|
|
|
ProcessListFuncInvoked bool
|
2022-08-26 18:55:03 +00:00
|
|
|
|
|
|
|
InsertWindowsUpdatesFunc InsertWindowsUpdatesFunc
|
|
|
|
InsertWindowsUpdatesFuncInvoked bool
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2022-07-01 11:08:03 +00:00
|
|
|
func (s *DataStore) HealthCheck() error {
|
|
|
|
s.HealthCheckFuncInvoked = true
|
|
|
|
return s.HealthCheckFunc()
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-06-10 18:29:45 +00:00
|
|
|
func (s *DataStore) ObserverCanRunQuery(ctx context.Context, queryID uint) (bool, error) {
|
|
|
|
s.ObserverCanRunQueryFuncInvoked = true
|
|
|
|
return s.ObserverCanRunQueryFunc(ctx, queryID)
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-05-10 15:32:55 +00:00
|
|
|
func (s *DataStore) LabelsSummary(ctx context.Context) ([]*fleet.LabelSummary, error) {
|
|
|
|
s.LabelsSummaryFuncInvoked = true
|
|
|
|
return s.LabelsSummaryFunc(ctx)
|
|
|
|
}
|
|
|
|
|
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-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) 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
|
|
|
}
|
|
|
|
|
2022-05-25 16:30:03 +00:00
|
|
|
func (s *DataStore) Host(ctx context.Context, id uint) (*fleet.Host, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.HostFuncInvoked = true
|
2022-05-25 16:30:03 +00:00
|
|
|
return s.HostFunc(ctx, id)
|
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) 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
|
|
|
}
|
|
|
|
|
2022-06-13 20:29:32 +00:00
|
|
|
func (s *DataStore) EnrolledHostIDs(ctx context.Context) ([]uint, error) {
|
|
|
|
s.EnrolledHostIDsFuncInvoked = true
|
|
|
|
return s.EnrolledHostIDsFunc(ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) CountEnrolledHosts(ctx context.Context) (int, error) {
|
|
|
|
s.CountEnrolledHostsFuncInvoked = true
|
|
|
|
return s.CountEnrolledHostsFunc(ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) CleanupIncomingHosts(ctx context.Context, now time.Time) ([]uint, 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
|
|
|
}
|
|
|
|
|
2022-01-24 17:49:21 +00:00
|
|
|
func (s *DataStore) GenerateHostStatusStatistics(ctx context.Context, filter fleet.TeamFilter, now time.Time, platform *string) (*fleet.HostSummary, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.GenerateHostStatusStatisticsFuncInvoked = true
|
2022-01-24 17:49:21 +00:00
|
|
|
return s.GenerateHostStatusStatisticsFunc(ctx, filter, now, platform)
|
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
|
|
|
}
|
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
func (s *DataStore) HostIDsByOSVersion(ctx context.Context, osVersion fleet.OSVersion, offset int, limit int) ([]uint, error) {
|
|
|
|
s.HostIDsByOSVersionFuncInvoked = true
|
|
|
|
return s.HostIDsByOSVersionFunc(ctx, osVersion, offset, limit)
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2022-06-28 18:11:49 +00:00
|
|
|
func (s *DataStore) ListHostBatteries(ctx context.Context, id uint) ([]*fleet.HostBattery, error) {
|
|
|
|
s.ListHostBatteriesFuncInvoked = true
|
|
|
|
return s.ListHostBatteriesFunc(ctx, id)
|
|
|
|
}
|
|
|
|
|
2022-09-08 18:04:02 +00:00
|
|
|
func (s *DataStore) LoadHostByDeviceAuthToken(ctx context.Context, authToken string) (*fleet.Host, error) {
|
2022-03-09 21:13:56 +00:00
|
|
|
s.LoadHostByDeviceAuthTokenFuncInvoked = true
|
2022-09-08 18:04:02 +00:00
|
|
|
return s.LoadHostByDeviceAuthTokenFunc(ctx, authToken)
|
2022-03-09 21:13:56 +00:00
|
|
|
}
|
|
|
|
|
2022-03-15 19:51:00 +00:00
|
|
|
func (s *DataStore) SetOrUpdateDeviceAuthToken(ctx context.Context, hostID uint, authToken string) error {
|
|
|
|
s.SetOrUpdateDeviceAuthTokenFuncInvoked = true
|
|
|
|
return s.SetOrUpdateDeviceAuthTokenFunc(ctx, hostID, authToken)
|
|
|
|
}
|
|
|
|
|
2022-09-12 19:37:38 +00:00
|
|
|
func (s *DataStore) FailingPoliciesCount(ctx context.Context, host *fleet.Host) (uint, error) {
|
|
|
|
s.FailingPoliciesCountFuncInvoked = true
|
|
|
|
return s.FailingPoliciesCountFunc(ctx, host)
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
func (s *DataStore) GetHostMunkiVersion(ctx context.Context, hostID uint) (string, error) {
|
|
|
|
s.GetHostMunkiVersionFuncInvoked = true
|
|
|
|
return s.GetHostMunkiVersionFunc(ctx, hostID)
|
2021-12-21 12:37:58 +00:00
|
|
|
}
|
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
func (s *DataStore) GetHostMunkiIssues(ctx context.Context, hostID uint) ([]*fleet.HostMunkiIssue, error) {
|
|
|
|
s.GetHostMunkiIssuesFuncInvoked = true
|
|
|
|
return s.GetHostMunkiIssuesFunc(ctx, hostID)
|
2022-08-29 18:40:16 +00:00
|
|
|
}
|
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
func (s *DataStore) GetHostMDM(ctx context.Context, hostID uint) (*fleet.HostMDM, error) {
|
|
|
|
s.GetHostMDMFuncInvoked = true
|
|
|
|
return s.GetHostMDMFunc(ctx, hostID)
|
2021-12-21 12:37:58 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 17:53:33 +00:00
|
|
|
func (s *DataStore) AggregatedMunkiVersion(ctx context.Context, teamID *uint) ([]fleet.AggregatedMunkiVersion, time.Time, error) {
|
2022-01-26 20:55:07 +00:00
|
|
|
s.AggregatedMunkiVersionFuncInvoked = true
|
|
|
|
return s.AggregatedMunkiVersionFunc(ctx, teamID)
|
|
|
|
}
|
|
|
|
|
2022-08-29 18:40:16 +00:00
|
|
|
func (s *DataStore) AggregatedMunkiIssues(ctx context.Context, teamID *uint) ([]fleet.AggregatedMunkiIssue, time.Time, error) {
|
|
|
|
s.AggregatedMunkiIssuesFuncInvoked = true
|
|
|
|
return s.AggregatedMunkiIssuesFunc(ctx, teamID)
|
|
|
|
}
|
|
|
|
|
2022-02-07 17:53:33 +00:00
|
|
|
func (s *DataStore) AggregatedMDMStatus(ctx context.Context, teamID *uint) (fleet.AggregatedMDMStatus, time.Time, error) {
|
2022-01-26 20:55:07 +00:00
|
|
|
s.AggregatedMDMStatusFuncInvoked = true
|
|
|
|
return s.AggregatedMDMStatusFunc(ctx, teamID)
|
|
|
|
}
|
|
|
|
|
2022-08-10 19:15:01 +00:00
|
|
|
func (s *DataStore) AggregatedMDMSolutions(ctx context.Context, teamID *uint) ([]fleet.AggregatedMDMSolutions, time.Time, error) {
|
|
|
|
s.AggregatedMDMSolutionsFuncInvoked = true
|
|
|
|
return s.AggregatedMDMSolutionsFunc(ctx, teamID)
|
|
|
|
}
|
|
|
|
|
2022-01-26 20:55:07 +00:00
|
|
|
func (s *DataStore) GenerateAggregatedMunkiAndMDM(ctx context.Context) error {
|
|
|
|
s.GenerateAggregatedMunkiAndMDMFuncInvoked = true
|
|
|
|
return s.GenerateAggregatedMunkiAndMDMFunc(ctx)
|
|
|
|
}
|
|
|
|
|
2022-09-06 14:34:06 +00:00
|
|
|
func (s *DataStore) GetMunkiIssue(ctx context.Context, munkiIssueID uint) (*fleet.MunkiIssue, error) {
|
|
|
|
s.GetMunkiIssueFuncInvoked = true
|
|
|
|
return s.GetMunkiIssueFunc(ctx, munkiIssueID)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) GetMDMSolution(ctx context.Context, mdmID uint) (*fleet.MDMSolution, error) {
|
|
|
|
s.GetMDMSolutionFuncInvoked = true
|
|
|
|
return s.GetMDMSolutionFunc(ctx, mdmID)
|
|
|
|
}
|
|
|
|
|
2022-08-22 19:34:00 +00:00
|
|
|
func (s *DataStore) OSVersions(ctx context.Context, teamID *uint, platform *string, name *string, version *string) (*fleet.OSVersions, error) {
|
2022-03-28 15:15:45 +00:00
|
|
|
s.OSVersionsFuncInvoked = true
|
2022-08-22 19:34:00 +00:00
|
|
|
return s.OSVersionsFunc(ctx, teamID, platform, name, version)
|
2022-03-28 15:15:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) UpdateOSVersions(ctx context.Context) error {
|
|
|
|
s.UpdateOSVersionsFuncInvoked = true
|
|
|
|
return s.UpdateOSVersionsFunc(ctx)
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-03-08 16:27:38 +00:00
|
|
|
func (s *DataStore) FindPasswordResetByToken(ctx context.Context, token string) (*fleet.PasswordResetRequest, error) {
|
|
|
|
s.FindPasswordResetByTokenFuncInvoked = true
|
|
|
|
return s.FindPasswordResetByTokenFunc(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
|
|
|
}
|
|
|
|
|
Add read replica testing helpers and fix non-sso login bug (#4908)
not set on the INSERT.
- OUT: Only sets the ID on the passed session and returns it. (`CreatedAt`, `AccessedAt`, are not set.)
New version:
```go
func (ds *Datastore) NewSession(ctx context.Context, userID uint, sessionKey string) (*fleet.Session, error) {
sqlStatement := `
INSERT INTO sessions (
user_id,
` + "`key`" + `
)
VALUES(?,?)
`
result, err := ds.writer.ExecContext(ctx, sqlStatement, userID, sessionKey)
if err != nil {
return nil, ctxerr.Wrap(ctx, err, "inserting session")
}
id, _ := result.LastInsertId() // cannot fail with the mysql driver
return ds.sessionByID(ctx, ds.writer, uint(id))
}
```
- IN: Define arguments that are truly used when creating a session.
- OUT: Load and return the fleet.Session struct with all values set (using the `ds.writer` to support read replicas correctly).
PS: The new `NewSession` version mimics what we already do with other entities, like policies (`Datastore.NewGlobalPolicy`).
2022-04-04 23:52:05 +00:00
|
|
|
func (s *DataStore) NewSession(ctx context.Context, userID uint, sessionKey string) (*fleet.Session, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.NewSessionFuncInvoked = true
|
Add read replica testing helpers and fix non-sso login bug (#4908)
not set on the INSERT.
- OUT: Only sets the ID on the passed session and returns it. (`CreatedAt`, `AccessedAt`, are not set.)
New version:
```go
func (ds *Datastore) NewSession(ctx context.Context, userID uint, sessionKey string) (*fleet.Session, error) {
sqlStatement := `
INSERT INTO sessions (
user_id,
` + "`key`" + `
)
VALUES(?,?)
`
result, err := ds.writer.ExecContext(ctx, sqlStatement, userID, sessionKey)
if err != nil {
return nil, ctxerr.Wrap(ctx, err, "inserting session")
}
id, _ := result.LastInsertId() // cannot fail with the mysql driver
return ds.sessionByID(ctx, ds.writer, uint(id))
}
```
- IN: Define arguments that are truly used when creating a session.
- OUT: Load and return the fleet.Session struct with all values set (using the `ds.writer` to support read replicas correctly).
PS: The new `NewSession` version mimics what we already do with other entities, like policies (`Datastore.NewGlobalPolicy`).
2022-04-04 23:52:05 +00:00
|
|
|
return s.NewSessionFunc(ctx, userID, sessionKey)
|
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) 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)
|
|
|
|
}
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
func (s *DataStore) ListScheduledQueriesInPackWithStats(ctx context.Context, id uint, opts fleet.ListOptions) ([]*fleet.ScheduledQuery, error) {
|
|
|
|
s.ListScheduledQueriesInPackWithStatsFuncInvoked = true
|
|
|
|
return s.ListScheduledQueriesInPackWithStatsFunc(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
|
|
|
}
|
|
|
|
|
2022-06-13 20:29:32 +00:00
|
|
|
func (s *DataStore) CleanupExpiredHosts(ctx context.Context) ([]uint, error) {
|
2021-10-19 20:47:37 +00:00
|
|
|
s.CleanupExpiredHostsFuncInvoked = true
|
|
|
|
return s.CleanupExpiredHostsFunc(ctx)
|
|
|
|
}
|
|
|
|
|
2022-08-10 14:01:05 +00:00
|
|
|
func (s *DataStore) ScheduledQueryIDsByName(ctx context.Context, batchSize int, packAndSchedQueryNames ...[2]string) ([]uint, error) {
|
|
|
|
s.ScheduledQueryIDsByNameFuncInvoked = true
|
|
|
|
return s.ScheduledQueryIDsByNameFunc(ctx, batchSize, packAndSchedQueryNames...)
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-01-13 19:57:44 +00:00
|
|
|
func (s *DataStore) TeamsSummary(ctx context.Context) ([]*fleet.TeamSummary, error) {
|
|
|
|
s.TeamsSummaryFuncInvoked = true
|
|
|
|
return s.TeamsSummaryFunc(ctx)
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-06-13 14:04:47 +00:00
|
|
|
func (s *DataStore) DeleteIntegrationsFromTeams(ctx context.Context, deletedIntgs fleet.Integrations) error {
|
|
|
|
s.DeleteIntegrationsFromTeamsFuncInvoked = true
|
|
|
|
return s.DeleteIntegrationsFromTeamsFunc(ctx, deletedIntgs)
|
|
|
|
}
|
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
func (s *DataStore) ListSoftwareForVulnDetection(ctx context.Context, hostID uint) ([]fleet.Software, error) {
|
|
|
|
s.ListSoftwareForVulnDetectionFuncInvoked = true
|
|
|
|
return s.ListSoftwareForVulnDetectionFunc(ctx, hostID)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) ListSoftwareVulnerabilities(ctx context.Context, hostIDs []uint) (map[uint][]fleet.SoftwareVulnerability, error) {
|
|
|
|
s.ListSoftwareVulnerabilitiesFuncInvoked = true
|
|
|
|
return s.ListSoftwareVulnerabilitiesFunc(ctx, hostIDs)
|
|
|
|
}
|
|
|
|
|
2022-06-01 16:06:57 +00:00
|
|
|
func (s *DataStore) LoadHostSoftware(ctx context.Context, host *fleet.Host, includeCVEScores bool) error {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.LoadHostSoftwareFuncInvoked = true
|
2022-06-01 16:06:57 +00:00
|
|
|
return s.LoadHostSoftwareFunc(ctx, host, includeCVEScores)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2022-08-04 13:24:44 +00:00
|
|
|
func (s *DataStore) AllSoftwareWithoutCPEIterator(ctx context.Context, excludedPlatforms []string) (fleet.SoftwareIterator, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.AllSoftwareWithoutCPEIteratorFuncInvoked = true
|
2022-08-04 13:24:44 +00:00
|
|
|
return s.AllSoftwareWithoutCPEIteratorFunc(ctx, excludedPlatforms)
|
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
|
|
|
}
|
|
|
|
|
2022-08-24 17:10:58 +00:00
|
|
|
func (s *DataStore) ListSoftwareCPEs(ctx context.Context) ([]fleet.SoftwareCPE, error) {
|
2022-06-08 01:09:47 +00:00
|
|
|
s.ListSoftwareCPEsFuncInvoked = true
|
2022-08-24 17:10:58 +00:00
|
|
|
return s.ListSoftwareCPEsFunc(ctx)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
func (s *DataStore) InsertVulnerabilities(ctx context.Context, vulns []fleet.SoftwareVulnerability, source fleet.VulnerabilitySource) (int64, error) {
|
|
|
|
s.InsertVulnerabilitiesFuncInvoked = true
|
|
|
|
return s.InsertVulnerabilitiesFunc(ctx, vulns, source)
|
2021-08-24 21:49:56 +00:00
|
|
|
}
|
|
|
|
|
2022-05-20 16:58:40 +00:00
|
|
|
func (s *DataStore) SoftwareByID(ctx context.Context, id uint, includeCVEScores bool) (*fleet.Software, error) {
|
2021-10-12 18:59:01 +00:00
|
|
|
s.SoftwareByIDFuncInvoked = true
|
2022-05-20 16:58:40 +00:00
|
|
|
return s.SoftwareByIDFunc(ctx, id, includeCVEScores)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) ListSoftwareByHostIDShort(ctx context.Context, hostID uint) ([]fleet.Software, error) {
|
|
|
|
s.ListSoftwareByHostIDShortFuncInvoked = true
|
|
|
|
return s.ListSoftwareByHostIDShortFunc(ctx, hostID)
|
2021-10-12 18:59:01 +00:00
|
|
|
}
|
|
|
|
|
2022-06-22 20:35:53 +00:00
|
|
|
func (s *DataStore) SyncHostsSoftware(ctx context.Context, updatedAt time.Time) error {
|
|
|
|
s.SyncHostsSoftwareFuncInvoked = true
|
|
|
|
return s.SyncHostsSoftwareFunc(ctx, updatedAt)
|
2022-01-26 14:47:56 +00:00
|
|
|
}
|
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
func (s *DataStore) HostsBySoftwareIDs(ctx context.Context, softwareIDs []uint) ([]*fleet.HostShort, error) {
|
|
|
|
s.HostsBySoftwareIDsFuncInvoked = true
|
|
|
|
return s.HostsBySoftwareIDsFunc(ctx, softwareIDs)
|
2022-02-02 21:34:37 +00:00
|
|
|
}
|
|
|
|
|
2022-04-11 20:42:16 +00:00
|
|
|
func (s *DataStore) HostsByCVE(ctx context.Context, cve string) ([]*fleet.HostShort, error) {
|
|
|
|
s.HostsByCVEFuncInvoked = true
|
|
|
|
return s.HostsByCVEFunc(ctx, cve)
|
|
|
|
}
|
|
|
|
|
2022-06-01 16:06:57 +00:00
|
|
|
func (s *DataStore) InsertCVEMeta(ctx context.Context, cveMeta []fleet.CVEMeta) error {
|
|
|
|
s.InsertCVEMetaFuncInvoked = true
|
|
|
|
return s.InsertCVEMetaFunc(ctx, cveMeta)
|
2022-05-20 16:58:40 +00:00
|
|
|
}
|
|
|
|
|
2022-06-08 01:09:47 +00:00
|
|
|
func (s *DataStore) ListCVEs(ctx context.Context, maxAge time.Duration) ([]fleet.CVEMeta, error) {
|
|
|
|
s.ListCVEsFuncInvoked = true
|
|
|
|
return s.ListCVEsFunc(ctx, maxAge)
|
|
|
|
}
|
|
|
|
|
2022-08-09 18:34:41 +00:00
|
|
|
func (s *DataStore) ListOperatingSystems(ctx context.Context) ([]fleet.OperatingSystem, error) {
|
|
|
|
s.ListOperatingSystemsFuncInvoked = true
|
|
|
|
return s.ListOperatingSystemsFunc(ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) UpdateHostOperatingSystem(ctx context.Context, hostID uint, hostOS fleet.OperatingSystem) error {
|
|
|
|
s.UpdateHostOperatingSystemFuncInvoked = true
|
|
|
|
return s.UpdateHostOperatingSystemFunc(ctx, hostID, hostOS)
|
|
|
|
}
|
2022-08-12 19:23:25 +00:00
|
|
|
|
|
|
|
func (s *DataStore) CleanupHostOperatingSystems(ctx context.Context) error {
|
|
|
|
s.CleanupHostOperatingSystemsFuncInvoked = true
|
|
|
|
return s.CleanupHostOperatingSystemsFunc(ctx)
|
|
|
|
}
|
2022-08-09 18:34:41 +00:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-07-21 01:54:10 +00:00
|
|
|
func (s *DataStore) ShouldSendStatistics(ctx context.Context, frequency time.Duration, config config.FleetConfig, license *fleet.LicenseInfo) (fleet.StatisticsPayload, bool, error) {
|
2021-08-24 21:49:56 +00:00
|
|
|
s.ShouldSendStatisticsFuncInvoked = true
|
2022-07-21 01:54:10 +00:00
|
|
|
return s.ShouldSendStatisticsFunc(ctx, frequency, config, 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
|
|
|
}
|
|
|
|
|
2022-02-16 15:33:56 +00:00
|
|
|
func (s *DataStore) ApplyPolicySpecs(ctx context.Context, authorID uint, specs []*fleet.PolicySpec) error {
|
|
|
|
s.ApplyPolicySpecsFuncInvoked = true
|
|
|
|
return s.ApplyPolicySpecsFunc(ctx, authorID, specs)
|
|
|
|
}
|
|
|
|
|
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-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
|
|
|
}
|
|
|
|
|
2022-02-16 15:33:56 +00:00
|
|
|
func (s *DataStore) PoliciesByID(ctx context.Context, ids []uint) (map[uint]*fleet.Policy, error) {
|
|
|
|
s.PoliciesByIDFuncInvoked = true
|
|
|
|
return s.PoliciesByIDFunc(ctx, ids)
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-01-18 14:56:43 +00:00
|
|
|
func (s *DataStore) AsyncBatchInsertPolicyMembership(ctx context.Context, batch []fleet.PolicyMembershipResult) error {
|
|
|
|
s.AsyncBatchInsertPolicyMembershipFuncInvoked = true
|
|
|
|
return s.AsyncBatchInsertPolicyMembershipFunc(ctx, batch)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) AsyncBatchUpdatePolicyTimestamp(ctx context.Context, ids []uint, ts time.Time) error {
|
|
|
|
s.AsyncBatchUpdatePolicyTimestampFuncInvoked = true
|
|
|
|
return s.AsyncBatchUpdatePolicyTimestampFunc(ctx, ids, ts)
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2022-06-23 20:44:45 +00:00
|
|
|
func (s *DataStore) DeleteSoftwareVulnerabilities(ctx context.Context, vulnerabilities []fleet.SoftwareVulnerability) error {
|
|
|
|
s.DeleteSoftwareVulnerabilitiesFuncInvoked = true
|
|
|
|
return s.DeleteSoftwareVulnerabilitiesFunc(ctx, vulnerabilities)
|
2022-02-14 18:13:44 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2022-02-23 21:10:37 +00:00
|
|
|
func (s *DataStore) CleanupPolicyMembership(ctx context.Context, now time.Time) error {
|
|
|
|
s.CleanupPolicyMembershipFuncInvoked = true
|
|
|
|
return s.CleanupPolicyMembershipFunc(ctx, now)
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
}
|
2022-01-18 01:52:09 +00:00
|
|
|
|
|
|
|
func (s *DataStore) LoadHostByNodeKey(ctx context.Context, nodeKey string) (*fleet.Host, error) {
|
|
|
|
s.LoadHostByNodeKeyFuncInvoked = true
|
|
|
|
return s.LoadHostByNodeKeyFunc(ctx, nodeKey)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) HostLite(ctx context.Context, hostID uint) (*fleet.Host, error) {
|
|
|
|
s.HostLiteFuncInvoked = true
|
|
|
|
return s.HostLiteFunc(ctx, hostID)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) UpdateHostOsqueryIntervals(ctx context.Context, hostID uint, intervals fleet.HostOsqueryIntervals) error {
|
|
|
|
s.UpdateHostOsqueryIntervalsFuncInvoked = true
|
|
|
|
return s.UpdateHostOsqueryIntervalsFunc(ctx, hostID, intervals)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) TeamAgentOptions(ctx context.Context, teamID uint) (*json.RawMessage, error) {
|
|
|
|
s.TeamAgentOptionsFuncInvoked = true
|
|
|
|
return s.TeamAgentOptionsFunc(ctx, teamID)
|
|
|
|
}
|
|
|
|
|
2022-08-30 11:13:09 +00:00
|
|
|
func (s *DataStore) TeamFeatures(ctx context.Context, teamID uint) (*fleet.Features, error) {
|
|
|
|
s.TeamFeaturesFuncInvoked = true
|
|
|
|
return s.TeamFeaturesFunc(ctx, teamID)
|
|
|
|
}
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
func (s *DataStore) SaveHostPackStats(ctx context.Context, hostID uint, stats []fleet.PackStats) error {
|
|
|
|
s.SaveHostPackStatsFuncInvoked = true
|
|
|
|
return s.SaveHostPackStatsFunc(ctx, hostID, stats)
|
|
|
|
}
|
|
|
|
|
2022-08-10 14:01:05 +00:00
|
|
|
func (s *DataStore) AsyncBatchSaveHostsScheduledQueryStats(ctx context.Context, stats map[uint][]fleet.ScheduledQueryStats, batchSize int) (int, error) {
|
|
|
|
s.AsyncBatchSaveHostsScheduledQueryStatsFuncInvoked = true
|
|
|
|
return s.AsyncBatchSaveHostsScheduledQueryStatsFunc(ctx, stats, batchSize)
|
|
|
|
}
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
func (s *DataStore) UpdateHostSoftware(ctx context.Context, hostID uint, software []fleet.Software) error {
|
|
|
|
s.UpdateHostSoftwareFuncInvoked = true
|
|
|
|
return s.UpdateHostSoftwareFunc(ctx, hostID, software)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) UpdateHost(ctx context.Context, host *fleet.Host) error {
|
|
|
|
s.UpdateHostFuncInvoked = true
|
|
|
|
return s.UpdateHostFunc(ctx, host)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) ListScheduledQueriesInPack(ctx context.Context, packID uint) ([]*fleet.ScheduledQuery, error) {
|
|
|
|
s.ListScheduledQueriesInPackFuncInvoked = true
|
|
|
|
return s.ListScheduledQueriesInPackFunc(ctx, packID)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) UpdateHostRefetchRequested(ctx context.Context, hostID uint, value bool) error {
|
|
|
|
s.UpdateHostRefetchRequestedFuncInvoked = true
|
|
|
|
return s.UpdateHostRefetchRequestedFunc(ctx, hostID, value)
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) RecordPolicyQueryExecutions(ctx context.Context, host *fleet.Host, results map[uint]*bool, updated time.Time, deferredSaveHost bool) error {
|
|
|
|
s.RecordPolicyQueryExecutionsFuncInvoked = true
|
|
|
|
return s.RecordPolicyQueryExecutionsFunc(ctx, host, results, updated, deferredSaveHost)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) RecordLabelQueryExecutions(ctx context.Context, host *fleet.Host, results map[uint]*bool, t time.Time, deferredSaveHost bool) error {
|
|
|
|
s.RecordLabelQueryExecutionsFuncInvoked = true
|
|
|
|
return s.RecordLabelQueryExecutionsFunc(ctx, host, results, t, deferredSaveHost)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) SaveHostUsers(ctx context.Context, hostID uint, users []fleet.HostUser) error {
|
|
|
|
s.SaveHostUsersFuncInvoked = true
|
|
|
|
return s.SaveHostUsersFunc(ctx, hostID, users)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) SaveHostAdditional(ctx context.Context, hostID uint, additional *json.RawMessage) error {
|
|
|
|
s.SaveHostAdditionalFuncInvoked = true
|
|
|
|
return s.SaveHostAdditionalFunc(ctx, hostID, additional)
|
|
|
|
}
|
|
|
|
|
2022-08-29 18:40:16 +00:00
|
|
|
func (s *DataStore) SetOrUpdateMunkiInfo(ctx context.Context, hostID uint, version string, errors []string, warnings []string) error {
|
|
|
|
s.SetOrUpdateMunkiInfoFuncInvoked = true
|
|
|
|
return s.SetOrUpdateMunkiInfoFunc(ctx, hostID, version, errors, warnings)
|
2022-01-18 01:52:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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) ReplaceHostDeviceMapping(ctx context.Context, id uint, mappings []*fleet.HostDeviceMapping) error {
|
|
|
|
s.ReplaceHostDeviceMappingFuncInvoked = true
|
|
|
|
return s.ReplaceHostDeviceMappingFunc(ctx, id, mappings)
|
|
|
|
}
|
|
|
|
|
2022-06-28 18:11:49 +00:00
|
|
|
func (s *DataStore) ReplaceHostBatteries(ctx context.Context, id uint, mappings []*fleet.HostBattery) error {
|
|
|
|
s.ReplaceHostBatteriesFuncInvoked = true
|
|
|
|
return s.ReplaceHostBatteriesFunc(ctx, id, mappings)
|
|
|
|
}
|
|
|
|
|
2022-01-18 01:52:09 +00:00
|
|
|
func (s *DataStore) VerifyEnrollSecret(ctx context.Context, secret string) (*fleet.EnrollSecret, error) {
|
|
|
|
s.VerifyEnrollSecretFuncInvoked = true
|
|
|
|
return s.VerifyEnrollSecretFunc(ctx, secret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) EnrollHost(ctx context.Context, osqueryHostId string, nodeKey string, teamID *uint, cooldown time.Duration) (*fleet.Host, error) {
|
|
|
|
s.EnrollHostFuncInvoked = true
|
|
|
|
return s.EnrollHostFunc(ctx, osqueryHostId, nodeKey, teamID, cooldown)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) SerialUpdateHost(ctx context.Context, host *fleet.Host) error {
|
|
|
|
s.SerialUpdateHostFuncInvoked = true
|
|
|
|
return s.SerialUpdateHostFunc(ctx, host)
|
|
|
|
}
|
2022-02-03 17:56:22 +00:00
|
|
|
|
2022-04-05 16:56:15 +00:00
|
|
|
func (s *DataStore) NewJob(ctx context.Context, job *fleet.Job) (*fleet.Job, error) {
|
|
|
|
s.NewJobFuncInvoked = true
|
|
|
|
return s.NewJobFunc(ctx, job)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) GetQueuedJobs(ctx context.Context, maxNumJobs int) ([]*fleet.Job, error) {
|
|
|
|
s.GetQueuedJobsFuncInvoked = true
|
|
|
|
return s.GetQueuedJobsFunc(ctx, maxNumJobs)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) UpdateJob(ctx context.Context, id uint, job *fleet.Job) (*fleet.Job, error) {
|
|
|
|
s.UpdateJobFuncInvoked = true
|
|
|
|
return s.UpdateJobFunc(ctx, id, job)
|
|
|
|
}
|
|
|
|
|
2022-02-03 17:56:22 +00:00
|
|
|
func (s *DataStore) InnoDBStatus(ctx context.Context) (string, error) {
|
|
|
|
s.InnoDBStatusFuncInvoked = true
|
|
|
|
return s.InnoDBStatusFunc(ctx)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DataStore) ProcessList(ctx context.Context) ([]fleet.MySQLProcess, error) {
|
|
|
|
s.ProcessListFuncInvoked = true
|
|
|
|
return s.ProcessListFunc(ctx)
|
|
|
|
}
|
2022-08-26 18:55:03 +00:00
|
|
|
|
|
|
|
func (s *DataStore) InsertWindowsUpdates(ctx context.Context, hostID uint, updates []fleet.WindowsUpdate) error {
|
|
|
|
s.InsertWindowsUpdatesFuncInvoked = true
|
|
|
|
return s.InsertWindowsUpdatesFunc(ctx, hostID, updates)
|
|
|
|
}
|