auth

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JWTTokenContextKey holds the key used to store a JWT Token in the
	// context.
	JWTTokenContextKey string = "JWTToken"

	// JWTClaimsContextKey holds the key used to store the JWT Claims in the
	// context.
	JWTClaimsContextKey string = "JWTClaims"
)

Variables

View Source
var (
	// ErrClaimNotFound when claim is expected in the gin context
	ErrClaimNotFound = errors.New("claim not found in context")
)

Functions

func JwtMiddleware

func JwtMiddleware(conf *config.YamlConfig, newClaims jwt.Claims, method jwt.SigningMethod, keyFunc jwt.Keyfunc) gin.HandlerFunc

JwtMiddleware for Gin server if enabled

func NewJWTToken

func NewJWTToken(key []byte, method jwt.SigningMethod, claims jwt.Claims) (string, error)

NewJWTToken - method for generating new jwt tokens

func TokenMiddleware

func TokenMiddleware(conf *config.YamlConfig) gin.HandlerFunc

TokenMiddleware simple token authorization

Types

This section is empty.

Jump to

Keyboard shortcuts

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