Skip to content

Releases: go-seatbelt/seatbelt

v0.4.0

30 Dec 21:53
2fd9ab7
Compare
Choose a tag to compare

Adds the option to skip CSRF checks by using the SkipCSRFPaths option.

app := New(Option{
	SkipCSRFPaths: []string{"/api"}, // Skips CSRF protection on any route prefixed with /api
})

v0.3.2

18 Jun 15:25
7ff19ed
Compare
Choose a tag to compare

Forces the CSRF cookie to use the path / to prevent issues with there being two CSRF token cookies with a different path.

v0.3.1

22 Feb 23:34
8f50997
Compare
Choose a tag to compare

Adds a method to render a template to a byte slice, rather than directly to the response writer, for example

func ShowPage(c *seatbelt.Context) error {
	page := c.RenderToBytes("index", nil)
	_, err := c.Response().Write(page)
	return err
}

renders a page to a byte slice, then writes it to the response.

v0.3.0

12 Jan 00:17
8a7ffed
Compare
Choose a tag to compare

Adds Chi's route to the Seatbelt application's router via the method Namespace.

This allows sub-routes to be created, as follows:

app := app.New()
app.Namespace("/admin", func(app *seatbelt.App) {
    app.Get("/home", func(c *seatbelt.Context) error {
        return c.String(200, "ok")
    })
})
app.Start()

This will return 200 with the body "ok" when a request is sent to /admin/home.

v0.2.0

09 Jan 23:00
08aeb27
Compare
Choose a tag to compare

Adds namespaces to the context methods to more clearly group them by functionality, i.e., methods affecting the session are now accessed via,

func Handle(c *seatbelt.Context) error {
    c.Session.Set("key", "value")
    return nil
}

This also adds a helper to approximate the IP address of a request.

Updates the "values" API so that it used the request context for storage, rather than relying on a per-request map stored in the context instance.

This allows us to create arbitrary "values" instances from requests, which makes it possible to interact with this API anytime we have an HTTP request. This was required to merge the request-scoped "values" in the I18N template helper, which was (in my opinion) required to make it consistent with how the HTML rendering API and its usage of "values"feels.

Adds the same "reload" ability to i18n bundles that we have on HTML templates, so that in development, i18n bundles are re-compiled on each request, so they can be edited while a dev server is running without requiring a reload.

v0.1.1

06 Jan 23:42
088fadb
Compare
Choose a tag to compare

v0.1.0

17 Dec 07:13
ef504ff
Compare
Choose a tag to compare
  • Adds the "Values" API, which allows the setting of request-scoped values.
  • Rips out the old custom template renderer, and switches to using github.com/unrolled/render.

v0.0.4

19 May 21:18
b0fe295
Compare
Choose a tag to compare

What's Changed

  • seatbelt: generate unique secret signing key by @bentranter in #5
  • all: version public assets, improve sessions by @bentranter in #6

Full Changelog: v0.0.3...v0.0.4

v0.0.3

04 May 22:36
37f19dd
Compare
Choose a tag to compare
  • Removes the x package, and along with it, a ton of unused dependencies.

v0.0.2

27 Apr 23:10
06783e7
Compare
Choose a tag to compare

First release post-rewrite. Probably not a good idea to use this yet.