Documentation ¶
Index ¶
- Variables
- func AccessControl() negroni.Handler
- func AuthMiddleware() negroni.Handler
- func CacheMiddleware(cfg *cache.Config) negroni.Handler
- func Cors(origin []string, headers []string) negroni.Handlerdeprecated
- func ExposureMiddleware() negroni.Handler
- func GetApp() *negroni.Negroni
- func HandlerSet() negroni.Handler
- func JwtMiddleware(key string, algo string) negroni.Handler
- func MatchURL(url string) (match bool, err error)
- func SetTimeoutToContext() negroni.Handler
- func Validate(c auth.Claims) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MiddlewareStack on pREST MiddlewareStack []negroni.Handler // BaseStack Middlewares BaseStack = []negroni.Handler{ negroni.Handler(negroni.NewRecovery()), negroni.Handler(negroni.NewLogger()), HandlerSet(), SetTimeoutToContext(), } )
View Source
var ( ErrJWTParseFail = errors.New("failed JWT token parser") ErrJWTValidate = errors.New("failed JWT claims validated") )
Functions ¶
func AccessControl ¶
func AccessControl() negroni.Handler
AccessControl is a middleware to handle permissions on tables in pREST
func AuthMiddleware ¶ added in v1.4.2
func AuthMiddleware() negroni.Handler
AuthMiddleware handle request token validation
func CacheMiddleware ¶ added in v1.4.2
CacheMiddleware simple caching to avoid equal queries to the database todo: receive config.PrestConf.Cache to pass to cache.EndpointRules this will help removing global config calls
func ExposureMiddleware ¶
func ExposureMiddleware() negroni.Handler
func JwtMiddleware ¶
JwtMiddleware check if actual request have JWT
func SetTimeoutToContext ¶ added in v1.4.2
func SetTimeoutToContext() negroni.Handler
SetTimeoutToContext adds the configured timeout in seconds to the request context
By default it is 60 seconds, can be modified to a different value
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.