config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is set at build time

Functions

func GenerateSecret

func GenerateSecret() string

Types

type Config

type Config struct {
	// Server-level settings (from JSON file)
	Port     int    `json:"port"`
	KeyFile  string `json:"keyFile"`
	DBFile   string `json:"dbFile"`
	AdminKey string `json:"adminKey"`

	// OIDC settings (from SQLite, with defaults)
	Issuer               string            `json:"-"`
	BasePath             string            `json:"-"`
	RedirectURIs         []string          `json:"-"`
	ClientIDs            []string          `json:"-"`
	TenantID             string            `json:"-"`
	TokenLifetime        int               `json:"-"` // Deprecated: use AccessTokenLifetime
	AccessTokenLifetime  int               `json:"-"` // seconds, default 300 (5 min)
	RefreshTokenLifetime int               `json:"-"` // seconds, default 86400 (24 hr)
	SessionSecret        string            `json:"-"`
	GroupMapping         map[string]string `json:"-"`
	DisplayName          string            `json:"-"`
	CORSOrigins          []string          `json:"-"`
}

func Load

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

func (*Config) GetAccessTokenLifetime

func (c *Config) GetAccessTokenLifetime() int

GetAccessTokenLifetime returns the access token lifetime in seconds

func (*Config) GetCORSOrigins

func (c *Config) GetCORSOrigins() []string

GetCORSOrigins returns configured CORS origins

func (*Config) GetClientIDs

func (c *Config) GetClientIDs() []string

func (*Config) GetRefreshTokenLifetime

func (c *Config) GetRefreshTokenLifetime() int

GetRefreshTokenLifetime returns the refresh token lifetime in seconds

func (*Config) IsValidClientID

func (c *Config) IsValidClientID(id string) bool

func (*Config) IsValidRedirectURI

func (c *Config) IsValidRedirectURI(uri string) bool

func (*Config) LoadFromStore

func (c *Config) LoadFromStore(getConfig func(key string) (string, error), getSlice func(key string) ([]string, error), getMap func(key string) (map[string]string, error))

func (*Config) NormalizedBasePath

func (c *Config) NormalizedBasePath() string

Jump to

Keyboard shortcuts

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