config

package
v1.16.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RouteTypes is an array of the available route types
	RouteTypes = []RouteType{QueryRoute, RegexRoute, PrefixRoute}
)

Functions

func GetEnv added in v1.16.0

func GetEnv(cfg *Config) []string

GetEnv fetches a list of known env variables for this extension. It is to be used by gookit, as it provides a list with all the environment variables an extension supports.

func StructMappings added in v1.16.0

func StructMappings(cfg *Config) []shared.EnvBinding

StructMappings binds a set of environment variables to a destination on cfg. Iterating over this set and editing the Destination value of a binding will alter the original value, as it is a pointer to its memory address. This lets us propagate changes easier.

Types

type Auth

type Auth struct {
	CredentialsByUserAgent map[string]string `ocisConfig:""`
}

Auth configures proxy http auth middleware.

type Cache

type Cache struct {
	Size int `ocisConfig:"size"`
	TTL  int `ocisConfig:"ttl"`
}

Cache is a TTL cache configuration.

type ClaimsSelectorConf

type ClaimsSelectorConf struct {
	DefaultPolicy         string `ocisConfig:"default_policy"`
	UnauthenticatedPolicy string `ocisConfig:"unauthenticated_policy"`
	SelectorCookieName    string `ocisConfig:"selector_cookie_name"`
}

ClaimsSelectorConf is the config for the claims-selector

type Config

type Config struct {
	*shared.Commons

	Log                   *shared.Log     `ocisConfig:"log"`
	Debug                 Debug           `ocisConfig:"debug"`
	HTTP                  HTTP            `ocisConfig:"http"`
	Service               Service         `ocisConfig:"service"`
	Tracing               Tracing         `ocisConfig:"tracing"`
	Policies              []Policy        `ocisConfig:"policies"`
	OIDC                  OIDC            `ocisConfig:"oidc"`
	TokenManager          TokenManager    `ocisConfig:"token_manager"`
	PolicySelector        *PolicySelector `ocisConfig:"policy_selector"`
	Reva                  Reva            `ocisConfig:"reva"`
	PreSignedURL          PreSignedURL    `ocisConfig:"pre_signed_url"`
	AccountBackend        string          `ocisConfig:"account_backend"`
	UserOIDCClaim         string          `ocisConfig:"user_oidc_claim"`
	UserCS3Claim          string          `ocisConfig:"user_cs3_claim"`
	MachineAuthAPIKey     string          `ocisConfig:"machine_auth_api_key"`
	AutoprovisionAccounts bool            `ocisConfig:"auto_provision_accounts"`
	EnableBasicAuth       bool            `ocisConfig:"enable_basic_auth"`
	InsecureBackends      bool            `ocisConfig:"insecure_backends"`

	Context    context.Context
	Supervised bool
}

Config combines all available configuration parts.

func DefaultConfig added in v1.16.0

func DefaultConfig() *Config

DefaultConfig provides with a working local configuration for a proxy service.

func New

func New() *Config

New initializes a new configuration

type Debug

type Debug struct {
	Addr   string `ocisConfig:"addr"`
	Token  string `ocisConfig:"token"`
	Pprof  bool   `ocisConfig:"pprof"`
	Zpages bool   `ocisConfig:"zpages"`
}

Debug defines the available debug configuration.

type HTTP

type HTTP struct {
	Addr    string `ocisConfig:"addr"`
	Root    string `ocisConfig:"root"`
	TLSCert string `ocisConfig:"tls_cert"`
	TLSKey  string `ocisConfig:"tls_key"`
	TLS     bool   `ocisConfig:"tls"`
}

HTTP defines the available http configuration.

type Log

type Log struct {
	Level  string `ocisConfig:"level"`
	Pretty bool   `ocisConfig:"pretty"`
	Color  bool   `ocisConfig:"color"`
	File   string `ocisConfig:"file"`
}

Log defines the available logging configuration.

type Middleware

type Middleware struct {
	Auth Auth `ocisConfig:"middleware"`
}

Middleware configures proxy middlewares.

type MigrationSelectorConf

type MigrationSelectorConf struct {
	AccFoundPolicy        string `ocisConfig:"acc_found_policy"`
	AccNotFoundPolicy     string `ocisConfig:"acc_not_found_policy"`
	UnauthenticatedPolicy string `ocisConfig:"unauthenticated_policy"`
}

MigrationSelectorConf is the config for the migration-selector

type OIDC

type OIDC struct {
	Issuer        string `ocisConfig:"issuer"`
	Insecure      bool   `ocisConfig:"insecure"`
	UserinfoCache Cache  `ocisConfig:"user_info_cache"`
}

OIDC is the config for the OpenID-Connect middleware. If set the proxy will try to authenticate every request with the configured oidc-provider

type Policy

type Policy struct {
	Name   string  `ocisConfig:"name"`
	Routes []Route `ocisConfig:"routes"`
}

Policy enables us to use multiple directors.

func DefaultPolicies added in v1.16.0

func DefaultPolicies() []Policy

type PolicySelector

type PolicySelector struct {
	Static    *StaticSelectorConf    `ocisConfig:"static"`
	Migration *MigrationSelectorConf `ocisConfig:"migration"`
	Claims    *ClaimsSelectorConf    `ocisConfig:"claims"`
	Regex     *RegexSelectorConf     `ocisConfig:"regex"`
}

PolicySelector is the toplevel-configuration for different selectors

type PreSignedURL

type PreSignedURL struct {
	AllowedHTTPMethods []string `ocisConfig:"allowed_http_methods"`
	Enabled            bool     `ocisConfig:"enabled"`
}

PreSignedURL is the config for the presigned url middleware

type RegexRuleConf

type RegexRuleConf struct {
	Priority int    `ocisConfig:"priority"`
	Property string `ocisConfig:"property"`
	Match    string `ocisConfig:"match"`
	Policy   string `ocisConfig:"policy"`
}

type RegexSelectorConf

type RegexSelectorConf struct {
	DefaultPolicy         string          `ocisConfig:"default_policy"`
	MatchesPolicies       []RegexRuleConf `ocisConfig:"matches_policies"`
	UnauthenticatedPolicy string          `ocisConfig:"unauthenticated_policy"`
	SelectorCookieName    string          `ocisConfig:"selector_cookie_name"`
}

RegexSelectorConf is the config for the regex-selector

type Reva

type Reva struct {
	Address    string     `ocisConfig:"address"`
	Middleware Middleware `ocisConfig:"middleware"`
}

Reva defines all available REVA configuration.

type Route

type Route struct {
	Type        RouteType `ocisConfig:"type"`
	Endpoint    string    `ocisConfig:"endpoint"`
	Backend     string    `ocisConfig:"backend"`
	ApacheVHost bool      `ocisConfig:"apache-vhost"`
}

Route define forwarding routes

type RouteType

type RouteType string

RouteType defines the type of a route

const (
	// PrefixRoute are routes matched by a prefix
	PrefixRoute RouteType = "prefix"
	// QueryRoute are routes matched by a prefix and query parameters
	QueryRoute RouteType = "query"
	// RegexRoute are routes matched by a pattern
	RegexRoute RouteType = "regex"
	// DefaultRouteType is the PrefixRoute
	DefaultRouteType RouteType = PrefixRoute
)

type Service

type Service struct {
	Name      string `ocisConfig:"name"`
	Namespace string `ocisConfig:"namespace"`
	Version   string `ocisConfig:"version"`
}

Service defines the available service configuration.

type StaticSelectorConf

type StaticSelectorConf struct {
	Policy string `ocisConfig:"policy"`
}

StaticSelectorConf is the config for the static-policy-selector

type TokenManager

type TokenManager struct {
	JWTSecret string `ocisConfig:"jwt_secret"`
}

TokenManager is the config for using the reva token manager

type Tracing

type Tracing struct {
	Enabled   bool   `ocisConfig:"enabled"`
	Type      string `ocisConfig:"type"`
	Endpoint  string `ocisConfig:"endpoint"`
	Collector string `ocisConfig:"collector"`
	Service   string `ocisConfig:"service"`
}

Tracing defines the available tracing configuration.

Jump to

Keyboard shortcuts

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