user

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: BSD-3-Clause Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package user contains the basic admin user creation and authentication code, specific to kudzu systems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(next http.HandlerFunc) http.HandlerFunc

Auth is HTTP middleware to ensure the request has proper token credentials

func IsUser

func IsUser(usr *User, password string) bool

IsUser checks for consistency in email/pass combination

func IsValid

func IsValid(req *http.Request) bool

IsValid checks if the user request is authenticated

Types

type User

type User struct {
	ID    int    `json:"id"`
	Email string `json:"email"`
	Hash  string `json:"hash"`
	Salt  string `json:"salt"`
}

User defines a admin user in the system

func New

func New(email, password string) (*User, error)

New creates a user

Jump to

Keyboard shortcuts

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