auth

package
v0.0.0-...-5b64ff3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(_ http.ResponseWriter, r *http.Request)

func EmptyCookie

func EmptyCookie() *http.Cookie

func IsAuth

func IsAuth(r *http.Request) (handle string, err error)

func TokenFromRequestCookie

func TokenFromRequestCookie(r *http.Request) (
	token *jwt.Token, status int, err error)

func UserHandleFromRequestCookie

func UserHandleFromRequestCookie(r *http.Request) (
	handle string, status int, err error)

Types

type Claims

type Claims struct {
	UserHandle string `json:"handle"`
	StdClaims  jwt.StandardClaims
}

func (*Claims) Valid

func (claims *Claims) Valid() (err error)

type SignedToken

type SignedToken string

func NewSignedJWTTokenWithClaimsForUser

func NewSignedJWTTokenWithClaimsForUser(handle string) (SignedToken, error)

func (SignedToken) ParseToken

func (st SignedToken) ParseToken() (*jwt.Token, error)

func (SignedToken) String

func (st SignedToken) String() string

func (SignedToken) WrapInCookie

func (st SignedToken) WrapInCookie() *http.Cookie

Jump to

Keyboard shortcuts

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