auth

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrBadCredentials added in v0.12.4

func IsErrBadCredentials(err error) bool

IsErrBadCredentials returns true if the underlying error has the type ErrBadCredentials.

func Name added in v0.12.4

func Name(typ Type) string

Name returns the human-readable name for given authentication type.

Types

type ErrBadCredentials added in v0.12.4

type ErrBadCredentials struct {
	Args errutil.Args
}

func (ErrBadCredentials) Error added in v0.12.4

func (err ErrBadCredentials) Error() string

func (ErrBadCredentials) NotFound added in v0.12.4

func (ErrBadCredentials) NotFound() bool

type ExternalAccount added in v0.12.4

type ExternalAccount struct {
	// REQUIRED: The login to be used for authenticating against the provider.
	Login string
	// REQUIRED: The username of the account.
	Name string
	// The full name of the account.
	FullName string
	// The email address of the account.
	Email string
	// The location of the account.
	Location string
	// The website of the account.
	Website string
	// Whether the user should be prompted as a site admin.
	Admin bool
}

ExternalAccount contains queried information returned by an authenticate provider for an external account.

type Provider added in v0.12.4

type Provider interface {
	// Authenticate performs authentication against an external identity provider
	// using given credentials and returns queried information of the external account.
	Authenticate(login, password string) (*ExternalAccount, error)

	// Config returns the underlying configuration of the authenticate provider.
	Config() any
	// HasTLS returns true if the authenticate provider supports TLS.
	HasTLS() bool
	// UseTLS returns true if the authenticate provider is configured to use TLS.
	UseTLS() bool
	// SkipTLSVerify returns true if the authenticate provider is configured to skip TLS verify.
	SkipTLSVerify() bool
}

Provider defines an authenticate provider which provides ability to authentication against an external identity provider and query external account information.

type Type added in v0.12.4

type Type int
const (
	None   Type = iota
	Plain       // 1
	LDAP        // 2
	SMTP        // 3
	PAM         // 4
	DLDAP       // 5
	GitHub      // 6
)

Note: New type must append to the end of list to maintain backward compatibility.

Directories

Path Synopsis
Package ldap provide functions & structure to query a LDAP ldap directory.
Package ldap provide functions & structure to query a LDAP ldap directory.

Jump to

Keyboard shortcuts

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