credentials

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 New

func New(exec executor.Executor) *Detector

New builds a detector.

func (*Detector) Detect

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.

func (*Detector) WithSkipper

func (d *Detector) WithSkipper(s *tcc.Skipper) *Detector

WithSkipper attaches the consent guard. A nil skipper is a no-op.

Jump to

Keyboard shortcuts

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