Documentation
¶
Index ¶
- func CreatePasswordHash(password string) ([]byte, error)
- type Authentication
- type AuthenticationType
- type FileAuth
- func (fileAuth *FileAuth) AddNoPassSmtpIp(username string, ip string) error
- func (fileAuth *FileAuth) AddUser(username string, httpPassHash string, smtpPassHash string) error
- func (fileAuth *FileAuth) Authenticate(authType AuthenticationType, username string, password string) bool
- func (fileAuth *FileAuth) AuthenticateSMTPViaIP(username string, ip string) bool
- func (fileAuth *FileAuth) ClearAllNoPassSmtpIps(username string) error
- func (fileAuth *FileAuth) DeleteNoPassSmtpIp(username string, ip string) error
- func (fileAuth *FileAuth) DeleteUser(username string) error
- func (fileAuth *FileAuth) ListUsers(searchQuery string, offset, limit int) ([]UserResource, int, error)
- func (fileAuth *FileAuth) RequiresAuthentication() bool
- func (fileAuth *FileAuth) SmtpIpIsWhitelisted(username string, ip string) bool
- func (fileAuth *FileAuth) UpdateUser(username string, httpPassHash string, smtpPassHash string) error
- func (fileAuth *FileAuth) UsernamePresent(username string) bool
- type Mongo
- func (mongoClient *Mongo) AddNoPassSmtpIp(username string, ip string) error
- func (mongoClient *Mongo) AddUser(username string, httpPassHash string, smtpPassHash string) error
- func (mongoClient *Mongo) Authenticate(authType AuthenticationType, username string, password string) bool
- func (mongoClient *Mongo) AuthenticateSMTPViaIP(username string, ip string) bool
- func (mongoClient *Mongo) ClearAllNoPassSmtpIps(username string) error
- func (mongoClient *Mongo) DeleteNoPassSmtpIp(username string, ip string) error
- func (mongoClient *Mongo) DeleteUser(username string) error
- func (mongoClient *Mongo) ListUsers(searchQuery string, offset, limit int) ([]UserResource, int, error)
- func (mongoClient *Mongo) RequiresAuthentication() bool
- func (mongoClient *Mongo) SmtpIpIsWhitelisted(username string, ip string) bool
- func (mongoClient *Mongo) UpdateUser(username string, httpPassHash string, smtpPassHash string) error
- func (mongoClient *Mongo) UsernamePresent(username string) bool
- type UserResource
- type UserRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePasswordHash ¶ added in v1.0.17
Types ¶
type Authentication ¶
type Authentication interface {
// RequiresAuthentication check is supports auth
RequiresAuthentication() bool
// Authenticate check is credentials valid
Authenticate(authType AuthenticationType, username string, password string) bool
// AuthenticateSMTPViaIP check is IP cab bypass password auth
AuthenticateSMTPViaIP(username string, ip string) bool
// SmtpIpIsWhitelisted check is IP allow to receive mails
SmtpIpIsWhitelisted(username string, ip string) bool
// UsernamePresent check is username exists
UsernamePresent(username string) bool
// AddUser to auth storage
AddUser(username string, httpPassHash string, smtpPassHash string) error
// UpdateUser in auth storage
UpdateUser(username string, httpPassHash string, smtpPassHash string) error
// DeleteUser from auth storage
DeleteUser(username string) error
// ListUsers from auth storage
ListUsers(searchQuery string, offset, limit int) ([]UserResource, int, error)
// AddNoPassSmtpIp to auth storage related to user
AddNoPassSmtpIp(username string, ip string) error
// DeleteNoPassSmtpIp from auth storage related to user
DeleteNoPassSmtpIp(username string, ip string) error
// ClearAllNoPassSmtpIps in auth storage related to user
ClearAllNoPassSmtpIps(username string) error
}
Authentication interface represents a backend flow to store or retrieve messages
type AuthenticationType ¶
type AuthenticationType = string
const ( HTTP AuthenticationType = "http" SMTP = "smtp" )
type FileAuth ¶
type FileAuth struct {
// contains filtered or unexported fields
}
FileAuth represents the authentication handler using file
func (*FileAuth) AddNoPassSmtpIp ¶ added in v1.2.1
func (*FileAuth) Authenticate ¶
func (fileAuth *FileAuth) Authenticate(authType AuthenticationType, username string, password string) bool
func (*FileAuth) AuthenticateSMTPViaIP ¶ added in v1.2.1
func (*FileAuth) ClearAllNoPassSmtpIps ¶ added in v1.2.1
func (*FileAuth) DeleteNoPassSmtpIp ¶ added in v1.2.1
func (*FileAuth) DeleteUser ¶ added in v1.0.17
func (*FileAuth) RequiresAuthentication ¶
func (*FileAuth) SmtpIpIsWhitelisted ¶ added in v1.2.1
func (*FileAuth) UpdateUser ¶ added in v1.0.17
func (*FileAuth) UsernamePresent ¶
type Mongo ¶ added in v1.0.16
type Mongo struct {
Collection *mongo.Collection
}
func CreateMongoDbAuthentication ¶ added in v1.0.16
func CreateMongoDbAuthentication(collection *mongo.Collection) *Mongo
func (*Mongo) AddNoPassSmtpIp ¶ added in v1.2.1
func (*Mongo) Authenticate ¶ added in v1.0.16
func (mongoClient *Mongo) Authenticate(authType AuthenticationType, username string, password string) bool
func (*Mongo) AuthenticateSMTPViaIP ¶ added in v1.2.1
func (*Mongo) ClearAllNoPassSmtpIps ¶ added in v1.2.1
func (*Mongo) DeleteNoPassSmtpIp ¶ added in v1.2.1
func (*Mongo) DeleteUser ¶ added in v1.0.17
func (*Mongo) RequiresAuthentication ¶ added in v1.0.16
func (*Mongo) SmtpIpIsWhitelisted ¶ added in v1.2.1
func (*Mongo) UpdateUser ¶ added in v1.0.17
func (*Mongo) UsernamePresent ¶ added in v1.0.16
type UserResource ¶ added in v1.0.17
Click to show internal directories.
Click to hide internal directories.