config

package
v0.0.0-...-2045cfa Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessEntry

type AccessEntry struct {
	Role       Role        `yaml:"role"`
	Permission Permission  `yaml:"permission"`
	Target     ResourceUrn `yaml:"target"`
}

type Cluster

type Cluster struct {
	Id      ClusterId       `yaml:"id"`
	Hosts   map[string]Host `yaml:"hosts"`
	Kind    string          `yaml:"kind"`
	Repo    string          `yaml:"repo"`
	Runtime string          `yaml:"runtime"`
}

type ClusterId

type ClusterId struct {
	App     string `json:"app"     yaml:"app"`
	Region  string `json:"region"  yaml:"region"`
	Variant string `json:"variant" yaml:"variant"`
}

uniquely identifies them, enforce this constraint as needed (using as a map key, for instance)

type Config

type Config struct {
	// Port, Scheme for app-controld API
	AppControlDPort    int    `yaml:"appControlDPort"`
	AppControlDScheme  string `yaml:"appControlDScheme"`
	AppControlDPSKPath string `yaml:"appControlDPSKPath"`

	// Port for HTTPS API listener
	Port int `yaml:"port"`

	// HTTPS Timeouts
	ReadTimeoutS  int `yaml:"readTimeoutS"`
	WriteTimeoutS int `yaml:"writeTimeoutS"`

	// kubeconfig yaml path
	KubeConfigPath string `yaml:"kubeConfigPath"`

	// TLS material locations
	KeyPath string `yaml:"keyPath"`
	CrtPath string `yaml:"crtPath"`

	// Min log level
	LogLevel string `yaml:"logLevel"`

	// TLS Settings
	TLS *TLSConfig `yaml:"tls"`

	// Service Account Key file
	ServiceAccountKeyPath string `yaml:"serviceAccountKeyPath"`

	// Layout of the app clusters TODO - (statically configured for now, add discovery later)
	Topology Topology `yaml:"topology"`

	// Config for work queue client
	Queue QueueConfig `yaml:"queue"`

	// RBAC
	AuthnEnabled    bool                        `yaml:"authnEnabled"`
	RBACEnabled     bool                        `yaml:"rbacEnabled"`
	RoleMemberships map[Role][]GroupUrn         `yaml:"roleMemberships"`
	AccessEntries   []AccessEntry               `yaml:"accessEntries"`
	UsersByGroups   map[GroupUrn][]PrincipalUrn `yaml:"usersByGroups"`

	// ServiceAccounts for Secret access
	SecretsServiceAccounts []string `yaml:"secretsServiceAccounts"`
}

func Load

func Load(configPath string) *Config

Load the config from provided path

type Environment

type Environment struct {
	Clusters []Cluster `yaml:"clusters"`
}

type GroupUrn

type GroupUrn string

type Host

type Host struct {
	Canary bool `yaml:"canary"`
}

type Permission

type Permission string
const (
	Deploy        Permission = "deploy"
	Restart       Permission = "restart"
	SecretsList   Permission = "secretsList"
	SecretsRead   Permission = "secretsRead"
	SecretsCreate Permission = "secretsCreate"
	SecretsUpdate Permission = "secretsUpdate"
	SecretsDelete Permission = "secretsDelete"
)

type PrincipalUrn

type PrincipalUrn string

type QueueConfig

type QueueConfig struct {
	Project      string
	Topic        string
	Subscription string
}

type ResourceUrn

type ResourceUrn string

type Role

type Role string
const (
	Operator  Role = "operator"
	Developer Role = "developer"
	Manager   Role = "manager"
)

type RoleMemberships

type RoleMemberships map[Role][]string

type TLSConfig

type TLSConfig struct {
	// list of allowed ciphers
	Ciphers []string

	// minimum TLS version to use
	MinVersion string
}

type Topology

type Topology map[string]Environment

map of environment to clusters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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