scanexcl

package
v1.0.430 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 7 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 scanexcl holds the admin-managed scan-exclusion store: known-good SHA-256 content hashes and hostnames that bypass all body scanning. It is a self-contained leaf (stdlib + the hostutil seam) extracted from the flat package main per ADR-0002.

It is designed for an extreme read:write ratio (IsHashExcluded / IsHostExcluded run on every request; writes happen only when an admin updates the lists), so it uses sync.RWMutex per the read-heavy store convention.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store holds admin-managed exclusions: known-good content hashes and hostnames that bypass all body scanning.

func New

func New() *Store

New returns an empty Store ready for use.

func (*Store) IsHashExcluded

func (s *Store) IsHashExcluded(hash string) bool

IsHashExcluded reports whether the SHA-256 hex is on the hash allowlist. Hot path: called on every ScanBody invocation. RLock-only.

func (*Store) IsHostExcluded

func (s *Store) IsHostExcluded(host string) bool

IsHostExcluded reports whether the hostname is on the host allowlist. Hot path: called once per proxied HTTP request before buffering. RLock-only.

func (*Store) Lists

func (s *Store) Lists() (hashes, hosts []string)

Lists returns copies of the current hash and host lists, sorted for stable admin output.

func (*Store) Load

func (s *Store) Load(path string) error

Load reads the JSON file at path into the store. Missing file is not an error.

func (*Store) Replace

func (s *Store) Replace(hashes, hosts []string)

Replace atomically swaps the exclusion lists, normalising to lower case.

func (*Store) Save

func (s *Store) Save() error

Save persists the exclusion lists to the configured file path using an atomic tmp+rename write. No-op if no path configured.

Jump to

Keyboard shortcuts

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