auth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const RequestContextKey = ContextKey("request")

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(next http.Handler) http.Handler

func CreateNewToken

func CreateNewToken(nodeId string) (string, error)

func SetAuthSecret

func SetAuthSecret(secret string) error

Types

type ContextKey

type ContextKey string

type CustomClaims

type CustomClaims struct {
	Authorized bool   `json:"authorized"`
	NodeId     string `json:"node_id"`
	jwt.StandardClaims
}

type RequestContext

type RequestContext struct {
	NodeId    string
	Timestamp time.Time
}

Jump to

Keyboard shortcuts

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