auth

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: GPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Message string `json:"message"`
}

type UserPW

type UserPW struct {
	Name string
	Pass string
}

type Users

type Users struct {
	Lookup map[string]string
	// contains filtered or unexported fields
}

func ReadPasswordsFile

func ReadPasswordsFile(path string, secret []byte, sessionTimeout int) (*Users, error)

func (*Users) Authenticate

func (u *Users) Authenticate(w http.ResponseWriter, r *http.Request)

func (*Users) CurrentUser

func (u *Users) CurrentUser(r *http.Request) (string, bool)

func (*Users) Logout

func (u *Users) Logout(w http.ResponseWriter, r *http.Request)

func (Users) Validate

func (u Users) Validate(user, password string) bool

Jump to

Keyboard shortcuts

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