config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminConfig

type AdminConfig struct {
	// HashedPassword is a bcrypt hash of the password for the admin account.
	HashedPassword string `envconfig:"ADMIN_ACCOUNT_PASSWORD_HASH" required:"true"`
	// TokenIssuer is the value to be used in the ISS claim of ID tokens issued for
	// the admin account.
	TokenIssuer string `envconfig:"ADMIN_ACCOUNT_TOKEN_ISSUER" required:"true"`
	// TokenAudience is the value to be used in the AUD claim of ID tokens issued
	// for the admin account.
	TokenAudience string `envconfig:"ADMIN_ACCOUNT_TOKEN_AUDIENCE" required:"true"`
	// TokenSigningKey is the key used to sign ID tokens for the admin account.
	TokenSigningKey []byte `envconfig:"ADMIN_ACCOUNT_TOKEN_SIGNING_KEY" required:"true"`
	// TokenTTL specifies how long ID tokens for the admin account are valid. i.e.
	// The expiry will be the time of issue plus this duration.
	TokenTTL time.Duration `envconfig:"ADMIN_ACCOUNT_TOKEN_TTL" default:"1h"`
}

AdminConfig represents configuration for an admin account.

func AdminConfigFromEnv

func AdminConfigFromEnv() AdminConfig

AdminConfigFromEnv returns an AdminConfig populated from environment variables.

type ArgoCDConfig

type ArgoCDConfig struct {
	Namespace string `envconfig:"ARGOCD_NAMESPACE" default:"argocd"`
	// URLs is a mapping from shard name to Argo CD URL
	URLs ArgoCDURLMap `envconfig:"ARGOCD_URLS"`
}

type ArgoCDURLMap

type ArgoCDURLMap map[string]string

func (*ArgoCDURLMap) Decode

func (a *ArgoCDURLMap) Decode(value string) error

type ServerConfig

type ServerConfig struct {
	StandardConfig
	LocalMode      bool
	TLSConfig      *TLSConfig
	OIDCConfig     *oidc.Config
	AdminConfig    *AdminConfig
	DexProxyConfig *dex.ProxyConfig
	ArgoCDConfig   ArgoCDConfig
}

func ServerConfigFromEnv

func ServerConfigFromEnv() ServerConfig

type StandardConfig

type StandardConfig struct {
	GracefulShutdownTimeout time.Duration `envconfig:"GRACEFUL_SHUTDOWN_TIMEOUT" default:"30s"`
	UIDirectory             string        `envconfig:"UI_DIR" default:"./ui/build"`
}

type TLSConfig

type TLSConfig struct {
	CertPath string `envconfig:"TLS_CERT_PATH" required:"true"`
	KeyPath  string `envconfig:"TLS_KEY_PATH" required:"true"`
}

func TLSConfigFromEnv

func TLSConfigFromEnv() TLSConfig

Jump to

Keyboard shortcuts

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