Skip to content

Commit c2fedde

Browse files
authored
Updated go version to fix 3 CVEs (#559)
* Updated go version to fix 3 CVEs * Verifying updating the golangci version fixes the issue of not being able to load rules. * Disabling depguard as the newer version of depguard included in golangci-lint requires list of acceptable packages. * Fixed the random generator lint on test * Adding the comment to ignore like in tests as its started to scan these errors * Removed redundant string to fix yaml linter * Updating the version of go in golangci.yml, fixing the linters and added unreleased changelog * Added pr number and author to changelog
1 parent ebf6568 commit c2fedde

File tree

17 files changed

+180
-153
lines changed

17 files changed

+180
-153
lines changed

.github/workflows/analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: golangci-lint
2424
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc
2525
with:
26-
version: v1.52.2
26+
version: v1.56.2
2727

2828
- name: shellcheck
2929
uses: azohra/shell-linter@6bbeaa868df09c34ddc008e6030cfe89c03394a1

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
name: Set up Go
5858
uses: actions/setup-go@v4
5959
with:
60-
go-version: 1.19
60+
go-version: 1.22
6161
check-latest: true
6262
cache: true
6363
-

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
go: ["1.20", "1.19"]
17+
go: [1.22.1]
1818
name: go ${{ matrix.go }}
1919
steps:
2020
- name: Checkout
@@ -46,7 +46,7 @@ jobs:
4646
- name: Setup go
4747
uses: actions/setup-go@v4
4848
with:
49-
go-version: 1.19
49+
go-version: 1.22
5050
check-latest: true
5151
cache: true
5252

.golangci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
run:
3-
go: "1.15"
3+
go: "1.22"
44
linters:
55
disable-all: true
66
enable:
77
- bodyclose
8-
- depguard
8+
# https://github.com/atc0005/go-ci/issues/1024
9+
# - depguard
910
- dogsled
1011
- exhaustive
1112
- funlen

CHANGELOG.md

Lines changed: 122 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,210 +1,213 @@
11
# [Unreleased]
22

3+
- Updated go version to 1.22.1 to fix 3 CVEs (#559, @dianadevasia)
4+
- Updated the version of golangci to 1.56.2 and disabled depguard rule in golangci (#559, @dianadevasia)
5+
36
# [2.8.0] - 2024-02-27
47

5-
* toxiproxy-cli - sortedAttributes sort by attribute.key instead attribute.value (#543, @jesseward)
8+
- toxiproxy-cli - sortedAttributes sort by attribute.key instead attribute.value (#543, @jesseward)
69

710
# [2.7.0] - 2023-10-25
811

9-
* Fix invalid JSON in /version endpoint response (#538, @whatyouhide)
10-
* Update minimum supported Go version 1.19. (@abecevello)
12+
- Fix invalid JSON in /version endpoint response (#538, @whatyouhide)
13+
- Update minimum supported Go version 1.19. (@abecevello)
1114

1215
# [2.6.0] - 2023-08-22
1316

14-
* Gracefull shutdown of HTTP server. (#439, @miry)
15-
* Support PATCH HTTP method for Proxy update(`PATCH /proxies/{proxy}`) and
17+
- Gracefull shutdown of HTTP server. (#439, @miry)
18+
- Support PATCH HTTP method for Proxy update(`PATCH /proxies/{proxy}`) and
1619
Toxic update(`PATCH /proxies/{proxy}/toxics/{toxic}`) endpoints.
1720
Deprecat POST HTTP method for those endpoints. (@miry)
18-
* Client does not parse response body in case of errors for Populate.
21+
- Client does not parse response body in case of errors for Populate.
1922
Requires to get current proxies with new command. (#441, @miry)
20-
* Client specifies `User-Agent` HTTP header for all requests as
23+
- Client specifies `User-Agent` HTTP header for all requests as
2124
"toxiproxy-cli/<version> <os>/<runtime>".
2225
Specifies client request content type as `application/json`. (#441, @miry)
23-
* Replace Api.Listen parameters `host` and `port` with single `addr`. (#445, @miry)
26+
- Replace Api.Listen parameters `host` and `port` with single `addr`. (#445, @miry)
2427

2528
# [2.5.0] - 2022-09-10
2629

27-
* Update Release steps. (#369, @neufeldtech)
28-
* Migrate off probot-CLA to new GitHub Action. (#405, @cursedcoder)
29-
* Support go 1.18, 1.19. (#415, @miry)
30-
* `toxiproxy.NewProxy` now accepts `name`, `listen addr` and `upstream addr`. (#418, @miry)
31-
* Replace logrus with zerolog. (#413, @miry)
32-
* Log HTTP requests to API server. (#413, #421, @miry)
33-
* Add TimeoutHandler for the HTTP API server. (#420, @miry)
34-
* Set Write and Read timeouts for HTTP API server connections. (#423, @miry)
35-
* Show unique request id in API HTTP response. (#425, @miry)
36-
* Add method to parse `stream.Direction` from a string.
30+
- Update Release steps. (#369, @neufeldtech)
31+
- Migrate off probot-CLA to new GitHub Action. (#405, @cursedcoder)
32+
- Support go 1.18, 1.19. (#415, @miry)
33+
- `toxiproxy.NewProxy` now accepts `name`, `listen addr` and `upstream addr`. (#418, @miry)
34+
- Replace logrus with zerolog. (#413, @miry)
35+
- Log HTTP requests to API server. (#413, #421, @miry)
36+
- Add TimeoutHandler for the HTTP API server. (#420, @miry)
37+
- Set Write and Read timeouts for HTTP API server connections. (#423, @miry)
38+
- Show unique request id in API HTTP response. (#425, @miry)
39+
- Add method to parse `stream.Direction` from a string.
3740
Allow converting `stream.Direction` to string. (#430, @miry)
38-
* Add the possibility to write to Output with a deadline.
41+
- Add the possibility to write to Output with a deadline.
3942
On interrupting Bandwidth toxic, use non-blocking writes. (#436, @miry)
40-
* Update minimum supported Go version 1.17. (#438, @miry)
43+
- Update minimum supported Go version 1.17. (#438, @miry)
4144

4245
# [2.4.0] - 2022-03-07
4346

44-
* Verify git tag on release (#347, @miry)
45-
* Fix MacOS 12 tests for go17 with -race flag (#351, @strech)
46-
* Rename `testing/` and `bin/` folders (#354, @strech)
47-
* Added verbose error on proxy upstream dialing (#355, @f-dg)
48-
* Improve server startup message (#358, @areveny)
49-
* Introduce yaml linter. (#362, @miry)
50-
* Handle slicer toxic with zero `SizeVariation` and fix slicing randomization (#359, @areveny)
51-
* Added /metrics endpoint for exposing Prometheus-compatible internal metrics (#366, @neufeldtech)
47+
- Verify git tag on release (#347, @miry)
48+
- Fix MacOS 12 tests for go17 with -race flag (#351, @strech)
49+
- Rename `testing/` and `bin/` folders (#354, @strech)
50+
- Added verbose error on proxy upstream dialing (#355, @f-dg)
51+
- Improve server startup message (#358, @areveny)
52+
- Introduce yaml linter. (#362, @miry)
53+
- Handle slicer toxic with zero `SizeVariation` and fix slicing randomization (#359, @areveny)
54+
- Added /metrics endpoint for exposing Prometheus-compatible internal metrics (#366, @neufeldtech)
5255

5356
# [2.3.0] - 2021-12-23
5457

55-
* Store all the executable `main` packages in `cmd` folder. (#335, @miry)
56-
* Extract common test helpers to own files. (#336, @miry)
57-
* Client: Allow HTTPS endpoints. (#338, @chen-anders)
58-
* client.Populate assign client to proxy. (#291, @hellodudu)
59-
* fix: The release-test task is always success.
58+
- Store all the executable `main` packages in `cmd` folder. (#335, @miry)
59+
- Extract common test helpers to own files. (#336, @miry)
60+
- Client: Allow HTTPS endpoints. (#338, @chen-anders)
61+
- client.Populate assign client to proxy. (#291, @hellodudu)
62+
- fix: The release-test task is always success.
6063
add: Allow to run release-test on arm machines. (#340, @miry)
61-
* Upgrade `goreleaser`. Support `armv7` and `armv6` oses. (#339, @mitchellrj)
62-
* Allow to change log level for server. (#346, @miry)
64+
- Upgrade `goreleaser`. Support `armv7` and `armv6` oses. (#339, @mitchellrj)
65+
- Allow to change log level for server. (#346, @miry)
6366

6467
# [2.2.0] - 2021-10-17
6568

66-
* Update linux packages to use `/usr/bin` folder as binary destination and change the executable names to
69+
- Update linux packages to use `/usr/bin` folder as binary destination and change the executable names to
6770
exclude ARCH and OS names. New pathes:
6871
```
6972
/usr/bin/toxiproxy-cli
7073
/usr/bin/toxiproxy-server
7174
```
7275
(#331, @miry)
73-
* A new toxic to simulate TCP RESET (Connection reset by peer) on the connections by closing
76+
- A new toxic to simulate TCP RESET (Connection reset by peer) on the connections by closing
7477
the stub Input immediately or after a timeout. (#247 and #333, @chaosbox)
7578

7679
# [2.1.7] - 2021-09-23
7780

78-
* Set the valid version during the build process.
81+
- Set the valid version during the build process.
7982
Verify the correct verion of the built binaries with `make release-dry` (#328, @miry)
8083

8184
# [2.1.6] - 2021-09-23
8285

83-
* Use CHANGELOG.md for release description (#306, @miry)
84-
* Dependency updates in #294 introduced a breaking change in CLI argument parsing.
86+
- Use CHANGELOG.md for release description (#306, @miry)
87+
- Dependency updates in #294 introduced a breaking change in CLI argument parsing.
8588
Now [flags must be specified before arguments](https://github.com/urfave/cli/blob/master/docs/migrate-v1-to-v2.md#flags-before-args).
8689
Previously, arguments could be specified prior to flags.
8790
Update usage help text and documentation. (#308, @miry)
88-
* Run e2e tests to validate the command line and basic features of server,
91+
- Run e2e tests to validate the command line and basic features of server,
8992
client and application (#309, @miry)
90-
* Add /v2 suffix to module import path (#311, @dnwe)
91-
* Setup automated checking source code for security vulnerabilities (#312, @miry)
92-
* Setup code linter (#314, @miry)
93-
* Max line length is 100 characters (#316, @miry)
94-
* Linter to check whether HTTP response body is closed successfully (#317, @miry)
95-
* Make sure the function are not big (#318, @miry)
96-
* Extract client flags specs to seprate methods.
93+
- Add /v2 suffix to module import path (#311, @dnwe)
94+
- Setup automated checking source code for security vulnerabilities (#312, @miry)
95+
- Setup code linter (#314, @miry)
96+
- Max line length is 100 characters (#316, @miry)
97+
- Linter to check whether HTTP response body is closed successfully (#317, @miry)
98+
- Make sure the function are not big (#318, @miry)
99+
- Extract client flags specs to seprate methods.
97100
Introduce a new way to manage toxics with `ToxicOptions` structure (#321, @miry)
98-
* Split `Proxy.server` to multiple small (#322, @miry)
99-
* Extract initializetion of fake upstream server to test helper (#323, @miry)
100-
* Support a list of well knonwn linters (#326, @miry)
101-
* `--host` flag uses `TOXIPROXY_URL` if it is set (#319, @maaslalani)
102-
* Run benchmarks in CI/CD (#320, @miry)
103-
* Use scratch docker base image instead of alpine (#325, @miry)
101+
- Split `Proxy.server` to multiple small (#322, @miry)
102+
- Extract initializetion of fake upstream server to test helper (#323, @miry)
103+
- Support a list of well knonwn linters (#326, @miry)
104+
- `--host` flag uses `TOXIPROXY_URL` if it is set (#319, @maaslalani)
105+
- Run benchmarks in CI/CD (#320, @miry)
106+
- Use scratch docker base image instead of alpine (#325, @miry)
104107

105108
# [2.1.5] - 2021-09-01
106109

107-
* Move to Go Modules from godeps (#253, @epk)
108-
* Update the example in `client/README.md` (#251, @nothinux)
109-
* Update TOC in `README.md` (4ca1eddddfcd0c50c8f6dfb97089bb68e6310fd9, @dwradcliffe)
110-
* Add an example of `config.json` file to `README.md` (#260, @JesseEstum)
111-
* Add Link to Elixir Client (#287, @Jcambass)
112-
* Add Rust client link (#293, @itarato)
113-
* Renovations: formatting code, update dependicies, make govet/staticcheck pass (#294, @dnwe)
114-
* Remove `openssl` from `dev.yml` to use `dev` tool (#298, @pedro-stanaka)
115-
* Update `go` versions in development (#299, @miry)
116-
* Mention `MacPorts` in `README.md` (#290, @amake)
117-
* Fix some typos in `README.md` and `CHANGELOG.md` (#222, @jwilk)
118-
* Replace TravisCI with Github Actions to run tests (#303, @miry)
119-
* Build and release binaries with `goreleaser`. Support `arm64` and BSD oses. (#301, @miry)
120-
* Automate release with Github actions (#304, @miry)
110+
- Move to Go Modules from godeps (#253, @epk)
111+
- Update the example in `client/README.md` (#251, @nothinux)
112+
- Update TOC in `README.md` (4ca1eddddfcd0c50c8f6dfb97089bb68e6310fd9, @dwradcliffe)
113+
- Add an example of `config.json` file to `README.md` (#260, @JesseEstum)
114+
- Add Link to Elixir Client (#287, @Jcambass)
115+
- Add Rust client link (#293, @itarato)
116+
- Renovations: formatting code, update dependicies, make govet/staticcheck pass (#294, @dnwe)
117+
- Remove `openssl` from `dev.yml` to use `dev` tool (#298, @pedro-stanaka)
118+
- Update `go` versions in development (#299, @miry)
119+
- Mention `MacPorts` in `README.md` (#290, @amake)
120+
- Fix some typos in `README.md` and `CHANGELOG.md` (#222, @jwilk)
121+
- Replace TravisCI with Github Actions to run tests (#303, @miry)
122+
- Build and release binaries with `goreleaser`. Support `arm64` and BSD oses. (#301, @miry)
123+
- Automate release with Github actions (#304, @miry)
121124

122125
# [2.1.4] - 2019-01-11
123126

124-
* Bug fix: Fix OOM in toxic. #232
125-
* Documentation updates.
126-
* CI and test updates.
127+
- Bug fix: Fix OOM in toxic. #232
128+
- Documentation updates.
129+
- CI and test updates.
127130

128131
# [2.1.3] - 2018-03-05
129132

130-
* Update `/version` endpoint to also return a charset of utf-8. #204
131-
* Bug fix: Double http concatenation. #191
132-
* Update cli examples to be more accurate. #187
133+
- Update `/version` endpoint to also return a charset of utf-8. #204
134+
- Bug fix: Double http concatenation. #191
135+
- Update cli examples to be more accurate. #187
133136

134137
# [2.1.2] - 2017-07-10
135138

136-
* go 1.8, make Sirupsen lower case, update godeps (issue #179)
137-
* Handle SIGTERM to exit cleanly (issue #180)
138-
* Address security issue by disallowing browsers from accessing API
139+
- go 1.8, make Sirupsen lower case, update godeps (issue #179)
140+
- Handle SIGTERM to exit cleanly (issue #180)
141+
- Address security issue by disallowing browsers from accessing API
139142

140143
# [2.1.1] - 2017-05-16
141144

142-
* Fix timeout toxic causing hang (issue #159)
145+
- Fix timeout toxic causing hang (issue #159)
143146

144147
# [2.1.0] - 2016-12-07
145148

146-
* Add -config server option to populate on startup #154
147-
* Updated CLI for scriptability #133
148-
* Add `/populate` endpoint to server #111
149-
* Change error responses from `title` to `error`
150-
* Allow hostname to be specified in CLI #129
151-
* Add support for stateful toxics #127
152-
* Add limit_data toxic
149+
- Add -config server option to populate on startup #154
150+
- Updated CLI for scriptability #133
151+
- Add `/populate` endpoint to server #111
152+
- Change error responses from `title` to `error`
153+
- Allow hostname to be specified in CLI #129
154+
- Add support for stateful toxics #127
155+
- Add limit_data toxic
153156

154157
# [2.0.0] - 2016-04-25
155158

156-
* Add CLI (`toxiproxy-cli`) and rename server binary to `toxiproxy-server` #93
157-
* Fix removing a timeout toxic causing API to hang #89
158-
* API and client return toxics as array rather than a map of name to toxic #92
159-
* Fix multiple latency toxics not accumulating #94
160-
* Change default toxic name to `<type>_<stream>` #96
161-
* Nest toxic attributes rather than having a flat structure #98
162-
* 2.0 RFC: #54 and PR #62
163-
* Change toxic API endpoints to an Add/Update/Remove structure
164-
* Remove `enabled` field, and add `name` and `type` fields to toxics
165-
* Add global toxic fields to a wrapper struct
166-
* Chain toxics together dynamically instead of in a fixed length chain
167-
* Register toxics in `init()` functions instead of a hard-coded list
168-
* Clean up API error codes to make them more consistent
169-
* Move toxics to their own package to allow 3rd party toxics
170-
* Remove stream direction from API urls #73
171-
* Add `toxicity` field for toxics #75
172-
* Refactor Go client to make usage easier with 2.0 #76
173-
* Make `ChanReader` in the `stream` package interruptible #77
174-
* Define proxy buffer sizes per-toxic (Fixes #72)
175-
* Fix slicer toxic testing race condition #71
159+
- Add CLI (`toxiproxy-cli`) and rename server binary to `toxiproxy-server` #93
160+
- Fix removing a timeout toxic causing API to hang #89
161+
- API and client return toxics as array rather than a map of name to toxic #92
162+
- Fix multiple latency toxics not accumulating #94
163+
- Change default toxic name to `<type>_<stream>` #96
164+
- Nest toxic attributes rather than having a flat structure #98
165+
- 2.0 RFC: #54 and PR #62
166+
- Change toxic API endpoints to an Add/Update/Remove structure
167+
- Remove `enabled` field, and add `name` and `type` fields to toxics
168+
- Add global toxic fields to a wrapper struct
169+
- Chain toxics together dynamically instead of in a fixed length chain
170+
- Register toxics in `init()` functions instead of a hard-coded list
171+
- Clean up API error codes to make them more consistent
172+
- Move toxics to their own package to allow 3rd party toxics
173+
- Remove stream direction from API urls #73
174+
- Add `toxicity` field for toxics #75
175+
- Refactor Go client to make usage easier with 2.0 #76
176+
- Make `ChanReader` in the `stream` package interruptible #77
177+
- Define proxy buffer sizes per-toxic (Fixes #72)
178+
- Fix slicer toxic testing race condition #71
176179

177180
# [1.2.1] - 2015-07-24
178181

179-
* Fix proxy name conflicts leaking an open port #69
182+
- Fix proxy name conflicts leaking an open port #69
180183

181184
# [1.2.0] - 2015-07-23
182185

183-
* Add a Toxic and Toxics type for the Go client
184-
* Add `Dockerfile`
185-
* Fix latency toxic limiting bandwidth #67
186-
* Add Slicer toxic
186+
- Add a Toxic and Toxics type for the Go client
187+
- Add `Dockerfile`
188+
- Fix latency toxic limiting bandwidth #67
189+
- Add Slicer toxic
187190

188191
# [1.1.0] - 2015-05-05
189192

190-
* Remove /toxics endpoint in favour of /proxies
191-
* Add bandwidth toxic
193+
- Remove /toxics endpoint in favour of /proxies
194+
- Add bandwidth toxic
192195

193196
# [1.0.3] - 2015-04-29
194197

195-
* Rename Go library package to Toxiproxy from Client
196-
* Fix latency toxic send to closed channel panic #46
197-
* Fix latency toxic accumulating delay #47
198+
- Rename Go library package to Toxiproxy from Client
199+
- Fix latency toxic send to closed channel panic #46
200+
- Fix latency toxic accumulating delay #47
198201

199202
# [1.0.2] - 2015-04-12
200203

201-
* Added Toxic support to Go client
204+
- Added Toxic support to Go client
202205

203206
# [1.0.1] - 2015-03-31
204207

205-
* Various improvements to the documentation
206-
* Initial version of Go client
207-
* Fix toxic disabling bug #42
208+
- Various improvements to the documentation
209+
- Initial version of Go client
210+
- Fix toxic disabling bug #42
208211

209212
# [1.0.0] - 2015-01-07
210213

0 commit comments

Comments
 (0)