Skip to content

Commit 1e062c7

Browse files
authored
Release/v0.8.7 (#124)
* Bump up GO version to 1.22.12 * Fix cpu extra load issue
1 parent d23711d commit 1e062c7

File tree

14 files changed

+22
-27
lines changed

14 files changed

+22
-27
lines changed

.github/workflows/binaries.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
needs:
5252
- draft-release
5353
env:
54-
X_GO_DISTRIBUTION: "https://go.dev/dl/go1.22.10.linux-amd64.tar.gz"
54+
X_GO_DISTRIBUTION: "https://go.dev/dl/go1.22.12.linux-amd64.tar.gz"
5555
APIFIREWALL_NAMESPACE: "github.com/wallarm/api-firewall"
5656
strategy:
5757
matrix:
@@ -162,7 +162,7 @@ jobs:
162162
needs:
163163
- draft-release
164164
env:
165-
X_GO_VERSION: "1.22.10"
165+
X_GO_VERSION: "1.22.12"
166166
APIFIREWALL_NAMESPACE: "github.com/wallarm/api-firewall"
167167
strategy:
168168
matrix:
@@ -272,19 +272,19 @@ jobs:
272272
include:
273273
- arch: armv6
274274
distro: bullseye
275-
go_distribution: https://go.dev/dl/go1.22.10.linux-armv6l.tar.gz
275+
go_distribution: https://go.dev/dl/go1.22.12.linux-armv6l.tar.gz
276276
artifact: armv6-libc
277277
- arch: aarch64
278278
distro: bullseye
279-
go_distribution: https://go.dev/dl/go1.22.10.linux-arm64.tar.gz
279+
go_distribution: https://go.dev/dl/go1.22.12.linux-arm64.tar.gz
280280
artifact: arm64-libc
281281
- arch: armv6
282282
distro: alpine_latest
283-
go_distribution: https://go.dev/dl/go1.22.10.linux-armv6l.tar.gz
283+
go_distribution: https://go.dev/dl/go1.22.12.linux-armv6l.tar.gz
284284
artifact: armv6-musl
285285
- arch: aarch64
286286
distro: alpine_latest
287-
go_distribution: https://go.dev/dl/go1.22.10.linux-arm64.tar.gz
287+
go_distribution: https://go.dev/dl/go1.22.12.linux-arm64.tar.gz
288288
artifact: arm64-musl
289289
steps:
290290
- uses: actions/[email protected]

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION := 0.8.6
1+
VERSION := 0.8.7
22
NAMESPACE := github.com/wallarm/api-firewall
33

44
.DEFAULT_GOAL := build

cmd/api-firewall/internal/handlers/api/updater.go

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/corazawaf/coraza/v3"
1010
"github.com/sirupsen/logrus"
1111
"github.com/valyala/fasthttp"
12+
1213
"github.com/wallarm/api-firewall/internal/config"
1314
"github.com/wallarm/api-firewall/internal/platform/allowiplist"
1415
"github.com/wallarm/api-firewall/internal/platform/router"

cmd/api-firewall/tests/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2864,7 +2864,7 @@ func (s *ServiceTests) testCustomHostHeader(t *testing.T) {
28642864
ipAddrs := []net.IPAddr{}
28652865
ipAddrs = append(ipAddrs, net.IPAddr{IP: net.IPv4(127, 0, 0, 1), Zone: ""})
28662866

2867-
s.dnsCache.EXPECT().LookupIPAddr(gomock.Any(), gomock.Any()).Return(ipAddrs, nil).Times(3)
2867+
s.dnsCache.EXPECT().LookupIPAddr(gomock.Any(), gomock.Any()).Return(ipAddrs, nil).Times(2)
28682868

28692869
options := proxy.Options{
28702870
InitialPoolCapacity: 1,

cmd/api-firewall/tests/updater_v2_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ type EntryV2 struct {
6262
Status string `db:"status"`
6363
}
6464

65-
func insertSpecV2(dbFilePath, newSpec string) (*EntryV2, error) {
65+
func insertSpecV2(dbFilePath, newSpec, state string) (*EntryV2, error) {
6666

6767
db, err := sql.Open("sqlite3", dbFilePath)
6868
if err != nil {
6969
return nil, err
7070
}
7171
defer db.Close()
7272

73-
q := fmt.Sprintf("INSERT INTO openapi_schemas(schema_version,schema_format,schema_content,status) VALUES ('1', 'yaml', '%s', 'new')", newSpec)
73+
q := fmt.Sprintf("INSERT INTO openapi_schemas(schema_version,schema_format,schema_content,status) VALUES ('1', 'yaml', '%s', '%s')", newSpec, state)
7474
_, err = db.Exec(q)
7575
if err != nil {
7676
return nil, err
@@ -141,7 +141,7 @@ func TestLoadBasicV2(t *testing.T) {
141141
var lock sync.RWMutex
142142

143143
// create DB entry with spec and status = 'new'
144-
entry, err := insertSpecV2(currentDBPath, testYamlSpecification)
144+
entry, err := insertSpecV2(currentDBPath, testYamlSpecification, "new")
145145
if err != nil {
146146
t.Fatal(err)
147147
}
@@ -250,7 +250,7 @@ func TestUpdaterBasicV2(t *testing.T) {
250250
}
251251

252252
// create DB entry with spec and status = 'new'
253-
entry, err := insertSpecV2(currentDBPath, testYamlSpecification)
253+
entry, err := insertSpecV2(currentDBPath, testYamlSpecification, "new")
254254
if err != nil {
255255
t.Fatal(err)
256256
}
@@ -1096,7 +1096,7 @@ func TestUpdaterFromV1DBToV2(t *testing.T) {
10961096

10971097
// prepare spec with status = 'new'
10981098
// create DB entry with spec and status = 'new'
1099-
entry, err := insertSpecV2(currentDBPath, testYamlSpecification)
1099+
entry, err := insertSpecV2(currentDBPath, testYamlSpecification, "new")
11001100
if err != nil {
11011101
t.Fatal(err)
11021102
}
0 Bytes
Binary file not shown.

demo/docker-compose/OWASP_CoreRuleSet/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.8"
22
services:
33
api-firewall:
44
container_name: api-firewall
5-
image: wallarm/api-firewall:v0.8.6
5+
image: wallarm/api-firewall:v0.8.7
66
restart: on-failure
77
environment:
88
APIFW_URL: "http://0.0.0.0:8080"

demo/docker-compose/docker-compose-api-mode.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.8'
22
services:
33
api-firewall:
44
container_name: api-firewall
5-
image: wallarm/api-firewall:v0.8.6
5+
image: wallarm/api-firewall:v0.8.7
66
restart: on-failure
77
environment:
88
APIFW_MODE: "api"

demo/docker-compose/docker-compose-graphql-mode.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.8'
22
services:
33
api-firewall:
44
container_name: api-firewall
5-
image: wallarm/api-firewall:v0.8.6
5+
image: wallarm/api-firewall:v0.8.7
66
restart: on-failure
77
environment:
88
APIFW_MODE: "graphql"

demo/docker-compose/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.8"
22
services:
33
api-firewall:
44
container_name: api-firewall
5-
image: wallarm/api-firewall:v0.8.6
5+
image: wallarm/api-firewall:v0.8.7
66
restart: on-failure
77
environment:
88
APIFW_URL: "http://0.0.0.0:8080"

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/wallarm/api-firewall
22

3-
go 1.22.10
3+
go 1.22.12
44

55
require (
66
github.com/andybalholm/brotli v1.1.1

helm/api-firewall/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: api-firewall
33
version: 0.7.2
4-
appVersion: 0.8.6
4+
appVersion: 0.8.7
55
description: Wallarm OpenAPI-based API Firewall
66
home: https://github.com/wallarm/api-firewall
77
icon: https://static.wallarm.com/wallarm-logo.svg

internal/platform/proxy/chainpool.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import (
2222
"github.com/wallarm/api-firewall/internal/config"
2323
)
2424

25-
const defaultConcurrency = 1000
26-
2725
var defaultLookUpTimeout = 1 * time.Second
2826

2927
var (
@@ -70,12 +68,7 @@ func (p *chanPool) factory(connAddr string) HTTPClient {
7068
DisableHeaderNamesNormalizing: true,
7169
DisablePathNormalizing: true,
7270
Dial: func(addr string) (net.Conn, error) {
73-
tcpDialer := &fasthttp.TCPDialer{
74-
Concurrency: defaultConcurrency,
75-
Resolver: p.dnsResolver,
76-
DisableDNSResolution: p.options.DNSConfig.Cache,
77-
}
78-
return tcpDialer.DialTimeout(connAddr, p.options.DialTimeout)
71+
return fasthttp.DialTimeout(connAddr, p.options.DialTimeout)
7972
},
8073
TLSConfig: p.tlsConfig,
8174
MaxConnsPerHost: p.options.MaxConnsPerHost,

internal/platform/storage/dbv1.go

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
"github.com/getkin/kin-openapi/openapi3"
1414
_ "github.com/mattn/go-sqlite3"
15+
1516
"github.com/wallarm/api-firewall/internal/platform/loader"
1617
)
1718

0 commit comments

Comments
 (0)