backends

package
v1.4.39 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMethodType added in v1.4.7

type AuthMethodType int

AuthMethodType identifies authentication provider type.

const (
	// Unknown is unknown provider type..
	Unknown AuthMethodType = iota
	// Local provides authentication with local database.
	Local
	// Ldap provides authentication with LDAP database.
	Ldap
	// Saml provides authentication with SAML.
	Saml
	// OAuth2 provides authentication with OAuth2.0/OpenID.
	OAuth2
)

func (AuthMethodType) String added in v1.4.7

func (m AuthMethodType) String() string

String returns the description for AuthMethodType enum.

type Backend

type Backend struct {
	Method AuthMethodType
	// contains filtered or unexported fields
}

Backend is an authentication backend.

func NewBackend added in v1.4.7

func NewBackend(cfg *Config, logger *zap.Logger) (*Backend, error)

NewBackend returns Backend instance.

func (*Backend) Configure

func (b *Backend) Configure() error

Configure configures backend with the authentication provider settings.

func (*Backend) GetConfig added in v1.4.7

func (b *Backend) GetConfig() string

GetConfig returns Backend configuration.

func (*Backend) GetMethod

func (b *Backend) GetMethod() string

GetMethod returns the authentication method associated with an authentication provider.

func (*Backend) GetName

func (b *Backend) GetName() string

GetName returns the name associated with an authentication provider.

func (*Backend) GetRealm

func (b *Backend) GetRealm() string

GetRealm returns realm associated with an authentication provider.

func (*Backend) Request added in v1.4.7

func (b *Backend) Request(op operator.Type, r *requests.Request) error

Request performs the requested backend operation.

func (*Backend) Validate

func (b *Backend) Validate() error

Validate checks whether an authentication provider is functional.

type BackendDriver

type BackendDriver interface {
	GetRealm() string
	GetName() string
	GetMethod() string
	GetConfig() string
	Configure() error
	Validate() error
	Request(operator.Type, *requests.Request) error
}

BackendDriver is an interface to an authentication provider.

type Config added in v1.4.7

type Config struct {
	Local  *local.Config  `json:"local,omitempty" xml:"local" yaml:"local,omitempty"`
	Ldap   *ldap.Config   `json:"ldap,omitempty" xml:"ldap" yaml:"ldap,omitempty"`
	Saml   *saml.Config   `json:"saml,omitempty" xml:"saml" yaml:"saml,omitempty"`
	OAuth2 *oauth2.Config `json:"oauth2,omitempty" xml:"oauth2" yaml:"oauth2,omitempty"`
	// contains filtered or unexported fields
}

Config holds configuration for one of the supported authentication backends.

func NewConfig added in v1.4.7

func NewConfig(m map[string]interface{}) (*Config, error)

NewConfig returns Config instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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