auth

package
Version: v0.0.0-...-ac624b7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCheck

func HandleCheck(s *server.Server) echo.HandlerFunc

HandleCheck just validates a client's JWT as cheaply as possible

func HandleLogin

func HandleLogin(s *server.Server) echo.HandlerFunc

HandleLogin looks for basic auth info and if allowed returns a JWT suitable for further API use

func Install

func Install(s *server.Server)

Install puts todo related routes on the server and specified their handlers

func InstallOnGroup

func InstallOnGroup(s *server.Server, g *echo.Group)

InstallOnGroup adds the route to an existing group on the server

Types

type CustomClaims

type CustomClaims struct {
	ID           int       `json:"id"`
	Name         string    `json:"name"`
	Email        string    `json:"email"`
	DateCreated  time.Time `json:"date_created"`
	DateModified time.Time `json:"date_modified"`
	// TODO: IsAdmin bool   `json:"admin"`
	jwt.StandardClaims
}

CustomClaims extends the default claims with anything we want added to a user's JWT

Jump to

Keyboard shortcuts

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