jwtmanager

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Sites []string

Sites just testing

View Source
var StandardClaims jwt.StandardClaims

StandardClaims jwt.StandardClaims implimentation

Functions

func CreateUserTokenString

func CreateUserTokenString(u structs.User) string

CreateUserTokenString converts user to signed jwt

func PTokenToEmail

func PTokenToEmail(ptoken *jwt.Token) (string, error)

PTokenToEmail returns the Email in the validated ptoken

func ParseTokenString

func ParseTokenString(tokenString string) (*jwt.Token, error)

ParseTokenString converts signed token to jwt struct

func SiteInClaims

func SiteInClaims(site string, claims *LassoClaims) bool

SiteInClaims does the claim contain the value?

func SiteInToken

func SiteInToken(site string, token *jwt.Token) bool

SiteInToken searches does the token contain the site?

func TokenIsValid

func TokenIsValid(token *jwt.Token, err error) bool

TokenIsValid gett better error reporting

Types

type LassoClaims

type LassoClaims struct {
	Email string   `json:"email"`
	Sites []string `json:"sites"` // tempting to make this a map but the array is fewer characters in the jwt
	jwt.StandardClaims
}

LassoClaims jwt Claims specific to lasso

func PTokenClaims

func PTokenClaims(ptoken *jwt.Token) (LassoClaims, error)

TODO HERE there's something wrong with claims parsing, probably related to LassoClaims not being a pointer PTokenClaims get all the claims

Jump to

Keyboard shortcuts

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