config

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MinCertificateValidityDays = 7
	MaxCertificateValidityDays = 30
)
View Source
const (
	TypeSystemsTask        = "sys:refresh"
	TypeCertificateTask    = "cert:rotate"
	TypeHYOKSync           = "key:sync"
	TypeKeystorePool       = "keystore:fill"
	TypeSendNotifications  = "notify:send"
	TypeWorkflowAutoAssign = "workflow:auto-assign"
	TypeWorkflowCleanup    = "workflow:cleanup"
	TypeWorkflowExpire     = "workflow:expire"
)

Variables

View Source
var (
	ErrConfigurationValuesError        = errors.New("configuration value error")
	ErrCertificateValidityOutsideRange = errors.New("certificate validity must not be outside 7 to 30 days")
	ErrNonDefinedTaskType              = errors.New("task type is unknown")
	ErrRepeatedTaskType                = errors.New("task type is specified more than once")

	ErrAMQPEmptyURL      = errors.New("AMQP URL must be specified")
	ErrAMQPEmptyTarget   = errors.New("AMQP target must be specified")
	ErrAMQPEmptySource   = errors.New("AMQP source must be specified")
	ErrTargetEmptyRegion = errors.New("target region must be specified")
)
View Source
var (
	ErrLoadMTLSConfig = errors.New("failed to load MTLS config")
)
View Source
var PeriodicTasks = map[string]Task{
	TypeSystemsTask: {
		Enabled:  true,
		Cronspec: "0 * * * *",
		Retries:  defaultRetryCount,
	},
	TypeHYOKSync: {
		Enabled:  true,
		Cronspec: "0 * * * *",
		Retries:  defaultRetryCount,
	},
	TypeKeystorePool: {
		Enabled:  true,
		Cronspec: "0 * * * *",
		Retries:  defaultRetryCount,
	},
	TypeCertificateTask: {
		Enabled:  true,
		Cronspec: "0 0 * * *",
		Retries:  defaultRetryCount,
	},
	TypeWorkflowExpire: {
		Enabled:  true,
		Cronspec: "0 1 * * *",
		Retries:  defaultRetryCount,
	},
	TypeWorkflowCleanup: {
		Enabled:  true,
		Cronspec: "0 2 * * *",
		Retries:  defaultRetryCount,
	},
}

PeriodicTasks defines the periodic tasks with their default configurations.

Functions

This section is empty.

Types

type AMQP

type AMQP struct {
	URL    string `yaml:"url"`
	Target string `yaml:"target"`
	Source string `yaml:"source"`
}

type Certificates

type Certificates struct {
	RootCertURL           string
	ValidityDays          int
	RotationThresholdDays int
}

Certificates holds certificates config

func (*Certificates) Validate

func (c *Certificates) Validate() error

type ClientData

type ClientData struct {
	// SigningKeysPath is the path where signing keys are mounted
	SigningKeysPath   string   `yaml:"signingKeysPath"`
	AuthContextFields []string `yaml:"authContextFields"`
}

ClientData holds signing keys path for client data signature verification and other client data fields

type Config

type Config struct {
	commoncfg.BaseConfig `mapstructure:",squash" yaml:",inline"`

	Database         Database                     `yaml:"database"`
	DatabaseReplicas []Database                   `yaml:"databaseReplicas"`
	Scheduler        Scheduler                    `yaml:"scheduler"`
	HTTP             HTTPServer                   `yaml:"http"`
	Plugins          []plugincatalog.PluginConfig `yaml:"plugins"`
	Services         Services                     `yaml:"services"`
	Certificates     Certificates                 `yaml:"certificates"`
	Provisioning     Provisioning                 `yaml:"provisioning"`

	ConfigurableContext commoncfg.SourceRef `yaml:"configurableContext"`
	ContextModels       ContextModels       // Loaded with ConfigurableContext

	ClientData  ClientData  `yaml:"clientData"`
	CryptoLayer CryptoLayer `yaml:"cryptoLayer"`

	TenantManager  TenantManager  `yaml:"tenantManager"`
	EventProcessor EventProcessor `yaml:"eventProcessor"`

	KeystorePool KeystorePool `yaml:"keystorePool"`
	Landscape    Landscape    `yaml:"landscape"`
}

Config holds all application configuration parameters

func LoadConfig

func LoadConfig(opts ...commoncfg.Option) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type ContextModels

type ContextModels struct {
	System System `yaml:"system"`
}

type CryptoLayer

type CryptoLayer struct {
	CertX509Trusts commoncfg.SourceRef `yaml:"certX509Trusts"`
}

type Database

type Database struct {
	Name     string              `yaml:"name"`
	Port     string              `yaml:"port"`
	Host     commoncfg.SourceRef `yaml:"host"`
	User     commoncfg.SourceRef `yaml:"user"`
	Secret   commoncfg.SourceRef `yaml:"secret"`
	Migrator Migrator            `yaml:"migrator"`
}

Database holds database config

type EventProcessor

type EventProcessor struct {
	SecretRef         commoncfg.SecretRef `yaml:"secretRef"`
	Targets           []Target            `yaml:"targets"`
	MaxReconcileCount int64               `yaml:"maxReconcileCount"`
}

func (*EventProcessor) Validate

func (e *EventProcessor) Validate() error

Validate checks the EventProcessor configuration values

type HTTPServer

type HTTPServer struct {
	Address         string        `yaml:"address" default:":8080"`
	ShutdownTimeout time.Duration `yaml:"shutdownTimeout" default:"5s"`
}

HTTPServer holds http server config

type InitKeystoreConfig

type InitKeystoreConfig struct {
	Enabled  bool
	Provider string              `yaml:"provider"`
	Value    KeystoreConfigValue `yaml:"value"`
}

type KeystoreConfigValue

type KeystoreConfigValue struct {
	LocalityID           string   `yaml:"localityId" json:"localityId"` //nolint:tagliatelle
	CommonName           string   `yaml:"commonName" json:"commonName"`
	ManagementAccessData any      `yaml:"managementAccessData" json:"managementAccessData"`
	SupportedRegions     []Region `yaml:"supportedRegions" json:"supportedRegions"`
}

type KeystorePool

type KeystorePool struct {
	Size     int           `yaml:"size" default:"5"`
	Interval time.Duration `yaml:"interval" default:"1h"`
}

type Landscape

type Landscape struct {
	Name      string `yaml:"name"`
	UIBaseUrl string `yaml:"uiBaseUrl"`
}

type MigrationPath

type MigrationPath struct {
	Schema string `yaml:"schema"`
	Data   string `yaml:"data"`
}

type Migrator

type Migrator struct {
	Shared MigrationPath `yaml:"shared"`
	Tenant MigrationPath `yaml:"tenant"`
}

type Provisioning

type Provisioning struct {
	InitKeystoreConfig InitKeystoreConfig
}

Provisioning config of application

type Redis

type Redis struct {
	Host      commoncfg.SourceRef `yaml:"host"`
	Port      string              `yaml:"port"`
	ACL       RedisACL            `yaml:"acl"`
	SecretRef commoncfg.SecretRef
}

Redis holds Redis client config

type RedisACL

type RedisACL struct {
	Enabled  bool                `yaml:"enabled"`
	Password commoncfg.SourceRef `yaml:"password"`
	Username commoncfg.SourceRef `yaml:"username"`
}

type Region

type Region struct {
	Name          string `json:"name"`
	TechnicalName string `json:"technicalName"`
}

type Scheduler

type Scheduler struct {
	TaskQueue Redis
	Tasks     []Task
}

Scheduler holds a scheduler config

func (*Scheduler) Validate

func (s *Scheduler) Validate() error

type Services

type Services struct {
	Registry       *commoncfg.GRPCClient `yaml:"registry" mapstructure:"registry"`
	SessionManager *commoncfg.GRPCClient `yaml:"sessionManager" mapstructure:"sessionManager"`
}

Services holds services config

type System

type System struct {
	Identifier         SystemProperty            `yaml:"identifier" mapstructure:"identifier"`
	Region             SystemProperty            `yaml:"region"  mapstructure:"region"`
	Type               SystemProperty            `yaml:"type" mapstructure:"type"`
	OptionalProperties map[string]SystemProperty `yaml:",inline" mapstructure:",remain"`
}

type SystemProperty

type SystemProperty struct {
	DisplayName string `yaml:"displayName" mapstructure:"displayName"`
	Internal    bool   `yaml:"internal" mapstructure:"internal"`
	Optional    bool   `yaml:"optional" mapstructure:"optional"`
	Default     any    `yaml:"default" mapstructure:"default"`
}

type Target

type Target struct {
	Region string `yaml:"region"`
	AMQP   AMQP   `yaml:"amqp"`
}

type Task

type Task struct {
	Enabled  bool
	Cronspec string
	TaskType string
	Retries  int
}

Task holds a task config

type TenantManager

type TenantManager struct {
	SecretRef commoncfg.SecretRef `yaml:"secretRef"`
	AMQP      AMQP                `yaml:"amqp"`
}

func (*TenantManager) Validate

func (t *TenantManager) Validate() error

Validate checks the TenantManager configuration values

Jump to

Keyboard shortcuts

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