middleware

package
v2.0.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2018 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIRestrictionMiddleware

func APIRestrictionMiddleware(db *gorm.DB) gin.HandlerFunc

APIRestrictionMiddleware is used to restrict access to API calls

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

CORSMiddleware is used to load our CORS handling logic TODO: need to cleanup and restrict origins, the all origin allow and credentials disable is a temporary measure

func JwtConfigGenerate

func JwtConfigGenerate(jwtKey, realmName string, db *gorm.DB, l *zap.SugaredLogger) *jwt.GinJWTMiddleware

JwtConfigGenerate is used to generate our JWT configuration

Types

type Login

type Login struct {
	Username string `form:"username" json:"username" binding:"required"`
	Password string `form:"password" json:"password" binding:"required"`
}

Login is used to unmarshal a login in request so that we can parse it

Jump to

Keyboard shortcuts

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