mocks

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

File: internal/mocks/mocks.go

internal/mocks/self_heal_orchestrator_mock.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserInteractor

type BrowserInteractor struct {
	mock.Mock
}

BrowserInteractor is an autogenerated mock type for the BrowserInteractor type

func NewBrowserInteractor

func NewBrowserInteractor(t interface {
	mock.TestingT
	Cleanup(func())
}) *BrowserInteractor

NewBrowserInteractor creates a new instance of BrowserInteractor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*BrowserInteractor) Close

func (_m *BrowserInteractor) Close() error

Close provides a mock function with no fields

func (*BrowserInteractor) GetArtifacts

func (_m *BrowserInteractor) GetArtifacts(ctx context.Context) (*schemas.Artifacts, error)

GetArtifacts provides a mock function with given fields: ctx

func (*BrowserInteractor) Navigate

func (_m *BrowserInteractor) Navigate(ctx context.Context, url string, persona *schemas.Persona) error

Navigate provides a mock function with given fields: ctx, url, persona

type BrowserManager

type BrowserManager struct {
	mock.Mock
}

BrowserManager is an autogenerated mock type for the BrowserManager type

func NewBrowserManager

func NewBrowserManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *BrowserManager

NewBrowserManager creates a new instance of BrowserManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*BrowserManager) GetBrowser

func (_m *BrowserManager) GetBrowser() (schemas.BrowserInteractor, error)

GetBrowser provides a mock function with no fields

func (*BrowserManager) ReleaseBrowser

func (_m *BrowserManager) ReleaseBrowser(browser schemas.BrowserInteractor)

ReleaseBrowser provides a mock function with given fields: browser

type KnowledgeGraphClient

type KnowledgeGraphClient struct {
	mock.Mock
}

KnowledgeGraphClient is an autogenerated mock type for the KnowledgeGraphClient type

func NewKnowledgeGraphClient

func NewKnowledgeGraphClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *KnowledgeGraphClient

NewKnowledgeGraphClient creates a new instance of KnowledgeGraphClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*KnowledgeGraphClient) BulkUpdate

BulkUpdate provides a mock function with given fields: ctx, updates

type MockAnalyzer

type MockAnalyzer struct {
	mock.Mock
}

func NewMockAnalyzer

func NewMockAnalyzer() *MockAnalyzer

NewMockAnalyzer creates a new mock instance.

func (*MockAnalyzer) Analyze

func (m *MockAnalyzer) Analyze(ctx context.Context, analysisCtx *core.AnalysisContext) error

func (*MockAnalyzer) Description

func (m *MockAnalyzer) Description() string

func (*MockAnalyzer) Name

func (m *MockAnalyzer) Name() string

func (*MockAnalyzer) Type

func (m *MockAnalyzer) Type() core.AnalyzerType

type MockBrowserManager

type MockBrowserManager struct {
	mock.Mock
}

func (*MockBrowserManager) NewAnalysisContext

func (m *MockBrowserManager) NewAnalysisContext(sessionCtx context.Context, cfg interface{}, persona schemas.Persona, taintTemplate, taintConfig string, findingsChan chan<- schemas.Finding) (schemas.SessionContext, error)

func (*MockBrowserManager) Shutdown

func (m *MockBrowserManager) Shutdown(ctx context.Context) error

type MockComponentFactory

type MockComponentFactory struct {
	mock.Mock
}

MockComponentFactory mocks the ComponentFactory interface.

func (*MockComponentFactory) Create

func (m *MockComponentFactory) Create(ctx context.Context, cfg config.Interface, targets []string, logger *zap.Logger) (interface{}, error)

Create provides a mock function for component creation. It returns interface{} to avoid a direct dependency on the cmd package (where Components is defined), preventing an import cycle. The calling test code will perform a type assertion.

type MockConfig

type MockConfig struct {
	mock.Mock
}

MockConfig mocks the config.Interface.

func (*MockConfig) Agent

func (m *MockConfig) Agent() config.AgentConfig

func (*MockConfig) Autofix

func (m *MockConfig) Autofix() config.AutofixConfig

func (*MockConfig) Browser

func (m *MockConfig) Browser() config.BrowserConfig

func (*MockConfig) Database

func (m *MockConfig) Database() config.DatabaseConfig

func (*MockConfig) Discovery

func (m *MockConfig) Discovery() config.DiscoveryConfig

func (*MockConfig) Engine

func (m *MockConfig) Engine() config.EngineConfig

func (*MockConfig) IAST

func (m *MockConfig) IAST() config.IASTConfig

func (*MockConfig) JWT

func (m *MockConfig) JWT() config.JWTConfig

func (*MockConfig) Logger

func (m *MockConfig) Logger() config.LoggerConfig

func (*MockConfig) Network

func (m *MockConfig) Network() config.NetworkConfig

func (*MockConfig) Scan

func (m *MockConfig) Scan() config.ScanConfig

func (*MockConfig) Scanners

func (m *MockConfig) Scanners() config.ScannersConfig

func (*MockConfig) SetATOConfig

func (m *MockConfig) SetATOConfig(atoCfg config.ATOConfig)

func (*MockConfig) SetBrowserDebug

func (m *MockConfig) SetBrowserDebug(b bool)

func (*MockConfig) SetBrowserDisableCache

func (m *MockConfig) SetBrowserDisableCache(b bool)

func (*MockConfig) SetBrowserDisableGPU

func (m *MockConfig) SetBrowserDisableGPU(b bool)

func (*MockConfig) SetBrowserHeadless

func (m *MockConfig) SetBrowserHeadless(b bool)

func (*MockConfig) SetBrowserHumanoidClickHoldMaxMs

func (m *MockConfig) SetBrowserHumanoidClickHoldMaxMs(ms int)

func (*MockConfig) SetBrowserHumanoidClickHoldMinMs

func (m *MockConfig) SetBrowserHumanoidClickHoldMinMs(ms int)

func (*MockConfig) SetBrowserHumanoidEnabled

func (m *MockConfig) SetBrowserHumanoidEnabled(b bool)

func (*MockConfig) SetBrowserHumanoidKeyHoldMu

func (m *MockConfig) SetBrowserHumanoidKeyHoldMu(ms float64)

func (*MockConfig) SetBrowserIgnoreTLSErrors

func (m *MockConfig) SetBrowserIgnoreTLSErrors(b bool)

func (*MockConfig) SetDiscoveryIncludeSubdomains

func (m *MockConfig) SetDiscoveryIncludeSubdomains(b bool)

func (*MockConfig) SetDiscoveryMaxDepth

func (m *MockConfig) SetDiscoveryMaxDepth(d int)

func (*MockConfig) SetEngineWorkerConcurrency

func (m *MockConfig) SetEngineWorkerConcurrency(w int)

func (*MockConfig) SetIASTEnabled

func (m *MockConfig) SetIASTEnabled(b bool)

func (*MockConfig) SetJWTBruteForceEnabled

func (m *MockConfig) SetJWTBruteForceEnabled(b bool)

func (*MockConfig) SetJWTEnabled

func (m *MockConfig) SetJWTEnabled(b bool)

func (*MockConfig) SetNetworkCaptureResponseBodies

func (m *MockConfig) SetNetworkCaptureResponseBodies(b bool)

func (*MockConfig) SetNetworkIgnoreTLSErrors

func (m *MockConfig) SetNetworkIgnoreTLSErrors(b bool)

func (*MockConfig) SetNetworkNavigationTimeout

func (m *MockConfig) SetNetworkNavigationTimeout(d time.Duration)

func (*MockConfig) SetNetworkPostLoadWait

func (m *MockConfig) SetNetworkPostLoadWait(d time.Duration)

func (*MockConfig) SetScanConfig

func (m *MockConfig) SetScanConfig(sc config.ScanConfig)

type MockDiscoveryEngine

type MockDiscoveryEngine struct {
	mock.Mock
}

MockDiscoveryEngine mocks the schemas.DiscoveryEngine interface.

func (*MockDiscoveryEngine) Start

func (m *MockDiscoveryEngine) Start(ctx context.Context, targets []string) (<-chan schemas.Task, error)

func (*MockDiscoveryEngine) Stop

func (m *MockDiscoveryEngine) Stop()

type MockHumanoidController

type MockHumanoidController struct {
	mock.Mock
}

MockHumanoidController mocks the humanoid.Controller interface.

func NewMockHumanoid

func NewMockHumanoid() *MockHumanoidController

NewMockHumanoid creates a new mock instance for the humanoid controller.

func (*MockHumanoidController) CognitivePause

func (m *MockHumanoidController) CognitivePause(ctx context.Context, meanScale, stdDevScale float64) error

func (*MockHumanoidController) DispatchMouseEvent

func (m *MockHumanoidController) DispatchMouseEvent(ctx context.Context, data schemas.MouseEventData) error

func (*MockHumanoidController) DispatchStructuredKey

func (m *MockHumanoidController) DispatchStructuredKey(ctx context.Context, data schemas.KeyEventData) error

func (*MockHumanoidController) DragAndDrop

func (m *MockHumanoidController) DragAndDrop(ctx context.Context, startSelector, endSelector string, opts *humanoid.InteractionOptions) error

func (*MockHumanoidController) ExecuteScript

func (m *MockHumanoidController) ExecuteScript(ctx context.Context, script string, args []interface{}) (json.RawMessage, error)

func (*MockHumanoidController) GetElementGeometry

func (m *MockHumanoidController) GetElementGeometry(ctx context.Context, selector string) (*schemas.ElementGeometry, error)

func (*MockHumanoidController) IntelligentClick

func (m *MockHumanoidController) IntelligentClick(ctx context.Context, selector string, opts *humanoid.InteractionOptions) error

func (*MockHumanoidController) MoveTo

func (*MockHumanoidController) SendKeys

func (m *MockHumanoidController) SendKeys(ctx context.Context, keys string) error

func (*MockHumanoidController) Shortcut

func (m *MockHumanoidController) Shortcut(ctx context.Context, keysExpression string) error

Shortcut provides a mock function with given fields: ctx, keysExpression

func (*MockHumanoidController) Sleep

func (*MockHumanoidController) Type

type MockIdorSession

type MockIdorSession struct {
	mock.Mock
}

func (*MockIdorSession) ApplyToRequest

func (m *MockIdorSession) ApplyToRequest(r *http.Request)

func (*MockIdorSession) WithAuthToken

func (m *MockIdorSession) WithAuthToken(token string) *MockIdorSession

type MockKGClient

type MockKGClient struct {
	mock.Mock
}

func (*MockKGClient) AddEdge

func (m *MockKGClient) AddEdge(ctx context.Context, edge schemas.Edge) error

func (*MockKGClient) AddNode

func (m *MockKGClient) AddNode(ctx context.Context, node schemas.Node) error

func (*MockKGClient) GetEdge

func (m *MockKGClient) GetEdge(ctx context.Context, id string) (schemas.Edge, error)

func (*MockKGClient) GetEdges

func (m *MockKGClient) GetEdges(ctx context.Context, nodeID string) ([]schemas.Edge, error)

func (*MockKGClient) GetNeighbors

func (m *MockKGClient) GetNeighbors(ctx context.Context, nodeID string) ([]schemas.Node, error)

func (*MockKGClient) GetNode

func (m *MockKGClient) GetNode(ctx context.Context, id string) (schemas.Node, error)

func (*MockKGClient) QueryImprovementHistory

func (m *MockKGClient) QueryImprovementHistory(ctx context.Context, goal string, limit int) ([]schemas.Node, error)

type MockLLMClient

type MockLLMClient struct {
	mock.Mock
}

func (*MockLLMClient) Close

func (m *MockLLMClient) Close() error

func (*MockLLMClient) Generate

type MockLTM

type MockLTM struct {
	mock.Mock
}

MockLTM mocks the long-term memory interface.

func (*MockLTM) ProcessAndFlagObservation

func (m *MockLTM) ProcessAndFlagObservation(ctx context.Context, obs interface{}) error

ProcessAndFlagObservation mocks the processing of an observation. It uses interface{} for the observation payload to avoid a circular dependency between the agent and mocks packages.

func (*MockLTM) Stop

func (m *MockLTM) Stop()

Stop mocks the cleanup/shutdown process.

type MockOASTProvider

type MockOASTProvider struct {
	mock.Mock
}

func (*MockOASTProvider) GetInteractions

func (m *MockOASTProvider) GetInteractions(ctx context.Context, canaries []string) ([]schemas.OASTInteraction, error)

func (*MockOASTProvider) GetServerURL

func (m *MockOASTProvider) GetServerURL() string

type MockOrchestrator

type MockOrchestrator struct {
	mock.Mock
}

func (*MockOrchestrator) StartScan

func (m *MockOrchestrator) StartScan(ctx context.Context, targets []string, scanID string) error

type MockSelfHealOrchestrator

type MockSelfHealOrchestrator struct {
	mock.Mock
}

MockSelfHealOrchestrator is a mock implementation of SelfHealOrchestrator.

func (*MockSelfHealOrchestrator) Start

func (*MockSelfHealOrchestrator) WaitForShutdown

func (m *MockSelfHealOrchestrator) WaitForShutdown()

type MockSessionContext

type MockSessionContext struct {
	mock.Mock
	// contains filtered or unexported fields
}

func NewMockSessionContext

func NewMockSessionContext() *MockSessionContext

func (*MockSessionContext) AddFinding

func (m *MockSessionContext) AddFinding(ctx context.Context, finding schemas.Finding) error

func (*MockSessionContext) Click

func (m *MockSessionContext) Click(ctx context.Context, selector string) error

func (*MockSessionContext) Close

func (m *MockSessionContext) Close(ctx context.Context) error

func (*MockSessionContext) CollectArtifacts

func (m *MockSessionContext) CollectArtifacts(ctx context.Context) (*schemas.Artifacts, error)

func (*MockSessionContext) DispatchMouseEvent

func (m *MockSessionContext) DispatchMouseEvent(ctx context.Context, data schemas.MouseEventData) error

func (*MockSessionContext) DispatchStructuredKey

func (m *MockSessionContext) DispatchStructuredKey(ctx context.Context, data schemas.KeyEventData) error

DispatchStructuredKey implements schemas.SessionContext.

func (*MockSessionContext) ExecuteScript

func (m *MockSessionContext) ExecuteScript(ctx context.Context, script string, scriptArgs []interface{}) (json.RawMessage, error)

func (*MockSessionContext) ExposeFunction

func (m *MockSessionContext) ExposeFunction(ctx context.Context, name string, function interface{}) error

func (*MockSessionContext) GetElementGeometry

func (m *MockSessionContext) GetElementGeometry(ctx context.Context, selector string) (*schemas.ElementGeometry, error)

func (*MockSessionContext) GetExposedFunction

func (m *MockSessionContext) GetExposedFunction(name string) (interface{}, bool)

func (*MockSessionContext) ID

func (m *MockSessionContext) ID() string

func (*MockSessionContext) InjectScriptPersistently

func (m *MockSessionContext) InjectScriptPersistently(ctx context.Context, script string) error

func (*MockSessionContext) Interact

func (*MockSessionContext) Navigate

func (m *MockSessionContext) Navigate(ctx context.Context, url string) error

func (*MockSessionContext) ScrollPage

func (m *MockSessionContext) ScrollPage(ctx context.Context, direction string) error

func (*MockSessionContext) SendKeys

func (m *MockSessionContext) SendKeys(ctx context.Context, keys string) error

func (*MockSessionContext) Sleep

func (*MockSessionContext) Submit

func (m *MockSessionContext) Submit(ctx context.Context, selector string) error

func (*MockSessionContext) Type

func (m *MockSessionContext) Type(ctx context.Context, selector string, text string) error

func (*MockSessionContext) WaitForAsync

func (m *MockSessionContext) WaitForAsync(ctx context.Context, milliseconds int) error

type MockStore

type MockStore struct {
	mock.Mock
}

func (*MockStore) GetFindingsByScanID

func (m *MockStore) GetFindingsByScanID(ctx context.Context, scanID string) ([]schemas.Finding, error)

func (*MockStore) PersistData

func (m *MockStore) PersistData(ctx context.Context, data *schemas.ResultEnvelope) error

type MockTaskEngine

type MockTaskEngine struct {
	mock.Mock
}

MockTaskEngine mocks the schemas.TaskEngine interface.

func (*MockTaskEngine) Start

func (m *MockTaskEngine) Start(ctx context.Context, taskChan <-chan schemas.Task)

func (*MockTaskEngine) Stop

func (m *MockTaskEngine) Stop()

type OASTProvider

type OASTProvider struct {
	mock.Mock
}

OASTProvider is an autogenerated mock type for the OASTProvider type

func NewOASTProvider

func NewOASTProvider(t interface {
	mock.TestingT
	Cleanup(func())
}) *OASTProvider

NewOASTProvider creates a new instance of OASTProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*OASTProvider) GetInteractions

func (_m *OASTProvider) GetInteractions(ctx context.Context, payload string) ([]schemas.OASTInteraction, error)

GetInteractions provides a mock function with given fields: ctx, payload

func (*OASTProvider) NewPayload

func (_m *OASTProvider) NewPayload() string

NewPayload provides a mock function with no fields

type SessionContext

type SessionContext struct {
	mock.Mock
}

SessionContext is an autogenerated mock type for the SessionContext type

func NewSessionContext

func NewSessionContext(t interface {
	mock.TestingT
	Cleanup(func())
}) *SessionContext

NewSessionContext creates a new instance of SessionContext. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*SessionContext) AddFinding

func (_m *SessionContext) AddFinding(ctx context.Context, finding schemas.Finding) error

AddFinding provides a mock function with given fields: ctx, finding

func (*SessionContext) Click

func (_m *SessionContext) Click(ctx context.Context, selector string) error

Click provides a mock function with given fields: ctx, selector

func (*SessionContext) Close

func (_m *SessionContext) Close(ctx context.Context) error

Close provides a mock function with given fields: ctx

func (*SessionContext) CollectArtifacts

func (_m *SessionContext) CollectArtifacts(ctx context.Context) (*schemas.Artifacts, error)

CollectArtifacts provides a mock function with given fields: ctx

func (*SessionContext) DispatchMouseEvent

func (_m *SessionContext) DispatchMouseEvent(ctx context.Context, data schemas.MouseEventData) error

DispatchMouseEvent provides a mock function with given fields: ctx, data

func (*SessionContext) DispatchStructuredKey

func (_m *SessionContext) DispatchStructuredKey(ctx context.Context, data schemas.KeyEventData) error

DispatchStructuredKey provides a mock function with given fields: ctx, data

func (*SessionContext) ExecuteScript

func (_m *SessionContext) ExecuteScript(ctx context.Context, script string, args []interface{}) (json.RawMessage, error)

ExecuteScript provides a mock function with given fields: ctx, script, args

func (*SessionContext) ExposeFunction

func (_m *SessionContext) ExposeFunction(ctx context.Context, name string, function interface{}) error

ExposeFunction provides a mock function with given fields: ctx, name, function

func (*SessionContext) GetElementGeometry

func (_m *SessionContext) GetElementGeometry(ctx context.Context, selector string) (*schemas.ElementGeometry, error)

GetElementGeometry provides a mock function with given fields: ctx, selector

func (*SessionContext) ID

func (_m *SessionContext) ID() string

ID provides a mock function with no fields

func (*SessionContext) InjectScriptPersistently

func (_m *SessionContext) InjectScriptPersistently(ctx context.Context, script string) error

InjectScriptPersistently provides a mock function with given fields: ctx, script

func (*SessionContext) Interact

func (_m *SessionContext) Interact(ctx context.Context, config schemas.InteractionConfig) error

Interact provides a mock function with given fields: ctx, config

func (*SessionContext) Navigate

func (_m *SessionContext) Navigate(ctx context.Context, url string) error

Navigate provides a mock function with given fields: ctx, url

func (*SessionContext) ScrollPage

func (_m *SessionContext) ScrollPage(ctx context.Context, direction string) error

ScrollPage provides a mock function with given fields: ctx, direction

func (*SessionContext) SendKeys

func (_m *SessionContext) SendKeys(ctx context.Context, keys string) error

SendKeys provides a mock function with given fields: ctx, keys

func (*SessionContext) Sleep

func (_m *SessionContext) Sleep(ctx context.Context, d time.Duration) error

Sleep provides a mock function with given fields: ctx, d

func (*SessionContext) Submit

func (_m *SessionContext) Submit(ctx context.Context, selector string) error

Submit provides a mock function with given fields: ctx, selector

func (*SessionContext) Type

func (_m *SessionContext) Type(ctx context.Context, selector string, text string) error

Type provides a mock function with given fields: ctx, selector, text

func (*SessionContext) WaitForAsync

func (_m *SessionContext) WaitForAsync(ctx context.Context, milliseconds int) error

WaitForAsync provides a mock function with given fields: ctx, milliseconds

Jump to

Keyboard shortcuts

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