token

package
v0.0.0-...-9ee571f Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomClaims

type CustomClaims struct {
	UserID             string `json:"UserID"`
	FamilyID           string `json:"FamilyID"`
	TTL                int    `json:"TTL"`
	jwt.StandardClaims `json:"Claims"`
}

CustomClaims data type.

type JWTToken

type JWTToken struct{}

JWTToken data type.

func (*JWTToken) CreateJWT

func (j *JWTToken) CreateJWT(remoteHost, userID, familyID string) (string, error)

CreateJWT Creates and returns a new JWT.

func (JWTToken) GetFamily

func (j JWTToken) GetFamily(inputToken string) (string, error)

GetFamily returns the familyID from the JWT Token.

func (JWTToken) GetUser

func (j JWTToken) GetUser(inputToken string) (string, error)

GetUser returns the user from the JWT Token.

func (*JWTToken) ValidateMiddleware

func (j *JWTToken) ValidateMiddleware(next http.HandlerFunc) http.HandlerFunc

ValidateMiddleware is how we ensure that only authorized persons are able to access endpoints.

Jump to

Keyboard shortcuts

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