remoteauthenticator

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadConfig = errors.New("invalid configuration")

Functions

This section is empty.

Types

type AuthenticationRequest

type AuthenticationRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AuthenticationRequest is the request object that will be sent to the remote authenticator service as JSON payload in a POST request

type AuthenticationResponse

type AuthenticationResponse struct {
	// ExternalUserIdentifier is optional, if returned then the user will be used as the official username in lakeFS
	ExternalUserIdentifier *string `json:"external_user_identifier,omitempty"`
}

AuthenticationResponse is the expected response from the remote authenticator service

type Authenticator

type Authenticator struct {
	AuthService auth.Service
	Logger      logging.Logger
	Config      AuthenticatorConfig
	// contains filtered or unexported fields
}

Authenticator client

func NewAuthenticator

func NewAuthenticator(conf AuthenticatorConfig, authService auth.Service, logger logging.Logger) (*Authenticator, error)

func (*Authenticator) AuthenticateUser

func (ra *Authenticator) AuthenticateUser(ctx context.Context, username, password string) (string, error)

func (*Authenticator) String

func (ra *Authenticator) String() string

type AuthenticatorConfig

type AuthenticatorConfig struct {
	// Enabled if set true will enable authenticator
	Enabled bool
	// Endpoint URL of the remote authentication service (e.g. https://my-auth.example.com/auth)
	Endpoint string
	// DefaultUserGroup is the default group for the users authenticated by the remote service
	DefaultUserGroup string
	// RequestTimeout timeout for remote authentication requests
	RequestTimeout time.Duration
}

AuthenticatorConfig holds authentication configuration.

Jump to

Keyboard shortcuts

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