backends

package
v1.4.41 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMethodType

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

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

func NewBackend(cfg *Config, logger *zap.Logger, cache cache.Cache) (*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

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

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

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

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