Documentation ¶
Overview ¶
Package agdpasswd contains authentication utils.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowAuthenticator ¶
type AllowAuthenticator struct{}
AllowAuthenticator is an empty authenticator implementation that always grants access, regardless of any restrictions.
func (AllowAuthenticator) Authenticate ¶
func (AllowAuthenticator) Authenticate(_ context.Context, _ []byte) (ok bool)
Authenticate implements the Authenticator interface for AllowAuthenticator.
type Authenticator ¶
type Authenticator interface { // Authenticate returns true if the given passwd is allowed. Authenticate(ctx context.Context, passwd []byte) (ok bool) }
Authenticator represents a password authenticator.
type PasswordHashBcrypt ¶
type PasswordHashBcrypt struct {
// contains filtered or unexported fields
}
PasswordHashBcrypt is the Bcrypt implementation of Authenticator.
func NewPasswordHashBcrypt ¶
func NewPasswordHashBcrypt(hashedPassword []byte) (p *PasswordHashBcrypt)
NewPasswordHashBcrypt returns a new bcrypt hashed password authenticator.
func (*PasswordHashBcrypt) Authenticate ¶
func (p *PasswordHashBcrypt) Authenticate(_ context.Context, passwd []byte) (ok bool)
Authenticate implements the Authenticator interface for *PasswordHashBcrypt.
func (*PasswordHashBcrypt) PasswordHash ¶
func (p *PasswordHashBcrypt) PasswordHash() (b []byte)
PasswordHash returns password hash bytes slice.
Click to show internal directories.
Click to hide internal directories.