- Notifications
You must be signed in to change notification settings - Fork4
The default middleware for Buffalo apps
License
gobuffalo/middleware
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Middleware is a fundamental module that provides the default middleware forbuffalo applications.
The default middleware is setup by default on a new Buffalo app.
$buffalo new myappBuffalo CLI will generate application scafflod andactions/app.go will beconfigured to use default middlewares by default.
$go get github.com/gobuffalo/middlewarecontenttype middleware provides a feature that sets the fallback content type(which is used when the client sent nothing) or overrides the client-specifiedcontent type.This middleware will be enabled by default in your app when you generate a newAPI application withbuffalo new --api command.
csrf middleware providesCSRFprotection for Buffalo apps.This middleware will be enabled by default in your app when you generate a newapplication scaffold withbuffalo new command.
forcessl middleware provides a feature that automatically redirects requeststhat is not use HTTPS.This middleware will be enabled by default in your app when you generate a newapplication scaffold withbuffalo new command.It is configured to enforce the redirection in theproduction mode only. Youcould customize it inactions/app.go if you need a different behavior.
i18n middleware provides internationalization support in your application:
- User language detection from configurable sources
- Translation helper using locales bundles from github.com/nicksnyder/go-i18n
- Localized views
Seehttps://gobuffalo.io/documentation/guides/localization/ for furtherinformation about Buffalo translation features and configuration.
paramlogger middleware provides the request parameter logging feature.This middleware will be enabled by default in your app when you generate a newapplication scaffold withbuffalo new command.
By default, it filters out pre-defined sensitive parameters and they will beprinted as[FILTERED] in the log. (keywords are case insensitive)
Currently, the pre-defined parameters are:
- password
- passwordconfirmation
- creditcard
- cvc
paramlogger also allows to exclude user-defined parameters by specifyingthose in theParameterExclusionList before using the ParamegerLoggermiddleware in the app.
paramlogger.ParameterExclusionList=append(paramlogger.ParameterExclusionList,"secret","phone_number")app.Use(paramlogger.ParameterLogger)
or
paramlogger.ParameterExclusionList= []string{"password","passwordconfirmation","secret","phone_number", }app.Use(paramlogger.ParameterLogger)
About
The default middleware for Buffalo apps
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.