auth

package
v0.0.0-...-2d2cc06 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

auth provides common user authentication functions

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidUsername is logged by the ValidateSignin middleware when the username
	// included on the http request does not meet username character requirements
	ErrInvalidUsername = errors.New(
		"username included on request body is invalid (regex validation failure)")
	ErrWrongMethod = errors.New("wrong method used to access endpoint in package 'auth'")
)

errors used by the auth package

Functions

func ChangePassword

func ChangePassword(username, newPW string) error

func CreateUser

func CreateUser(username string, password string) error

func DeleteUser

func DeleteUser(username string) error

func Signin

func Signin(w http.ResponseWriter, r *http.Request)

func Signout

func Signout(w http.ResponseWriter, r *http.Request)

func ValidateSignin

func ValidateSignin(next http.Handler) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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