Documentation
¶
Index ¶
- Constants
- Variables
- func HashPassword(password string) (string, error)
- func VerifyPassword(password, encodedHash string) (bool, error)
- type Argon2Params
- type Service
- func (s *Service) ChangePassword(oldPassword, newPassword string) error
- func (s *Service) CreateAPIKey(name string) (string, *models.APIKey, error)
- func (s *Service) DeleteAPIKey(id int) error
- func (s *Service) GetSessionStore() sessions.Store
- func (s *Service) IsSetupComplete() (bool, error)
- func (s *Service) ListAPIKeys() ([]*models.APIKey, error)
- func (s *Service) Login(username, password string) (*models.User, error)
- func (s *Service) SetupUser(username, password string) (*models.User, error)
- func (s *Service) ValidateAPIKey(key string) (*models.APIKey, error)
Constants ¶
View Source
const (
SessionName = "qui_user_session"
)
Variables ¶
View Source
var ( ErrInvalidCredentials = errors.New("invalid username or password") ErrNotSetup = errors.New("initial setup required") )
Functions ¶
func HashPassword ¶
HashPassword generates an Argon2id hash of the password
func VerifyPassword ¶
VerifyPassword verifies a password against an Argon2id hash
Types ¶
type Argon2Params ¶
type Argon2Params struct {
Memory uint32
Iterations uint32
Parallelism uint8
SaltLength uint32
KeyLength uint32
}
Argon2 parameters - these are secure defaults
func DefaultArgon2Params ¶
func DefaultArgon2Params() *Argon2Params
DefaultArgon2Params returns secure default parameters for Argon2id
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ChangePassword ¶
ChangePassword updates the user's password
func (*Service) CreateAPIKey ¶
CreateAPIKey generates a new API key
func (*Service) DeleteAPIKey ¶
DeleteAPIKey removes an API key
func (*Service) GetSessionStore ¶
GetSessionStore returns the session store for use in middleware
func (*Service) IsSetupComplete ¶
IsSetupComplete checks if initial setup has been completed
func (*Service) ListAPIKeys ¶
ListAPIKeys returns all API keys
Click to show internal directories.
Click to hide internal directories.