config

package
v0.0.0-...-461217a Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name     string
	Listen   string
	Secret   string
	OIDC     OIDC
	TLS      TLS
	Web      Web
	Metrics  Metrics
	Clusters []Cluster
}

App is the loginapp configuration set

func (*App) AddFlags

func (a *App) AddFlags(cmd *cobra.Command)

AddFlags init common App flags

func (*App) Init

func (a *App) Init() error

Init load configuration, and run error/warning checks

type Check

type Check struct {
	FailedCondition bool
	Message         string
	DefaultAction   func()
}

Check is a configuration check used by check function

func (*Check) Check

func (c *Check) Check() bool

Check checks if the check DefaultAction fails or not Return true if check pass Return false if check fails

type Cluster

type Cluster struct {
	Name                  string
	Server                string
	InsecureSkipTLSVerify bool   `mapstructure:"insecure-skip-tls-verify"`
	CertificateAuthority  string `mapstructure:"certificate-authority"`
	ContextName           string
}

Cluster describes a Kubernetes cluster

func (*Cluster) Base64Cert

func (c *Cluster) Base64Cert() string

Base64Cert convert a plain text certificate to a base64 encoded string

type Metrics

type Metrics struct {
	Port int
}

Metrics is the exported metrics configuration

func (*Metrics) AddFlags

func (m *Metrics) AddFlags(cmd *cobra.Command)

AddFlags init metrics flags

type OIDC

type OIDC struct {
	Client         OIDCClient
	Issuer         OIDCIssuer
	Extra          OIDCExtra
	OfflineAsScope bool
	CrossClients   []string
	Scopes         []string
}

OIDC is the OpenID configuration

func (*OIDC) AddFlags

func (o *OIDC) AddFlags(cmd *cobra.Command)

AddFlags init oidc flags

type OIDCClient

type OIDCClient struct {
	ID          string
	Secret      string
	RedirectURL string
}

OIDCClient is the client OpenID configuration

func (*OIDCClient) AddFlags

func (oc *OIDCClient) AddFlags(cmd *cobra.Command)

AddFlags init oidc client flags

type OIDCExtra

type OIDCExtra struct {
	Scopes       []string
	AuthCodeOpts map[string]string
}

OIDCIssuer is the extra OpenID configuration supported

func (*OIDCExtra) AddFlags

func (oe *OIDCExtra) AddFlags(cmd *cobra.Command)

AddFlags init oidc extra flags

type OIDCIssuer

type OIDCIssuer struct {
	URL                string
	RootCA             string
	InsecureSkipVerify bool
}

OIDCIssuer is the issuer OpenID configuration

func (*OIDCIssuer) AddFlags

func (oi *OIDCIssuer) AddFlags(cmd *cobra.Command)

AddFlags init oidc issuer flags

type TLS

type TLS struct {
	Enabled bool
	Cert    string
	Key     string
}

TLS is the tls configuration, required to configure HTTPS endpoint for Loginapp

func (*TLS) AddFlags

func (t *TLS) AddFlags(cmd *cobra.Command)

AddFlags init tls flags

type Web

type Web struct {
	MainUsernameClaim string
	MainClientID      string
	TemplatesDir      string
	AssetsDir         string
	Kubeconfig        WebKubeconfig
}

Web is the web output configuration, mainly used to customize output

func (*Web) AddFlags

func (w *Web) AddFlags(cmd *cobra.Command)

AddFlags init web flags

type WebKubeconfig

type WebKubeconfig struct {
	DefaultCluster   string
	DefaultNamespace string
	DefaultContext   string
	ExtraOpts        map[string]string
}

WebKubeconfig manages default web output for kubeconfig

func (*WebKubeconfig) AddFlags

func (wk *WebKubeconfig) AddFlags(cmd *cobra.Command)

AddFlags init web kubeconfig flags

Jump to

Keyboard shortcuts

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