backends

package
v1.3.11-0...-37b438a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	UserRoleMapList []map[string]interface{} `json:"user_roles,omitempty"`
	// contains filtered or unexported fields
}

Backend is an authentication backend.

func NewBackendFromBytes

func NewBackendFromBytes(name, method string, data []byte) (*Backend, error)

NewBackendFromBytes returns backend instance based on authentication method and JSON configuration data.

func NewLdapBackendFromBytes

func NewLdapBackendFromBytes(name string, data []byte) (*Backend, error)

NewLdapBackendFromBytes returns LDAP backend.

func NewLocalBackendFromBytes

func NewLocalBackendFromBytes(name string, data []byte) (*Backend, error)

NewLocalBackendFromBytes returns local backend.

func (*Backend) Authenticate

func (b *Backend) Authenticate(opts map[string]interface{}) (map[string]interface{}, error)

Authenticate performs authentication with an authentication provider.

func (*Backend) Configure

func (b *Backend) Configure(opts map[string]interface{}) error

Configure configures backend with the authentication provider settings.

func (*Backend) Do

func (b *Backend) Do(opts map[string]interface{}) error

Do performs the requested operation.

func (*Backend) GetMethod

func (b *Backend) GetMethod() string

GetMethod returns the authentication method associated with an authentication provider.

func (*Backend) GetMfaTokens

func (b *Backend) GetMfaTokens(opts map[string]interface{}) ([]*identity.MfaToken, error)

GetMfaTokens return a list of MFA tokens associated with a user.

func (*Backend) GetName

func (b *Backend) GetName() string

GetName returns the name associated with an authentication provider.

func (*Backend) GetPublicKeys

func (b *Backend) GetPublicKeys(opts map[string]interface{}) ([]*identity.PublicKey, error)

GetPublicKeys return a list of public keys associated with a user.

func (*Backend) GetRealm

func (b *Backend) GetRealm() string

GetRealm returns realm associated with an authentication provider.

func (Backend) MarshalJSON

func (b Backend) MarshalJSON() ([]byte, error)

MarshalJSON packs configuration info JSON byte array

func (*Backend) SupplementClaims

func (b *Backend) SupplementClaims(claims *jwtclaims.UserClaims)

func (*Backend) UnmarshalJSON

func (b *Backend) UnmarshalJSON(data []byte) error

UnmarshalJSON unpacks configuration into appropriate structures.

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
	Authenticate(map[string]interface{}) (map[string]interface{}, error)
	ConfigureLogger(*zap.Logger) error
	ConfigureTokenProvider(*jwtconfig.CommonTokenConfig) error
	ConfigureAuthenticator() error
	Validate() error
	Do(map[string]interface{}) error
	GetPublicKeys(map[string]interface{}) ([]*identity.PublicKey, error)
	GetMfaTokens(map[string]interface{}) ([]*identity.MfaToken, error)
}

BackendDriver is an interface to an authentication provider.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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