auth

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

go-api-auth

GoDoc Build Status Go Report Card

Documentation

Index

Constants

View Source
const (
	JwtExpiry = 30 * 24 * time.Hour
)

Variables

This section is empty.

Functions

func HashPassword added in v0.0.4

func HashPassword(password string) [32]byte

func SecretGenerator

func SecretGenerator() []byte

Types

type Auth

type Auth struct {
	Password [32]byte
	Secret   []byte
}

func (*Auth) CookieAuthIsValid

func (a *Auth) CookieAuthIsValid(c *gin.Context) bool

func (*Auth) CookieAuthRequired

func (a *Auth) CookieAuthRequired() gin.HandlerFunc

func (*Auth) DeleteSessionCookie

func (a *Auth) DeleteSessionCookie(c *gin.Context)

func (*Auth) HeaderAuthIsValid

func (a *Auth) HeaderAuthIsValid(c *gin.Context) bool

func (*Auth) HeaderAuthRequired added in v1.0.2

func (a *Auth) HeaderAuthRequired() gin.HandlerFunc

func (*Auth) NoPasswordSet added in v0.0.2

func (a *Auth) NoPasswordSet() bool

func (*Auth) PasswordEquals

func (a *Auth) PasswordEquals(input string) bool

func (*Auth) SetSessionCookie

func (a *Auth) SetSessionCookie(c *gin.Context)

Jump to

Keyboard shortcuts

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