claims

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package claims handles generating and parsing JWT claims.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	ID      *uuid.UUID `json:"jti,omitempty"`
	Subject *uuid.UUID `json:"sub,omitempty"`
	jwt.StandardClaims
}

Claims defines the structure of JWT claims.

func New

func New(sub *uuid.UUID) *Claims

New generates a new set of JWT claims for the given subject.

type ContextKeyEXP added in v1.3.0

type ContextKeyEXP struct{}

ContextKeyEXP is the key used for storing JWT expiration timestamps in a context.

type ContextKeyJTI added in v1.3.0

type ContextKeyJTI struct{}

ContextKeyJTI is the key used for storing JWT IDs in a context.

type ContextKeySUB added in v1.3.0

type ContextKeySUB struct{}

ContextKeySUB is the key used for storing JWT subjects in a context.

Jump to

Keyboard shortcuts

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