jwt

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//FiderClaimsOriginUI is assigned to Fider claims when the Auth Token is generated through the UI
	FiderClaimsOriginUI = "ui"
	//FiderClaimsOriginAPI is assigned to Fider claims when the Auth Token is generated through the API
	FiderClaimsOriginAPI = "api"
)

Variables

This section is empty.

Functions

func Encode

func Encode(claims jwtgo.Claims) (string, error)

Encode creates new JWT token with given claims

Types

type FiderClaims added in v0.14.0

type FiderClaims struct {
	UserID    int    `json:"user/id"`
	UserName  string `json:"user/name"`
	UserEmail string `json:"user/email"`
	Origin    string `json:"origin"`
	Metadata
}

FiderClaims represents what goes into JWT tokens

func DecodeFiderClaims

func DecodeFiderClaims(token string) (*FiderClaims, error)

DecodeFiderClaims extract claims from JWT tokens

type Metadata added in v0.14.0

type Metadata = jwtgo.StandardClaims

Metadata is the basic JWT information

type OAuthClaims added in v0.14.0

type OAuthClaims struct {
	OAuthID       string `json:"oauth/id"`
	OAuthProvider string `json:"oauth/provider"`
	OAuthName     string `json:"oauth/name"`
	OAuthEmail    string `json:"oauth/email"`
	Metadata
}

OAuthClaims represents what goes into temporary OAuth JWT tokens

func DecodeOAuthClaims

func DecodeOAuthClaims(token string) (*OAuthClaims, error)

DecodeOAuthClaims extract OAuthClaims from given JWT token

Jump to

Keyboard shortcuts

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