internal/

directory
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0

Directories

Path Synopsis
Package browser opens a URL in the operating system's default browser.
Package browser opens a URL in the operating system's default browser.
Package candidate defines the stage envelopes: Chunk, which carries content from source through decode to detect, and Candidate, which detect hands on toward verify with a Finding, its secret.Secret key material and the precomputed suppression context.
Package candidate defines the stage envelopes: Chunk, which carries content from source through decode to detect, and Candidate, which detect hands on toward verify with a Finding, its secret.Secret key material and the precomputed suppression context.
Package cli is the command line front door: it defines the Cobra commands, maps results to exit codes and carries the build version, commit and date injected by ldflags.
Package cli is the command line front door: it defines the Cobra commands, maps results to exit codes and carries the build version, commit and date injected by ldflags.
Package config resolves TokenHound configuration once per run.
Package config resolves TokenHound configuration once per run.
Package decode is the second pipeline stage: it decodes base64, URL, JSON-escaped and env-file encodings and expands archives in memory within configured size, depth and entry limits.
Package decode is the second pipeline stage: it decodes base64, URL, JSON-escaped and env-file encodings and expands archives in memory within configured size, depth and entry limits.
Package detect is the third pipeline stage: it matches registry patterns, entropy and keyword context, computes the fingerprint id and confidence, and emits candidate.Candidate envelopes.
Package detect is the third pipeline stage: it matches registry patterns, entropy and keyword context, computes the fingerprint id and confidence, and emits candidate.Candidate envelopes.
Package engine wires the scan pipeline: it connects the stages (source, decode, detect, suppress, verify, enrich, grade, fixplan) over bounded channels, runs the worker pools and the single barrier after enrich, applies timeouts and sorts findings once.
Package engine wires the scan pipeline: it connects the stages (source, decode, detect, suppress, verify, enrich, grade, fixplan) over bounded channels, runs the worker pools and the single barrier after enrich, applies timeouts and sorts findings once.
Package enrich is the sixth pipeline stage: it derives tier, scopes, org, first_seen, age and dollars at risk per day from verify evidence and the spend registry.
Package enrich is the sixth pipeline stage: it derives tier, scopes, org, first_seen, age and dollars at risk per day from verify evidence and the spend registry.
Package fixplan runs once after the engine barrier and the location sort: it sets the fix plan of every finding (live, dead, unverified and suppressed alike).
Package fixplan runs once after the engine barrier and the location sort: it sets the fix plan of every finding (live, dead, unverified and suppressed alike).
Package gitx is the only package that runs the system git binary, with argument slices, validated refs and hardened flags and environment.
Package gitx is the only package that runs the system git binary, with argument slices, validated refs and hardened flags and environment.
gitxtest
Package gitxtest builds throwaway git repositories for tests.
Package gitxtest builds throwaway git repositories for tests.
Package grade runs once after the engine barrier: it computes the A to F grade per target and overall, with the reasons for each grade.
Package grade runs once after the engine barrier: it computes the A to F grade per target and overall, with the reasons for each grade.
Package ignore holds the parts of the ignore grammar (docs/schema/ignore.v1.md) that both the config resolver and the suppress stage need: rule validation and the forward-slash glob matcher.
Package ignore holds the parts of the ignore grammar (docs/schema/ignore.v1.md) that both the config resolver and the suppress stage need: rule validation and the forward-slash glob matcher.
Package lintcheck owns the lint self-test fixtures under testdata.
Package lintcheck owns the lint self-test fixtures under testdata.
Package netx is the only package that builds HTTP clients and transports: HTTPS only, a closed purpose enum, registry-declared hosts for verification, no redirects for verify, proxy and custom CA support.
Package netx is the only package that builds HTTP clients and transports: HTTPS only, a closed purpose enum, registry-declared hosts for verification, no redirects for verify, proxy and custom CA support.
netxtest
Package netxtest holds loopback test wiring for code that talks through internal/netx: a throwaway certificate authority, TLS test servers whose leaf certificates name any host, and a CONNECT-only proxy.
Package netxtest holds loopback test wiring for code that talks through internal/netx: a throwaway certificate authority, TLS test servers whose leaf certificates name any host, and a CONNECT-only proxy.
Package ownership is a test helper for AD-2 field ownership: each Finding field is set only by its owning stage.
Package ownership is a test helper for AD-2 field ownership: each Finding field is set only by its owning stage.
Package registry loads and validates the provider, surface and spend registries (YAML validated by JSON Schema) from the embedded snapshot or a refreshed copy.
Package registry loads and validates the provider, surface and spend registries (YAML validated by JSON Schema) from the embedded snapshot or a refreshed copy.
Package secret holds credential material in an opaque Secret type whose formatting and marshalling methods return only the redacted form.
Package secret holds credential material in an opaque Secret type whose formatting and marshalling methods return only the redacted form.
Package source is the first pipeline stage: adapters read files, staged changes, git history, images, notebooks, agent surfaces, stdin and forge orgs, and emit content chunks with their Location.
Package source is the first pipeline stage: adapters read files, staged changes, git history, images, notebooks, agent surfaces, stdin and forge orgs, and emit content chunks with their Location.
fs
Package fs is the working tree source adapter ("fs"): it walks a directory, or reads one file, and emits each regular file as one chunk.
Package fs is the working tree source adapter ("fs"): it walks a directory, or reads one file, and emits each regular file as one chunk.
git
Package git holds the git source adapters.
Package git holds the git source adapters.
stdin
Package stdin is the stream source adapter ("stdin"): it reads one stream, such as standard input, whole and emits it as one chunk with Location kind stdin and target {stdin, stdin, unknown}.
Package stdin is the stream source adapter ("stdin"): it reads one stream, such as standard input, whole and emits it as one chunk with Location kind stdin and target {stdin, stdin, unknown}.
surface
Package surface is the agent surface source adapter ("surface"): it reads the files coding agents keep on disk (settings, allowlists, MCP config, transcripts) as the registry describes them, parses each with the format's structure-aware parser and emits one chunk per extracted entry with a Location of kind surface (surface id, path, field) so that credentials in one entry pair under same-surface-entry.
Package surface is the agent surface source adapter ("surface"): it reads the files coding agents keep on disk (settings, allowlists, MCP config, transcripts) as the registry describes them, parses each with the format's structure-aware parser and emits one chunk per extracted entry with a Location of kind surface (surface id, path, field) so that credentials in one entry pair under same-surface-entry.
surface/parse
Package parse reads the file formats of agent surfaces (json, jsonc, jsonl, toml, yaml, ini, dotenv, shell-history and ipynb) into a small tree that keeps the 1-based source line of every value, and selects string values from it with field selectors.
Package parse reads the file formats of agent surfaces (json, jsonc, jsonl, toml, yaml, ini, dotenv, shell-history and ipynb) into a small tree that keeps the 1-based source line of every value, and selects string values from it with field selectors.
Package stagereg is the adapter registry every pipeline stage package uses: adapters register a factory under a name at init(), and the engine looks factories up by name.
Package stagereg is the adapter registry every pipeline stage package uses: adapters register a factory under a name at init(), and the engine looks factories up by name.
Package suppress is the fourth pipeline stage: it alone decides whether a candidate is suppressed (test keys, inline allows, allowlists, ignore files, baselines) and records the reason.
Package suppress is the fourth pipeline stage: it alone decides whether a candidate is suppressed (test keys, inline allows, allowlists, ignore files, baselines) and records the reason.
Package verify is the fifth pipeline stage: it checks keys with read-only, registry-declared requests through netx and sets status, status_reason and verify_evidence.
Package verify is the fifth pipeline stage: it checks keys with read-only, registry-declared requests through netx and sets status, status_reason and verify_evidence.
Package warnx builds report warnings from errors as {code, location, detail_code}, so foreign error text never reaches warnings, logs or MCP output.
Package warnx builds report warnings from errors as {code, location, detail_code}, so foreign error text never reaches warnings, logs or MCP output.
Package yamlschema parses single-document YAML files and validates them against a JSON Schema, reporting every problem as "file:line: field: message".
Package yamlschema parses single-document YAML files and validates them against a JSON Schema, reporting every problem as "file:line: field: message".

Jump to

Keyboard shortcuts

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