web

package
v0.92.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 46 Imported by: 0

Documentation

Overview

Package web provides a web UI module with server-rendered HTML pages.

Index

Constants

View Source
const Name = "web"

Variables

This section is empty.

Functions

func InitForE2E

func InitForE2E(configData json.RawMessage) error

InitForE2E initializes the web module handler for e2e testing. It calls the package-level handler.Init with the provided JSON config, bypassing the uber/fx dependency injection used in production.

func MountForE2E

func MountForE2E(app *fiber.App)

MountForE2E mounts web module routes onto the given Fiber app.

func Register

func Register()

Register registers the web module handler.

func SetLoginRateLimiterCache

func SetLoginRateLimiterCache(s *cache.RedisStore)

SetLoginRateLimiterCache sets the cache backend for the login rate limiter. Must be called after Init if BruteForce is enabled.

Types

type AuthConfig

type AuthConfig struct {
	Username   string           `json:"username"`
	Password   string           `json:"password"`
	BruteForce BruteForceConfig `json:"brute_force"`
}

AuthConfig holds web login authentication credentials read from the module config.

type BruteForceConfig

type BruteForceConfig struct {
	Enabled         bool   `json:"enabled"`
	MaxAttempts     int64  `json:"max_attempts"`
	LockoutAttempts int64  `json:"lockout_attempts"`
	LockoutDuration string `json:"lockout_duration"`
	WindowDuration  string `json:"window_duration"`
}

BruteForceConfig holds brute force protection settings for the login endpoint.

Jump to

Keyboard shortcuts

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