Documentation
¶
Overview ¶
Package credentials inventories the places a developer's tools keep credentials.
The unit of collection is a source: one file, or the one directory that exists for nothing but keys. A source reports where credential material sits and how well it is guarded — never the material itself. No value, no substring, no digest, no fingerprint, and no classification derived from the secret's own characters ever leaves this package.
A finding means material is in the file: a concrete value in a field the tool consumes as authentication, or a structurally valid private key. A file that names a credential kept elsewhere is not a finding, and neither is one this build could not interpret — that becomes an error, so a file the agent cannot read can never resolve to "this machine holds nothing".
Two properties hold for every source and are what keep the phase bounded and consent-safe: each location is an exact path rather than a root to walk, and each read has a byte cap. Adding a family is a table entry plus a parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvVars ¶
func EnvVars() []string
EnvVars returns every environment variable whose value the catalog needs from the resolved developer's session, deduplicated and in a stable order. It is what the one-shot probe asks for: these live in a shell session rather than a file, so they are collected in a single pass and never re-queried per source.
Types ¶
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector inventories the developer's credential locations. No tool is ever asked what credentials it holds: every finding comes from bytes in a file at a path the catalog names, so a tool's own account of a secret it keeps elsewhere is not this inventory's evidence and not its business to ask for. The one command a run makes is the environment probe, which reads the variables that move those paths and is told nothing about what is being looked for.
func (*Detector) Detect ¶
func (d *Detector) Detect(ctx context.Context) *model.CredentialScanInfo
Detect returns the inventory for one run. Never nil and never an error: an unreadable source becomes an entry in the result's own error list, so one bad file does not discard the sources that succeeded.