auth

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	Plain       PlainAuthenticator
	OAuthBearer OAuthBearerAuthenticator
}

func New

func New(driver, source string) (*Authenticator, error)

func NewInternal

func NewInternal() *Authenticator

type Error

type Error struct {
	// Internal error cause. This will not be revealed to the user.
	InternalErr error
	// Message which can safely be sent to the user without compromising
	// security.
	ExternalMsg string
}

Error is an authentication error.

func (*Error) Error

func (err *Error) Error() string

func (*Error) Unwrap

func (err *Error) Unwrap() error

type OAuthBearerAuthenticator

type OAuthBearerAuthenticator interface {
	AuthOAuthBearer(ctx context.Context, db database.Database, token string) (username string, err error)
}

type OAuthPlainAuthenticator added in v0.9.0

type OAuthPlainAuthenticator struct {
	OAuthBearer OAuthBearerAuthenticator
}

func (OAuthPlainAuthenticator) AuthPlain added in v0.9.0

func (auth OAuthPlainAuthenticator) AuthPlain(ctx context.Context, db database.Database, username, password string) error

type PlainAuthenticator

type PlainAuthenticator interface {
	AuthPlain(ctx context.Context, db database.Database, username, password string) error
}

Jump to

Keyboard shortcuts

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