middleware

package
v0.0.0-...-e107a19 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2017 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FlixCultJwtConfig = middleware.JWTConfig{
	SigningKey:    SigningKey,
	SigningMethod: middleware.AlgorithmHS256,
	AuthScheme:    "Bearer",
	Skipper:       SkipJWTAuthentication,
}

FlixCultJwtConfig -

View Source
var SigningKey = []byte("awakes") // need to get this from an .env file

SigningKey -

Functions

func BasicAuthenticate

func BasicAuthenticate(username string, password string) (bool, bool)

BasicAuthenticate - returns (authenticationStatus, admin)

func GenerateJWT

func GenerateJWT(claimsInp ClaimsInp) string

GenerateJWT - Generates a JWT token using

func SkipJWTAuthentication

func SkipJWTAuthentication(c echo.Context) bool

SkipJWTAuthentication - Skipper function to skip JWT Auth

Types

type ClaimsInp

type ClaimsInp struct {
	Name    string
	IsAdmin bool
}

ClaimsInp - Input to generate payload

type Credential

type Credential struct {
	Name     string `json:"name"`
	Password string `json:"password"`
}

Credential - Struct to take hold username/password

Jump to

Keyboard shortcuts

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