secure

HTTP middleware for Go that facilitates some quick security wins. (by unrolled)

Secure Alternatives

Similar projects and alternatives to secure

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better secure alternative or higher similarity.

secure reviews and mentions

Posts with mentions or reviews of secure. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-08-18.
  • Any good git repos made by a single dev?
    11 projects | /r/golang | 18 Aug 2021
  • Web security focused frameworks (and/or) packages
    3 projects | /r/golang | 29 Jul 2021
  • API With GO Buffalo in 2021: from zero to deploy
    1 project | dev.to | 4 Mar 2021
    package actions import ( "project1/models" "github.com/gobuffalo/buffalo" "github.com/gobuffalo/envy" forcessl "github.com/gobuffalo/mw-forcessl" i18n "github.com/gobuffalo/mw-i18n" paramlogger "github.com/gobuffalo/mw-paramlogger" "github.com/unrolled/secure" "github.com/gobuffalo/buffalo-pop/v2/pop/popmw" contenttype "github.com/gobuffalo/mw-contenttype" "github.com/gobuffalo/x/sessions" "github.com/rs/cors" "github.com/gobuffalo/packr/v2" ) // ENV is used to help switch settings based on where the // application is being run. Default is "development". var ENV = envy.Get("GO_ENV", "development") var app *buffalo.App var T *i18n.Translator // App is where all routes and middleware for buffalo // should be defined. This is the nerve center of your // application. // // Routing, middleware, groups, etc... are declared TOP -> DOWN. // This means if you add a middleware to `app` *after* declaring a // group, that group will NOT have that new middleware. The same // is true of resource declarations as well. // // It also means that routes are checked in the order they are declared. // `ServeFiles` is a CATCH-ALL route, so it should always be // placed last in the route declarations, as it will prevent routes // declared after it to never be called. func App() *buffalo.App { if app == nil { app = buffalo.New(buffalo.Options{ Env: ENV, SessionStore: sessions.Null{}, PreWares: []buffalo.PreWare{ cors.Default().Handler, }, SessionName: "_project1_session", }) // Automatically redirect to SSL app.Use(forceSSL()) // Log request parameters (filters apply). app.Use(paramlogger.ParameterLogger) // Set the request content type to JSON app.Use(contenttype.Set("application/json")) // Wraps each request in a transaction. // c.Value("tx").(*pop.Connection) // Remove to disable this. app.Use(popmw.Transaction(models.DB)) app.GET("/", HomeHandler) app.GET("/todo/", TodoIndex) app.GET("/todo/add", TodoAdd) app.GET("/todo/{id}", TodoShow) // <--- MAKE SURE THIS IS AT BOTTOM OF LIST } return app } // translations will load locale files, set up the translator `actions.T`, // and will return a middleware to use to load the correct locale for each // request. // for more information: https://gobuffalo.io/en/docs/localization func translations() buffalo.MiddlewareFunc { var err error if T, err = i18n.New(packr.New("app:locales", "../locales"), "en-US"); err != nil { app.Stop(err) } return T.Middleware() } // forceSSL will return a middleware that will redirect an incoming request // if it is not HTTPS. "http://example.com" => "https://example.com". // This middleware does **not** enable SSL. for your application. To do that // we recommend using a proxy: https://gobuffalo.io/en/docs/proxy // for more information: https://github.com/unrolled/secure/ func forceSSL() buffalo.MiddlewareFunc { return forcessl.Middleware(secure.Options{ SSLRedirect: ENV == "production", SSLProxyHeaders: map[string]string{"X-Forwarded-Proto": "https"}, }) }
  • A note from our sponsor - WorkOS
    workos.com | 25 Apr 2024
    The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning. Learn more →

Stats

Basic secure repo stats
3
2,210
2.9
1 day ago

unrolled/secure is an open source project licensed under MIT License which is an OSI approved license.

The primary programming language of secure is Go.


Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com