middleware

package
v2.0.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package middleware provides the middleware used by Temporal's APIs

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultAllowedOrigins are the default allowed origins for the api, allowing for access
	// via both of our internet uplinks when using the web interface.
	DefaultAllowedOrigins = []string{"https://temporal.cloud", "https://backup.temporal.cloud"}
)

Functions

func CORSMiddleware

func CORSMiddleware(devMode bool, allowedOrigins []string) gin.HandlerFunc

CORSMiddleware is used to load our CORS handling logic

func JwtConfigGenerate

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

JwtConfigGenerate is used to generate our JWT configuration

func NewSecWare

func NewSecWare(devMode bool) gin.HandlerFunc

NewSecWare is used to initialize our security middleware

func RequestID

func RequestID() gin.HandlerFunc

RequestID is used to insert a randomly generated uuid as a value to a X-Request-ID header

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