jwt

package
v0.0.0-...-8e2c34a Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package jwt manage authorization claims for the app

Index

Constants

View Source
const (
	Authorization = "Authorization"
	TokenType     = "Bearer"
	Expiration    = 86400
)

JWT related constants

Variables

This section is empty.

Functions

func FromHeaderVal

func FromHeaderVal(s string) string

FromHeaderVal will remove the JWTTokenType if it prepends the string s, but is also safe to use if s is just the token

func ToHeaderVal

func ToHeaderVal(token string) string

ToHeaderVal prepends the JWTTokenType

Types

type Claims

type Claims struct {
	Scope string `json:"scope"`
	Org   string `json:"org"`
	jwt_go.StandardClaims
}

Claims are the JWT claims for the app

func Decode

func Decode(id, token string, signingKey []byte) (*Claims, error)

Decode returns the claims from a signed string jwt

func New

func New(u user.Instance) (*Claims, error)

New returns a new Claims instance

Jump to

Keyboard shortcuts

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