claims

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package claims contains the JWT claims structure and a utility method for signing them.

Index

Constants

View Source
const Audience = "cacheroach"

Audience is the JWT claim value that we'll look for.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Message *session.Session `json:"msg,omitempty"`
	jwt.StandardClaims
}

Claims are JWT claims.

func Sign

func Sign(now time.Time, sn *session.Session, key []byte) (*Claims, *token.Token, error)

Sign will create a signed token from the given session template, updating some fields within the Session object.

func Validate

func Validate(token string, signingKey []byte) (*Claims, *session.Session, error)

Validate will validate the token and expand its contents into a Session. Not all fields of the Session will be populated.

Jump to

Keyboard shortcuts

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