auth

package
v0.0.0-...-0001d10 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthInsecure = "insecure"
	AuthOauth    = "oauth"
)

Variables

View Source
var NewAuth = FactoryFunc(func(config *Config) (core.Auth, error) {
	if len(config.Providers) == 0 {
		return &core.NilAuth{}, nil
	} else if len(config.Providers) == 1 {
		return config.Providers[0], nil
	}
	multiAuth := new(core.MultiAuth)
	for _, p := range config.Providers {
		multiAuth.Add(p)
	}
	return multiAuth, nil
})

Functions

This section is empty.

Types

type AuthProvider

type AuthProvider string

type Config

type Config struct {
	Providers []core.Auth
}

Config sets the configuration for the authentication mechanism to use

func (*Config) Bind

func (c *Config) Bind(v *viper.Viper, cmd *cobra.Command) error

func (*Config) Configure

func (c *Config) Configure(v *viper.Viper) error

func (*Config) Log

func (c *Config) Log(fields log.Fields)

type Factory

type Factory interface {
	New(*Config) (core.Auth, error)
}

type FactoryFunc

type FactoryFunc func(*Config) (core.Auth, error)

func (FactoryFunc) New

func (f FactoryFunc) New(config *Config) (core.Auth, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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