custom

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package custom hosts the non-scoring "additional findings" checks. Each check is small, focused and self-contained; new ones plug in by adding an entry to All(). Findings never contribute to the TLS or Headers grade — they surface as the `custom` array in the scan response.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAll

func RunAll(ctx context.Context, target *safehttp.Target) []scan.CustomFinding

RunAll executes every registered check in parallel and returns the findings in registration order.

Types

type Check

type Check interface {
	// ID returns the check identifier used in API payloads and the catalog
	// (e.g. "custom.security_txt").
	ID() string
	// Run executes the check against target and returns its finding.
	// Implementations must never return an error — transport failures are
	// folded into the finding (typically as fail or info).
	Run(ctx context.Context, target *safehttp.Target) scan.CustomFinding
}

Check is the pluggable interface every custom check implements.

func All

func All() []Check

All returns the ordered list of registered checks. The order is preserved in the API output, which keeps the report deterministic.

type RobotsTxt

type RobotsTxt struct{}

RobotsTxt is the robots.txt check. Its primary security relevance is information leak: a Disallow line publicly advertises that a path exists.

func (RobotsTxt) ID

func (RobotsTxt) ID() string

ID implements Check.

func (RobotsTxt) Run

Run implements Check.

type SecurityTxt

type SecurityTxt struct{}

SecurityTxt is the RFC 9116 check.

func (SecurityTxt) ID

func (SecurityTxt) ID() string

ID implements Check.

func (SecurityTxt) Run

Run implements Check.

Jump to

Keyboard shortcuts

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