GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Why Go
  • Case Studies
  • Use Cases
  • Security
  • Learn
  • Effective Go
  • Go User Manual
  • Standard library
  • Release Notes
  • API
  • Packages
  • Recorded Talks
  • Meetups
  • Conferences

This view

  • Original page
  • New address

GeezerVison is showing pkg.go.dev — secrets package - github.com/majorcontext/keep/internal/secrets - Go Packages

Details

  • checked Valid go.mod file

    The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.

  • checked Redistributable license

    Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.

  • checked Tagged version

    Modules with tagged versions give importers more predictable builds.

  • unchecked Stable version

    When a project reaches major version v1 it is considered stable.

  • Learn more about best practices

Repository

github.com/majorcontext/keep

Links

  • Open Source Insights Logo Open Source Insights

Documentation ¶

Index ¶

  • type Detector
    • func NewDetector() (*Detector, error)
    • func (d *Detector) Detect(text string) []Finding
    • func (d *Detector) Redact(text string) (string, []Finding)
  • type Finding

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

This section is empty.

Types ¶

type Detector ¶

type Detector struct {
	// contains filtered or unexported fields
}

Detector wraps the gitleaks detector for secret detection.

func NewDetector ¶

func NewDetector() (*Detector, error)

NewDetector creates a Detector with gitleaks default config (~160 patterns).

func (*Detector) Detect ¶

func (d *Detector) Detect(text string) []Finding

Detect scans text and returns all secret findings. Safe to call on nil receiver (returns nil).

func (*Detector) Redact ¶

func (d *Detector) Redact(text string) (string, []Finding)

Redact scans text, replaces each detected secret with [REDACTED:<RuleID>], and returns the redacted string plus the findings. Safe to call on nil receiver (returns original text, nil).

type Finding ¶

type Finding struct {
	RuleID      string // e.g. "aws-access-key"
	Description string // human-readable description from gitleaks
	Match       string // the matched text
}

Finding represents a detected secret.

Source Files ¶

View all Source files
  • secrets.go
Click to show internal directories.
Click to hide internal directories.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.