Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllScanTypes = []string{ config.ScanTypeGo, config.ScanTypeYaml, config.ScanTypeJSON, config.ScanTypeProperties, config.ScanTypePrivateKey, config.ScanTypeXML, config.ScanTypePHP, config.ScanTypeBash, config.ScanTypeJavaScript, config.ScanTypeTypeScript, config.ScanTypeHTML, config.ScanTypeGeneric, config.ScanTypeGenericCode, }
AllScanTypes lists every supported scan type in display order.
Functions ¶
func GenerateID ¶
func GenerateID() string
Types ¶
type ConfigEditorData ¶
type ConfigEditorData struct {
// Replace fields — effective value (override wins, then defaults)
VariableNameExclusionPattern string
XMLAttributeNameExclusionPattern string
MinPasswordLength int
ExcludeTests bool
ExcludeComments bool
Verbose bool
ScanTypes []string
// Append fields — only the user's overrides (empty if none saved)
ExtraVariableNamePatterns []string
ExtraValueMatchPatterns []config.ValueMatchPattern
ExtraVariableValueExcludePatterns []string
ExtraFullTextValueExcludePatterns []string
ExtraTestDirectories []string
ExtraIgnoreFiles []string
ExtraGenericFileExtensions []string
ExtraGenericCodeFileExtensions []string
// Reference: the base defaults shown collapsed for context
Defaults *config.Config
AllScanTypes []string
// Whether a custom config is currently active
HasOverride bool
}
ConfigEditorData is the template data for the config editor partial.
func BuildEditorData ¶
func BuildEditorData(defaults, override *config.Config) ConfigEditorData
BuildEditorData constructs the ConfigEditorData for the template, applying any override values on top of the defaults.
type ExportData ¶ added in v1.18.0
type ExportData struct {
Version int `json:"version"`
ExportedAt time.Time `json:"exported_at"`
Request ScanRequest `json:"request"`
Results []parser.Result `json:"results"`
Stats parser.Statistics `json:"stats"`
Dismissed map[int]bool `json:"dismissed,omitempty"`
}
ExportData is the JSON-serializable format for saving and loading scan results.
type IndexedResult ¶
IndexedResult pairs a result with its original index for dismiss operations
type OrgFilter ¶
type OrgFilter struct {
ActiveOnly bool `json:"active_only,omitempty"`
RepoPattern string `json:"repo_pattern,omitempty"`
}
OrgFilter holds filtering options for GitHub org scans
type ResultRowData ¶
ResultRowData is passed into the result_row template
type ResultsPageData ¶
type ResultsPageData struct {
SessionID string
Results []IndexedResult
Stats parser.Statistics
Status ScanStatus
Error string
Target string
ActiveCount int
TotalCount int
Page int
PageSize int
HasMore bool
}
ResultsPageData is passed into the results template
type ScanRequest ¶
type ScanRequest struct {
Mode ScanMode `json:"mode"`
Target string `json:"target"`
Depth ScanDepth `json:"depth"`
OrgFilter OrgFilter `json:"org_filter,omitempty"`
}
ScanRequest represents a user-submitted scan form
type ScanSession ¶
type ScanSession struct {
ID string
Request ScanRequest
Status ScanStatus
Error string
Results []parser.Result
Stats parser.Statistics
Progress chan string
CreatedAt time.Time
ConfigOverride *config.Config // optional per-session config additions
Mu sync.Mutex
Dismissed map[int]bool
}
ScanSession holds the state of an in-progress or completed scan
func (*ScanSession) ActiveResults ¶
func (s *ScanSession) ActiveResults() []IndexedResult
ActiveResults returns non-dismissed results with their original indices
func (*ScanSession) Dismiss ¶
func (s *ScanSession) Dismiss(index int)
Dismiss marks a result index as dismissed
func (*ScanSession) DismissFile ¶
func (s *ScanSession) DismissFile(file string)
DismissFile marks all results for a given file as dismissed
func (*ScanSession) DismissValue ¶
func (s *ScanSession) DismissValue(value string)
DismissValue marks all results with the given value as dismissed
func (*ScanSession) IsDismissed ¶
func (s *ScanSession) IsDismissed(index int) bool
IsDismissed checks whether a result has been dismissed
type ScanStatus ¶
type ScanStatus string
ScanStatus tracks the lifecycle of a scan
const ( ScanStatusRunning ScanStatus = "running" ScanStatusComplete ScanStatus = "complete" ScanStatusFailed ScanStatus = "failed" )
type SessionStore ¶
type SessionStore struct {
Mu sync.RWMutex
Sessions map[string]*ScanSession
}
SessionStore holds active scan sessions in memory
func NewSessionStore ¶
func NewSessionStore() *SessionStore
NewSessionStore creates a new session store and starts a cleanup goroutine
func (*SessionStore) Create ¶
func (s *SessionStore) Create(req ScanRequest) *ScanSession
Create allocates a new scan session and returns it
func (*SessionStore) Delete ¶
func (s *SessionStore) Delete(id string)
Delete removes a session from the store
func (*SessionStore) Get ¶
func (s *SessionStore) Get(id string) (*ScanSession, bool)
Get retrieves a session by ID