config

package
v1.12.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrJWTSecretNotConfigured = errors.New("JWT_SECRET environment variable must be set with at least 32 bytes")

ErrJWTSecretNotConfigured is returned when JWT_SECRET is not set or too short

Functions

func GenerateRandomSecret added in v1.10.0

func GenerateRandomSecret(length int) (string, error)

GenerateRandomSecret creates a cryptographically secure random secret This can be used by administrators to generate a secure JWT_SECRET value

func ValidateJWTSecret added in v1.10.0

func ValidateJWTSecret(secret string) error

ValidateJWTSecret checks if the JWT secret meets security requirements SECURITY FIX: Validates that JWT secret is configured and meets minimum length

Types

type Config

type Config struct {
	Port             int
	TLSCert          string
	TLSKey           string
	JWTSecret        string
	SessionTimeout   int // minutes
	IPWhitelistFile  string
	AuditLogFile     string
	RequiredGroup    string
	BlockRootLogin   bool
	MaxLoginAttempts int
	LockoutDuration  int // minutes
}

Config holds the application configuration

func Load

func Load(path string) (*Config, error)

Load reads configuration from file

func (*Config) Save

func (c *Config) Save(path string) error

Save writes configuration to file

Jump to

Keyboard shortcuts

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