auth

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DigestToAuthMethod

func DigestToAuthMethod(digest string) (int, error)

func DigestToHashMethod

func DigestToHashMethod(digest string) (int, int, func() hash.Hash, error)

func HashPassword

func HashPassword(digest string, iterations int, salt string, password string) (string, error)

func RegisterAuthenticationMethod

func RegisterAuthenticationMethod(m AuthenticateMethod)

Types

type AuthFile

type AuthFile struct {
	// contains filtered or unexported fields
}

func (*AuthFile) AuthenticateUser

func (m *AuthFile) AuthenticateUser(userId string, password string) (bool, error)

func (*AuthFile) GetMethodName

func (m *AuthFile) GetMethodName() string

func (*AuthFile) Initialize

func (m *AuthFile) Initialize(logger *zap.Logger, c *config.AuthConfig) error

func (*AuthFile) LoadCredentialsFromFile

func (m *AuthFile) LoadCredentialsFromFile(filename string) error

type AuthHTTP

type AuthHTTP struct {
	// contains filtered or unexported fields
}

func (*AuthHTTP) AuthenticateUser

func (m *AuthHTTP) AuthenticateUser(userId string, password string) (bool, error)

func (*AuthHTTP) GetMethodName

func (m *AuthHTTP) GetMethodName() string

func (*AuthHTTP) Initialize

func (m *AuthHTTP) Initialize(logger *zap.Logger, c *config.AuthConfig) error

func (*AuthHTTP) LoadCredentialsFromHTTP

func (m *AuthHTTP) LoadCredentialsFromHTTP() error

type AuthManager

type AuthManager struct {
	// contains filtered or unexported fields
}
var AuthMgr AuthManager

func (*AuthManager) AuthenticateUser

func (m *AuthManager) AuthenticateUser(userId string, userPassword string) (bool, error)

func (*AuthManager) Finalize added in v1.5.0

func (m *AuthManager) Finalize()

func (*AuthManager) Initialize

func (m *AuthManager) Initialize(logger *zap.Logger, c *config.AuthConfig) error

type AuthenticateMethod

type AuthenticateMethod interface {
	GetMethodName() string
	Initialize(logger *zap.Logger, c *config.AuthConfig) error
	AuthenticateUser(userId string, userPassword string) (bool, error)
}

type Pbkdf2

type Pbkdf2 struct {
	// contains filtered or unexported fields
}

func HashedPasswordToPbkdf2

func HashedPasswordToPbkdf2(hash string) (*Pbkdf2, error)

func (*Pbkdf2) Hash

func (p *Pbkdf2) Hash(password string) (string, error)

func (*Pbkdf2) ToString

func (p *Pbkdf2) ToString() string

func (*Pbkdf2) Verify

func (p *Pbkdf2) Verify(password string) (bool, error)

Jump to

Keyboard shortcuts

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