config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: BSD-3-Clause Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// EnvKubeconfig is used to configure the internal K8s client
	EnvKubeconfig = "KUBECONFIG"

	// EnvNamespace defines the K8s namespace that is used to keep the state of the service broker.
	EnvNamespace = "OSB_NAMESPACE"

	// EnvServiceIDs is a comma-separated list (no whitespace after comma!) of service ids available in the cluster
	EnvServiceIDs = "OSB_SERVICE_IDS"

	// EnvUsername defines the username to use when connecting to this service broker
	// when no JWT Bearer Token is presented.
	EnvUsername = "OSB_USERNAME"

	// EnvPassword defines the password to use when connecting to this service broker
	// when no JWT Bearer Token is presented.
	EnvPassword = "OSB_PASSWORD"

	// EnvUsernameClaim defines the name of the claim which is considered to be the username of the request principal
	// whenever a JWT Bearer Token is presented.
	EnvUsernameClaim = "OSB_USERNAME_CLAIM"

	// EnvHTTPListenAddr defines which port to listen on for HTTP requests.
	EnvHTTPListenAddr = "OSB_HTTP_LISTEN_ADDR"

	// EnvHTTPReadTimeout sets a read timeout for HTTP requests.
	EnvHTTPReadTimeout = "OSB_HTTP_READ_TIMEOUT"

	// EnvHTTPWriteTimeout sets a write timeout for HTTP requests.
	EnvHTTPWriteTimeout = "OSB_HTTP_WRITE_TIMEOUT"

	// EnvHTTPMaxHeaderBytes sets the maximum header size for HTTP requests.
	EnvHTTPMaxHeaderBytes = "OSB_HTTP_MAX_HEADER_BYTES"

	// EnvJWTKeyJWKURL sets the URL of a JWK file, which is used to validate the signatures of the JWT Bearer Tokens.
	EnvJWTKeyJWKURL = "OSB_JWT_KEYS_JWK_URL"

	// EnvJWTKeyPEMURL sets the URL of a PEM file, which is used to validate the signatures of the JWT Bearer Tokens.
	EnvJWTKeyPEMURL = "OSB_JWT_KEYS_PEM_URL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Kubeconfig     string
	ServiceIDs     []string
	ListenAddr     string
	Username       string
	Password       string
	UsernameClaim  string
	JWKeyRegister  *jwt.KeyRegister
	Namespace      string
	ReadTimeout    time.Duration
	WriteTimeout   time.Duration
	MaxHeaderBytes int
}

Config contains all configuration values.

func ReadConfig

func ReadConfig(getEnv GetEnv) (*Config, error)

ReadConfig reads env variables using the passed function.

type GetEnv added in v0.4.0

type GetEnv func(string) string

GetEnv is an interface that allows to get variables from the environment

Jump to

Keyboard shortcuts

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