testsecret

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 0 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 testsecret builds synthetic, secret-shaped strings at RUNTIME for tests that must exercise the secret scanner and its adapters. No literal secret is ever committed to source, so the full-history secret scan (gitleaks git, fetch-depth 0 in CI) has nothing to find — see the principle secret-shaped-fixtures-at-runtime. A committed literal, even a fake one, trips the scan on the commit that added it and cannot be removed without a history rewrite, so the fixture is generated instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Synthetic

func Synthetic(seed uint64, n int) string

Synthetic returns a deterministic length-n high-entropy alphanumeric string shaped like a generic API key, built at runtime from seed. It is stable for a given (seed, n) so tests are reproducible, and it never appears verbatim in source. n is clamped to at least 1.

func SyntheticHex

func SyntheticHex(seed uint64, n int) string

SyntheticHex returns a deterministic length-n lower-case hex string built at runtime from seed — the other spelling an opaque identifier takes (a hex session id, and the runs a UUID is assembled out of). Same contract as Synthetic: stable for a given (seed, n), never verbatim in source, n clamped to at least 1.

Types

This section is empty.

Jump to

Keyboard shortcuts

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