trustedip

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateRUT

func ValidateRUT(rut string) (string, error)

ValidateRUT normalizes and checksum-validates a Chilean RUT. Pure, stateless — no ports, no DB — so both this package's Mount handler and authority/credentials_lan.go (LoginLAN, RegisterLAN — direct, non-HTTP entry points kept for admin use and unit testing) call the exact SAME algorithm. Body copied verbatim from the current authority/lan.go — do not rewrite the checksum logic, only relocate it.

Types

type Authenticator

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

func New

func New(store user.IdentityStore, trusted user.TrustedIPStore, sessions user.SessionIssuer, notify user.SecurityNotifier, trustProxy bool, opts ...Option) *Authenticator

New builds the trusted-IP mode. trustProxy is required (not an Option): this mode's entire security property is "the request's real IP is on the allowlist" — silently defaulting it to false behind a real proxy would make every request look like it came from the proxy's own IP.

func (*Authenticator) Mount

func (a *Authenticator) Mount(r router.Router)

func (*Authenticator) Name

func (a *Authenticator) Name() string

type Option

type Option func(*Authenticator)

func WithAfterLogin

func WithAfterLogin(path string) Option

Jump to

Keyboard shortcuts

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