user

package
v0.0.0-...-ebe1d99 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package user contains the basic admin user creation and authentication code, specific to Ponzu 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