Documentation
¶
Overview ¶
Package localcreds finds the GitHub tokens configured on this machine, so a report can say that a leaked token is not just out there but still in use right here.
Only fingerprints leave this package; token values are hashed as soon as they are read.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Match ¶
func Match(creds []Credential) map[string][]string
Match indexes credentials by fingerprint: the sources each token is configured in.
Types ¶
type Credential ¶
type Credential struct {
Fingerprint string
// Source says where it was found: a file path, an environment variable
// or a command.
Source string
}
Credential is one token configured locally, identified by fingerprint.
func Find ¶
func Find(ctx context.Context) []Credential
Find returns every GitHub token configured on this machine that patty knows where to look for. Missing files and failing commands are simply not credentials; Find never returns an error.
Click to show internal directories.
Click to hide internal directories.