config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

This package defines environment configuration for Cookie settings

Index

Constants

This section is empty.

Variables

View Source
var (
	DriverOptions = []string{"postgres"}
)

Functions

func GenerateKeyPair

func GenerateKeyPair(bitsize int) (*rsa.PrivateKey, *rsa.PublicKey, error)

Types

type Config

type Config struct {
	AppPort            string
	Environment        string
	DBDriver           string
	DBConnectionString string
	DBDebug            bool
	JWTSecret          string
	JWTPrivateKey      *rsa.PrivateKey
	JWTPublicKey       *rsa.PublicKey
	APIAllowedOrigins  []string
	MetricsEnabled     bool
	MetricsPort        string
	SSO                *SSOConfig
}

func NewConfig

func NewConfig(logger *zap.SugaredLogger) *Config

type EnvironmentType added in v0.5.0

type EnvironmentType string
const (
	EnvironmentProduction  EnvironmentType = "production"
	EnvironmentLocal       EnvironmentType = "local"
	EnvironmentDevelopment EnvironmentType = "development"
	EnvironmentEmpty       EnvironmentType = ""
)

type SSOConfig added in v0.5.0

type SSOConfig struct {
	Enabled     bool                         `yaml:"enabled" json:"enabled" mapstructure:"enabled"`
	BaseURL     string                       `yaml:"base_url" json:"base_url" mapstructure:"base_url"`
	CallbackURL string                       `yaml:"callback_url" json:"callback_url" mapstructure:"callback_url"`
	Providers   map[string]SSOProviderConfig `yaml:"providers" json:"providers" mapstructure:"providers"`
}

func LoadSSOConfig added in v0.5.0

func LoadSSOConfig(path string) (*SSOConfig, error)

func (*SSOConfig) GetEnabledProviders added in v0.5.0

func (c *SSOConfig) GetEnabledProviders() []SSOProviderConfig

func (*SSOConfig) GetProvider added in v0.5.0

func (c *SSOConfig) GetProvider(name string) *SSOProviderConfig

type SSOProviderConfig added in v0.5.0

type SSOProviderConfig struct {
	Name                string              `yaml:"name" json:"name" mapstructure:"name"`
	DisplayName         string              `yaml:"display_name" json:"displayName" mapstructure:"display_name"`
	Provider            string              `yaml:"provider" json:"provider" mapstructure:"provider"` // google, github, generic
	Protocol            string              `yaml:"protocol" json:"protocol" mapstructure:"protocol"` // oidc or oauth
	IconURL             string              `yaml:"icon_url" json:"iconUrl" mapstructure:"icon_url"`
	RequiredLoginGroups []string            `yaml:"required_login_groups" json:"requiredLoginGroups" mapstructure:"required_login_groups"`
	RequiredAdminGroups []string            `yaml:"required_admin_groups" json:"requiredAdminGroups" mapstructure:"required_admin_groups"`
	ClientID            string              `yaml:"client_id" json:"clientId" mapstructure:"client_id"`
	ClientSecret        string              `yaml:"client_secret" json:"clientSecret" mapstructure:"client_secret"`
	IssuerURL           string              `yaml:"issuer_url" json:"issuerUrl" mapstructure:"issuer_url"`
	AuthURL             string              `yaml:"auth_url" json:"authUrl" mapstructure:"auth_url"`
	TokenURL            string              `yaml:"token_url" json:"tokenUrl" mapstructure:"token_url"`
	UserInfoURL         string              `yaml:"user_info_url" json:"userInfoUrl" mapstructure:"user_info_url"`
	EmailURL            string              `yaml:"email_url" json:"emailUrl" mapstructure:"email_url"`
	Scopes              []string            `yaml:"scopes" json:"scopes" mapstructure:"scopes"`
	Enabled             bool                `yaml:"enabled" json:"enabled" mapstructure:"enabled"`
	GroupMapping        map[string][]string `yaml:"group_mapping" json:"groupMapping" mapstructure:"group_mapping"`
}

Jump to

Keyboard shortcuts

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