dirprotect

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoundSessionToken

func BoundSessionToken(rule Rule, clientIP, userAgent string, issuedAt time.Time) string

func BoundSessionTokenValid

func BoundSessionTokenValid(rule Rule, token, clientIP, userAgent string, now time.Time, ttl time.Duration) bool

func CleanPath

func CleanPath(rawPath string) string

func CookieName

func CookieName(domain, pagePath string) string

func FailureDomain

func FailureDomain(domain, pagePath string) string

func FailureDomainPrefix

func FailureDomainPrefix(domain string) string

func HasProtectedPrefix

func HasProtectedPrefix(pagePath, protectedPrefix string) bool

func Hash

func Hash(password string) (string, error)

func Matches

func Matches(storedHash, password string) bool

func NormalizeDomain

func NormalizeDomain(domain string) string

func PrefixFileBody

func PrefixFileBody(rules []Rule) []byte

Types

type Rule

type Rule struct {
	Domain       string
	Path         string
	PasswordHash string
}

func FindBestRule

func FindBestRule(domain, pagePath string, rules []Rule) (Rule, bool)

func FindBestRuleInPrefixData

func FindBestRuleInPrefixData(domain, pagePath string, prefixData []byte) (Rule, bool)

func ParsePrefixLine

func ParsePrefixLine(domain, rawLine string) (Rule, bool)

Jump to

Keyboard shortcuts

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