engine

package
v3.21.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package engine is a generated GoMock package.

Index

Constants

View Source
const (
	CxFileEndMarker = ";cx-file-end"
)

Variables

This section is empty.

Functions

func GetRulesCommand

func GetRulesCommand(engineConfig *EngineConfig) *cobra.Command

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func (*Engine) AddRegexRules

func (e *Engine) AddRegexRules(patterns []string) error

func (*Engine) DetectFile

func (e *Engine) DetectFile(ctx context.Context, item plugins.ISourceItem, secretsChannel chan *secrets.Secret) error

DetectFile reads the given file and detects secrets in it

func (*Engine) DetectFragment

func (e *Engine) DetectFragment(item plugins.ISourceItem, secretsChannel chan *secrets.Secret, pluginName string) error

DetectFragment detects secrets in the given fragment

func (*Engine) GetRuleBaseRiskScore

func (e *Engine) GetRuleBaseRiskScore(ruleId string) float64

func (*Engine) RegisterForValidation

func (e *Engine) RegisterForValidation(secret *secrets.Secret)

func (*Engine) Score

func (e *Engine) Score(secret *secrets.Secret, validateFlag bool)

func (*Engine) Validate

func (e *Engine) Validate()

type EngineConfig

type EngineConfig struct {
	SelectedList []string
	IgnoreList   []string
	SpecialList  []string

	MaxTargetMegabytes int

	IgnoredIds    []string
	AllowedValues []string
}

type IEngine

type IEngine interface {
	DetectFragment(item plugins.ISourceItem, secretsChannel chan *secrets.Secret, pluginName string) error
	DetectFile(ctx context.Context, item plugins.ISourceItem, secretsChannel chan *secrets.Secret) error
	AddRegexRules(patterns []string) error
	RegisterForValidation(secret *secrets.Secret)
	Score(secret *secrets.Secret, validateFlag bool)
	Validate()
	GetRuleBaseRiskScore(ruleId string) float64
}

func Init

func Init(engineConfig EngineConfig) (IEngine, error)

type MockIEngine

type MockIEngine struct {
	// contains filtered or unexported fields
}

MockIEngine is a mock of IEngine interface.

func NewMockIEngine

func NewMockIEngine(ctrl *gomock.Controller) *MockIEngine

NewMockIEngine creates a new mock instance.

func (*MockIEngine) AddRegexRules

func (m *MockIEngine) AddRegexRules(patterns []string) error

AddRegexRules mocks base method.

func (*MockIEngine) DetectFile

func (m *MockIEngine) DetectFile(ctx context.Context, item plugins.ISourceItem, secretsChannel chan *secrets.Secret) error

DetectFile mocks base method.

func (*MockIEngine) DetectFragment

func (m *MockIEngine) DetectFragment(item plugins.ISourceItem, secretsChannel chan *secrets.Secret, pluginName string) error

DetectFragment mocks base method.

func (*MockIEngine) EXPECT

func (m *MockIEngine) EXPECT() *MockIEngineMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIEngine) GetRuleBaseRiskScore

func (m *MockIEngine) GetRuleBaseRiskScore(ruleId string) float64

GetRuleBaseRiskScore mocks base method.

func (*MockIEngine) RegisterForValidation

func (m *MockIEngine) RegisterForValidation(secret *secrets.Secret)

RegisterForValidation mocks base method.

func (*MockIEngine) Score

func (m *MockIEngine) Score(secret *secrets.Secret, validateFlag bool)

Score mocks base method.

func (*MockIEngine) Validate

func (m *MockIEngine) Validate()

Validate mocks base method.

type MockIEngineMockRecorder

type MockIEngineMockRecorder struct {
	// contains filtered or unexported fields
}

MockIEngineMockRecorder is the mock recorder for MockIEngine.

func (*MockIEngineMockRecorder) AddRegexRules

func (mr *MockIEngineMockRecorder) AddRegexRules(patterns any) *gomock.Call

AddRegexRules indicates an expected call of AddRegexRules.

func (*MockIEngineMockRecorder) DetectFile

func (mr *MockIEngineMockRecorder) DetectFile(ctx, item, secretsChannel any) *gomock.Call

DetectFile indicates an expected call of DetectFile.

func (*MockIEngineMockRecorder) DetectFragment

func (mr *MockIEngineMockRecorder) DetectFragment(item, secretsChannel, pluginName any) *gomock.Call

DetectFragment indicates an expected call of DetectFragment.

func (*MockIEngineMockRecorder) GetRuleBaseRiskScore

func (mr *MockIEngineMockRecorder) GetRuleBaseRiskScore(ruleId any) *gomock.Call

GetRuleBaseRiskScore indicates an expected call of GetRuleBaseRiskScore.

func (*MockIEngineMockRecorder) RegisterForValidation

func (mr *MockIEngineMockRecorder) RegisterForValidation(secret any) *gomock.Call

RegisterForValidation indicates an expected call of RegisterForValidation.

func (*MockIEngineMockRecorder) Score

func (mr *MockIEngineMockRecorder) Score(secret, validateFlag any) *gomock.Call

Score indicates an expected call of Score.

func (*MockIEngineMockRecorder) Validate

func (mr *MockIEngineMockRecorder) Validate() *gomock.Call

Validate indicates an expected call of Validate.

Directories

Path Synopsis
Package chunk is a generated GoMock package.
Package chunk is a generated GoMock package.
Package semaphore is a generated GoMock package.
Package semaphore is a generated GoMock package.

Jump to

Keyboard shortcuts

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