validation

package
v1.69.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultSSRFValidator

type DefaultSSRFValidator struct{}

DefaultSSRFValidator implements SSRFValidator with full SSRF protection.

func NewDefaultSSRFValidator

func NewDefaultSSRFValidator() *DefaultSSRFValidator

NewDefaultSSRFValidator creates a new DefaultSSRFValidator.

func (*DefaultSSRFValidator) ValidateExternalURL

func (v *DefaultSSRFValidator) ValidateExternalURL(ctx context.Context, rawURL string) error

ValidateExternalURL validates that a URL is safe for external HTTP requests. It performs the following checks: 1. URL format is valid 2. Scheme is http or https only 3. Hostname is not localhost or variations 4. Domain name follows DNS naming conventions 5. All resolved IPs are not in private/reserved ranges.

type SSRFValidator

type SSRFValidator interface {
	// ValidateExternalURL checks if a URL is safe for external HTTP requests.
	ValidateExternalURL(ctx context.Context, rawURL string) error
}

SSRFValidator defines the interface for SSRF validation.

Jump to

Keyboard shortcuts

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