localcreds

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

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