Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
v0.16.15 (#2043)
Browse files Browse the repository at this point in the history
* adding direct version on the docker build

* fixing plugin installation

* Fix npm's package.json permissions (#2005)

Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`)

* Bump spf13/viper to v1.7.0 (#1999)

* bunping version

* changing version on dockerfile

* patch to fix the keywords check on new app

* removing unneeded append

* Task fixing html binder (#2016)

* binder was not wired

* packing

* adding new version number

* pulling the buffalo binary from gobinaries.com

* Task updating formam (#2025)

* v0.16.13 (#2019)

* adding direct version on the docker build

* fixing plugin installation

* Fix npm's package.json permissions (#2005)

Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`)

* Bump spf13/viper to v1.7.0 (#1999)

* bunping version

* changing version on dockerfile

* patch to fix the keywords check on new app

* removing unneeded append

* Task fixing html binder (#2016)

* binder was not wired

* packing

* adding new version number

* pulling the buffalo binary from gobinaries.com

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>

* updating formam

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>

* Fixes #1987 and #2023 (#2026)

* v0.16.13 (#2019)

* adding direct version on the docker build

* fixing plugin installation

* Fix npm's package.json permissions (#2005)

Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`)

* Bump spf13/viper to v1.7.0 (#1999)

* bunping version

* changing version on dockerfile

* patch to fix the keywords check on new app

* removing unneeded append

* Task fixing html binder (#2016)

* binder was not wired

* packing

* adding new version number

* pulling the buffalo binary from gobinaries.com

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>

* fixing #1987 and #2023

* adding missing converstion

* removing commented code

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>

* changing version number

* moving to latest 2 go versions (#2038)

* Task binding cleanup (#2039)

* moving to latest 2 go versions

* cleaning up the decoder on the binding package

* Task update formam (#2041)

* v0.16.14 (#2030)

* adding direct version on the docker build

* fixing plugin installation

* Fix npm's package.json permissions (#2005)

Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`)

* Bump spf13/viper to v1.7.0 (#1999)

* bunping version

* changing version on dockerfile

* patch to fix the keywords check on new app

* removing unneeded append

* Task fixing html binder (#2016)

* binder was not wired

* packing

* adding new version number

* pulling the buffalo binary from gobinaries.com

* Task updating formam (#2025)

* v0.16.13 (#2019)

* adding direct version on the docker build

* fixing plugin installation

* Fix npm's package.json permissions (#2005)

Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`)

* Bump spf13/viper to v1.7.0 (#1999)

* bunping version

* changing version on dockerfile

* patch to fix the keywords check on new app

* removing unneeded append

* Task fixing html binder (#2016)

* binder was not wired

* packing

* adding new version number

* pulling the buffalo binary from gobinaries.com

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>

* updating formam

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>

* Fixes #1987 and #2023 (#2026)

* v0.16.13 (#2019)

* adding direct version on the docker build

* fixing plugin installation

* Fix npm's package.json permissions (#2005)

Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`)

* Bump spf13/viper to v1.7.0 (#1999)

* bunping version

* changing version on dockerfile

* patch to fix the keywords check on new app

* removing unneeded append

* Task fixing html binder (#2016)

* binder was not wired

* packing

* adding new version number

* pulling the buffalo binary from gobinaries.com

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>

* fixing #1987 and #2023

* adding missing converstion

* removing commented code

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>

* changing version number

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>

* updates formam version #2040

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>

* updating flect versionm (#2042)

* updating version

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: hackerman <[email protected]>
  • Loading branch information
3 people authored Sep 5, 2020
1 parent 98a801e commit 43fd009
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.13.x, 1.14.x]
go-version: [1.14.x, 1.15.x]
os: [macos-latest, windows-latest, ubuntu-latest]
env:
GO111MODULE: on
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN npm install -g --no-progress yarn \
# Install golangci
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
# Installing buffalo binary
RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/[email protected].14 | sh
RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/[email protected].15 | sh
RUN go get github.com/gobuffalo/buffalo-pop/v2
RUN buffalo version

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.slim.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN npm i -g --no-progress yarn \
&& yarn config set yarn-offline-mirror-pruning true

# Pulling docker binary from releases
RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/[email protected].14 | sh
RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/[email protected].15 | sh
RUN go get github.com/gobuffalo/buffalo-pop/v2
RUN buffalo version

Expand Down
25 changes: 20 additions & 5 deletions binding/binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package binding

import (
"net/http"
"time"

"github.com/gobuffalo/buffalo/binding/decoders"
"github.com/gobuffalo/nulls"
"github.com/monoculum/formam"
)

Expand All @@ -14,16 +16,16 @@ var (
// information on how this impacts file uploads.
MaxFileMemory int64 = 5 * 1024 * 1024

formDecoder = formam.NewDecoder(&formam.DecoderOptions{
TagName: "form",
IgnoreUnknownKeys: true,
})
// formDecoder (formam) that will be used across ContentTypeBinders
formDecoder = buildFormDecoder()

// BaseRequestBinder is an instance of the requestBinder, it comes with preconfigured
// content type binders for HTML, JSON, XML and Files, as well as custom types decoders
// for time.Time and nulls.Time
BaseRequestBinder = NewRequestBinder(
NewHTMLContentTypeBinder(formDecoder),
HTMLContentTypeBinder{
decoder: formDecoder,
},
JSONContentTypeBinder{},
XMLRequestTypeBinder{},
FileRequestTypeBinder{
Expand All @@ -32,6 +34,19 @@ var (
)
)

// buildFormDecoder that will be used in the package. This method adds some custom decoders for time.Time and nulls.Time.
func buildFormDecoder() *formam.Decoder {
decoder := formam.NewDecoder(&formam.DecoderOptions{
TagName: "form",
IgnoreUnknownKeys: true,
})

decoder.RegisterCustomType(decoders.TimeDecoderFn(), []interface{}{time.Time{}}, nil)
decoder.RegisterCustomType(decoders.NullTimeDecoderFn(), []interface{}{nulls.Time{}}, nil)

return decoder
}

// RegisterTimeFormats allows to add custom time layouts that
// the binder will be able to use for decoding.
func RegisterTimeFormats(layouts ...string) {
Expand Down
14 changes: 0 additions & 14 deletions binding/html_content_type_binder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ package binding

import (
"net/http"
"time"

"github.com/gobuffalo/buffalo/binding/decoders"
"github.com/gobuffalo/nulls"
"github.com/monoculum/formam"
)

Expand All @@ -14,17 +11,6 @@ type HTMLContentTypeBinder struct {
decoder *formam.Decoder
}

// NewHTMLContentTypeBinder returns an instance of HTMLContentTypeBinder with
// custom type decoders registered for Time and nulls.Time
func NewHTMLContentTypeBinder(decoder *formam.Decoder) HTMLContentTypeBinder {
decoder.RegisterCustomType(decoders.TimeDecoderFn(), []interface{}{time.Time{}}, nil)
decoder.RegisterCustomType(decoders.NullTimeDecoderFn(), []interface{}{nulls.Time{}}, nil)

return HTMLContentTypeBinder{
decoder: decoder,
}
}

// ContentTypes that will be used to identify HTML requests
func (ht HTMLContentTypeBinder) ContentTypes() []string {
return []string{
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/gobuffalo/clara/v2 v2.0.2
github.com/gobuffalo/envy v1.9.0
github.com/gobuffalo/events v1.4.1
github.com/gobuffalo/flect v0.2.1
github.com/gobuffalo/flect v0.2.2
github.com/gobuffalo/genny/v2 v2.0.6
github.com/gobuffalo/github_flavored_markdown v1.1.0
github.com/gobuffalo/helpers v0.6.1
Expand All @@ -34,7 +34,7 @@ require (
github.com/markbates/refresh v1.11.1
github.com/markbates/safe v1.0.1
github.com/markbates/sigtx v1.0.0
github.com/monoculum/formam v0.0.0-20200527175922-6f3cce7a46cf
github.com/monoculum/formam v0.0.0-20200905010316-d7a8fbd33677
github.com/sirupsen/logrus v1.5.0
github.com/spf13/cobra v0.0.6
github.com/spf13/pflag v1.0.5
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ github.com/gobuffalo/flect v0.2.0 h1:EWCvMGGxOjsgwlWaP+f4+Hh6yrrte7JeFL2S6b+0hdM
github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80=
github.com/gobuffalo/flect v0.2.1 h1:GPoRjEN0QObosV4XwuoWvSd5uSiL0N3e91/xqyY4crQ=
github.com/gobuffalo/flect v0.2.1/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc=
github.com/gobuffalo/flect v0.2.2 h1:PAVD7sp0KOdfswjAw9BpLCU9hXo7wFSzgpQ+zNeks/A=
github.com/gobuffalo/flect v0.2.2/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc=
github.com/gobuffalo/genny v0.0.0-20180924032338-7af3a40f2252/go.mod h1:tUTQOogrr7tAQnhajMSH6rv1BVev34H2sa1xNHMy94g=
github.com/gobuffalo/genny v0.0.0-20181003150629-3786a0744c5d/go.mod h1:WAd8HmjMVrnkAZbmfgH5dLBUchsZfqzp/WS5sQz+uTM=
github.com/gobuffalo/genny v0.0.0-20181005145118-318a41a134cc/go.mod h1:WAd8HmjMVrnkAZbmfgH5dLBUchsZfqzp/WS5sQz+uTM=
Expand Down Expand Up @@ -868,10 +870,8 @@ github.com/monoculum/formam v0.0.0-20190730134247-0612307a4099/go.mod h1:JKa2av1
github.com/monoculum/formam v0.0.0-20190830100315-7ff9597b1407/go.mod h1:JKa2av1XVkGjhxdLS59nDoXa2JpmIHpnURWNbzCtXtc=
github.com/monoculum/formam v0.0.0-20191229172733-952f0766a724 h1:qlTmDrFZLQIGXnd1JE58dqyLnKyIJjR9WBeDQcT3O8w=
github.com/monoculum/formam v0.0.0-20191229172733-952f0766a724/go.mod h1:JKa2av1XVkGjhxdLS59nDoXa2JpmIHpnURWNbzCtXtc=
github.com/monoculum/formam v0.0.0-20200316225015-49f0baed3a1b h1:BvSZE/bUSz180cQzAEDVOh7seh57UNBlcGAte0CQ8l4=
github.com/monoculum/formam v0.0.0-20200316225015-49f0baed3a1b/go.mod h1:JKa2av1XVkGjhxdLS59nDoXa2JpmIHpnURWNbzCtXtc=
github.com/monoculum/formam v0.0.0-20200527175922-6f3cce7a46cf h1:DJ+VDi88ZNh+C3HkJlNtfWIeOdLPxFjbtwGbWa/D3sY=
github.com/monoculum/formam v0.0.0-20200527175922-6f3cce7a46cf/go.mod h1:JKa2av1XVkGjhxdLS59nDoXa2JpmIHpnURWNbzCtXtc=
github.com/monoculum/formam v0.0.0-20200905010316-d7a8fbd33677 h1:N11HMdhT5DtkXsQQo3xPFipjvG7QwzKa9MBupRQqXaU=
github.com/monoculum/formam v0.0.0-20200905010316-d7a8fbd33677/go.mod h1:JKa2av1XVkGjhxdLS59nDoXa2JpmIHpnURWNbzCtXtc=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
Expand Down
7 changes: 5 additions & 2 deletions render/js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ func Test_JavaScript_HTML_Partial(t *testing.T) {
bb := &bytes.Buffer{}

r.NoError(h.Render(bb, Data{}))
pre := `let a = "\x3Cdiv`
r.True(strings.HasPrefix(bb.String(), pre))
r.Contains(bb.String(), `id`)
r.Contains(bb.String(), `foo`)

// To check it has escaped the partial
r.NotContains(bb.String(), `<div id="foo">`)
}
2 changes: 1 addition & 1 deletion runtime/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package runtime

// Version is the current version of the buffalo binary
var Version = "v0.16.14"
var Version = "v0.16.15"

0 comments on commit 43fd009

Please sign in to comment.