Commit Graph

1752 Commits

Author SHA1 Message Date
dependabot[bot] f80ade7a4b
chore(deps): bump golangci/golangci-lint-action from 4 to 5 (#3941)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 4 to 5.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 07:07:01 +08:00
Bo-Yi Wu 0397e5e0c0
chore: update changelog categories and improve documentation (#3917)
- Add new changelog categories for "Build process updates" and "Documentation updates"

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-04-07 10:18:23 +08:00
Bo-Yi Wu c6f90df4e0
chore: update various Go dependencies to latest versions (#3901)
- Update `github.com/bytedance/sonic` from v1.11.0 to v1.11.3
- Update `github.com/go-playground/validator/v10` from v10.18.0 to v10.19.0
- Update `github.com/pelletier/go-toml/v2` from v2.1.1 to v2.2.0
- Update `github.com/stretchr/testify` from v1.8.4 to v1.9.0
- Update `golang.org/x/net` from v0.21.0 to v0.22.0
- Update `golang.org/x/crypto` from v0.19.0 to v0.21.0
- Update `golang.org/x/sys` from v0.17.0 to v0.18.0

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-04-02 18:57:22 +08:00
Bo-Yi Wu 8acbe657f1
ci(release): refactor changelog regex patterns and exclusions (#3914)
* chore: refactor changelog regex patterns and exclusions

- Update the build configuration to skip the build using a comment
- Change the `changelog` use from `git` to `github`
- Modify the regex patterns for `Features`, `Bug fixes`, and `Enhancements` titles in the changelog
- Add a new regex pattern for the `Refactor` title in the changelog
- Update the excluded items in the changelog to include `docs` and `CICD` with corrected quotes

Signed-off-by: appleboy <appleboy.tw@gmail.com>

* chore: update configuration file field names

- Change the `skip` field to `disable` in the `.goreleaser.yaml` file.

Signed-off-by: appleboy <appleboy.tw@gmail.com>

* update

Signed-off-by: appleboy <appleboy.tw@gmail.com>

* chore: refine changelog categorization rules

- Update regular expressions for `feat`, `fix`, and `chore` categories in `.goreleaser.yaml`
- Remove `Refactor` category from changelog configuration
- Add `Refactor` category with updated regular expression and order to changelog configuration

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-04-02 16:20:48 +08:00
imalasong 56dc72c4d5
ci(Makefile): vet command add .PHONY (#3915) 2024-04-02 11:58:00 +08:00
Name c964ad370b
chore(optimize): the ShouldBindUri method of the Context struct (#3911)
Co-authored-by: huangzw <huangzw@hsmap.com>
2024-04-01 12:58:01 +08:00
RedCrazyGhost 7a865dcf1d
feat(bind): ShouldBindBodyWith shortcut and change doc (#3871)
* feat: ShouldBindBodyWith shortcut and change doc

* fix: yaml can parse json test case

* style: fix new test case in context_test.go

* chore: modify the code style to specify binding type

* chroe: gofmt modifies the code format
2024-03-23 22:09:02 +08:00
ssfyn fd1faaded0
feat(binding): support override default binding implement (#3514) 2024-03-23 08:50:25 +08:00
Bo-Yi Wu d4e4136488
Revert "fix(uri): query binding bug (#3236)" (#3899)
This reverts commit 8790d08909.
2024-03-22 10:01:27 +08:00
illiafox 8790d08909
fix(uri): query binding bug (#3236)
* fix query mapping

* query binding test
2024-03-21 22:28:42 +08:00
Flc゛ 78f4687875
build(codecov): Added a codecov configuration (#3891)
Signed-off-by: Flc゛ <four_leaf_clover@foxmail.com>
2024-03-21 21:13:56 +08:00
Farmer.Chillax 2b1da2b0b3
fix(context): make context Value method adhere to Go standards (#3897) 2024-03-21 21:08:41 +08:00
Guilherme Aleixo 0d9dbbb445
chore(security): upgrade Protobuf for CVE-2024-24786 (#3893) 2024-03-18 22:14:06 +08:00
Flc゛ fd60a24ab7
test(path): Optimize unit test execution results (#3883)
* test(path): Add a GC recycle validation

* test(path): Optimize unit test execution results

* test(path): Optimize unit test execution results
2024-03-14 11:22:54 +08:00
Endless Paradox ee70b30a97
docs: Add document to constant `AuthProxyUserKey` and `BasicAuthForProxy`. (#3887) 2024-03-13 23:22:05 +08:00
Flc゛ 990c44aebf
docs(context): Added deprecation comments to BindWith (#3880) 2024-03-12 13:55:52 +08:00
Endless Paradox 861ffb9181
docs(middleware): comments to function `BasicAuthForProxy` (#3881) 2024-03-12 13:51:04 +08:00
Flc゛ f70dd00b00
fix(engine): fix unit test (#3878)
* fix(engine): fix unit test

* fix(engine): fix unit test
2024-03-12 13:49:23 +08:00
Noah Yao ab8042e9e5
chore(request): check reader if it's nil before reading (#3419) 2024-03-11 22:44:28 +08:00
Jose Diaz-Gonzalez 1b3c085969
chore(debug): add ability to override the debugPrint statement (#2337)
* feat: add ability to override the debugPrint statement

This allows users to use a single logger within their application for all printing, regardless of level.

* chore: make the code more readable, as per review comment

* fix: use tab instead of space for indentation
2024-03-11 22:41:07 +08:00
Flc゛ ac5e84d93c
feat(engine): Added `OptionFunc` and `With` (#3572)
* feat: Added `OptionFunc` and `With`

* fix: `With(opts...)` must be after `New`

* feat: improve New with

* fix: test

* optimize code

* optimize nolint

* optimize code

Signed-off-by: Flc゛ <four_leaf_clover@foxmail.com>

---------

Signed-off-by: Flc゛ <four_leaf_clover@foxmail.com>
2024-03-11 22:35:30 +08:00
TotomiEcio 83fc7673f9
docs: fix typo in function documentation (#3872) 2024-03-11 22:25:28 +08:00
qingmu 646312aef6
fix: protect Context.Keys map when call Copy method (#3873) 2024-03-11 22:24:36 +08:00
Endless Paradox 5f458dd1a6
feat(auth): add proxy-server authentication (#3877) 2024-03-11 22:22:58 +08:00
jessetang 97eab7d09a
test(git): gitignore add develop tools (#3370) 2024-03-08 15:56:00 +08:00
jessetang 3ea8bd99fb
chore(refactor): modify interface check way (#3855)
Signed-off-by: demoManito <1430482733@qq.com>
2024-03-06 22:27:21 +08:00
Karthik Reddy Puli 09f8224593
fix(route): Add fullPath in context copy (#3784)
* fix: Add fullPath in context copy

* Update context.go

---------

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-03-06 16:46:53 +08:00
guangwu f75144a356
docs: fix typo in comment (#3868)
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
2024-03-05 21:55:25 +08:00
Vincent Bernat 9c61295efe
chore(header): Add support for RFC 9512: application/yaml (#3851)
* fix(binding): support application/yaml

RFC 9512 defines application/yaml as the official YAML MIME type.
application/x-yaml is deprecated. In this commit, we ensure it is
recognized correctly in Content-Type.

* fix(render): use application/yaml when rendering YAML

As per RFC 9512, application/x-yaml is now deprecated and applications
should use application/yaml. This commit fix the Content-Type header
when rendering YAML.
2024-03-05 21:54:35 +08:00
guangwu ae15646aba
test(http): use constant instead of numeric literal (#3863)
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
2024-03-05 14:36:02 +08:00
Name 739d2d9c80
chore(perf): Optimize the Copy method of the Context struct (#3859)
* Optimize the Copy method of the Context struct: using 'make' to initialize the map('cp.Keys') with a length of 'c.Keys'; avoiding repeatedly assiging the 'params' to 'context'.

* Using temporary variables to save c.Keys and c.Params to prevent them from changing during the copying process.

---------

Co-authored-by: huangzw <huangzw@hsmap.com>
2024-03-05 14:07:11 +08:00
Bo-Yi Wu ecdbbbe948
chore: refactor CI and update dependencies (#3848)
- Update GitHub Actions workflow to use a unified step for checking out the repository and setting up Go with dynamic versioning
- Upgrade golangci-lint-action version from v3.7.0 to v4 and bump the lint version from v1.56.1 to v1.56.2
- Update dependencies in go.mod: sonic from v1.10.2 to v1.11.0, validator from v10.17.0 to v10.18.0, x/net from v0.20.0 to v0.21.0, go-urn from v1.3.0 to v1.4.0, x/crypto from v0.18.0 to v0.19.0, and x/sys from v0.16.0 to v0.17.0

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-02-19 10:34:48 +08:00
Bo-Yi Wu 000fdb3ac9
ci(testing): add go1.22 version (#3842)
* chore: update gin version and remove unnecessary steps in GitHub workflows

- Update the version of gin to v1.56.1 in the `.github/workflows/gin.yml` file
- Add go version 1.22 to the list of supported versions in the `.github/workflows/gin.yml` file
- Remove the unnecessary step "Set up Go" in the `.github/workflows/goreleaser.yml` file
- Update the step name "Run GoReleaser" in the `.github/workflows/goreleaser.yml` file

Signed-off-by: appleboy <appleboy.tw@gmail.com>

* ci: update dependencies and CI configurations

- Update conditional Go version check in GitHub Actions workflow from `1.21.x` to `1.22.x`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* ci: improve CI Robustness and Test Reliability

- Add `-race` flag to the test-tags list in GitHub Actions workflow configuration

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-02-18 17:32:06 +08:00
Andy Brody bb3519d26f
chore(IP): add TrustedPlatform constant for Fly.io. (#3839)
Also add some more detail to the docs for how to use TrustedPlatform.

https://fly.io/docs/reference/runtime-environment/#fly-client-ip
2024-02-07 20:18:53 +08:00
Alonso Villegas 82bcd6d39b
fix(binding): dereference pointer to struct (#3199) 2024-02-07 19:44:11 +08:00
Gabriel Augendre 86ff4a64c7
fix(header): Allow header according to RFC 7231 (HTTP 405) (#3759)
Co-authored-by: Helios <i@shangyes.net>
2024-02-06 11:08:56 +08:00
dependabot[bot] e957d1abf1
chore(deps): bump codecov/codecov-action from 3 to 4 (#3838)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 10:39:24 +08:00
clearcode 3dc1cd6572
fix(binding): binding error while not upload file (#3819) (#3820)
Co-authored-by: zhangmj <zhangmj1@dustess.com>
2024-02-05 10:46:35 +08:00
Prakhar Gurunani 9f598a31aa
fix(router): catch-all conflicting wildcard (#3812)
* fix: catch-all conflicting wildcard

* add: test cases

* chore: update GitHub Actions configuration (#3792)

- Change the cron schedule from `'0 17 * * 5'` to `"0 17 * * 5"` in the file `.github/workflows/codeql.yml`
- Change the value of `language` from `['go']` to `["go"]` in the file `.github/workflows/codeql.yml`
- Change the value of `go-version` from `'^1.18'` to `"^1.18"` in the file `.github/workflows/gin.yml`
- Add `1.21` to the list of `go` versions and change the value of `test-tags` in the file `.github/workflows/gin.yml`
- Change the value of `if` condition from `matrix.go-version == '1.20.x'` to `matrix.go-version == '1.21.x'` in the file `.github/workflows/gin.yml`
- Change the value of `on` from `'*'` to `"*"` in the file `.github/workflows/goreleaser.yml`
- Change the name of the job from `name: Checkout` to `name: Checkout` in the file `.github/workflows/goreleaser.yml`
- Change the name of the job from `name: Set up Go` to `name: Set up Go` in the file `.github/workflows/goreleaser.yml`
- Change the value of `go-version` from `1.20` to `"^1"` in

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore(deps): bump github/codeql-action from 2 to 3 (#3806)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(sec): upgrade golang.org/x/crypto to 0.17.0 (#3832)

* ci(lint): update tooling and workflows for consistency (#3834)

* chore: update tooling and workflows for consistency

- Update the version of a tool in the GitHub workflow from `v1.52.2` to `v1.55.2`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: refactor linter configuration in CI

- Remove the `depguard` linter from the `.golangci.yml` configuration

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* ci: refine CI workflow and test configurations

- Disable caching in the GitHub Actions workflow for `gin.yml`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* refactor: refactor return logic in tree operations

- Modify multiple return statements in `tree.go` to return a specific value instead of nothing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore(deps): update dependencies to latest versions (#3835)

* chore: update dependencies to latest versions

- Update `sonic` library from `v1.9.1` to `v1.10.2`
- Update `validator` library from `v10.16.0` to `v10.17.0`
- Update `go-isatty` library from `v0.0.19` to `v0.0.20`
- Update `go/codec`, `x/net`, and `protobuf` libraries to newer versions
- Update `base64x` to a newer commit and add `iasm` library as an indirect dependency
- Update `mimetype`, `cpuid`, `go-urn`, `x/arch`, `x/crypto`, and `x/sys` libraries to newer versions

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* ci: refactor CI workflows and improve robustness

- Update GitHub Actions cache from v3 to v4 in the workflow configuration

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* wip: fix tests

* wip: fix tests

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: caption <101684156+chncaption@users.noreply.github.com>
2024-02-04 21:14:29 +08:00
Ghobad c6ae2e6966
feat(logger): ability to skip logs based on user-defined logic (#3593)
* log skipper

* do not call time.now() if logging should be skipped

* do not ignore skip func delay in latency calculation

* write docs

* write test
2024-02-02 09:52:26 +08:00
Bo-Yi Wu a64286a776
chore(deps): update dependencies to latest versions (#3835)
* chore: update dependencies to latest versions

- Update `sonic` library from `v1.9.1` to `v1.10.2`
- Update `validator` library from `v10.16.0` to `v10.17.0`
- Update `go-isatty` library from `v0.0.19` to `v0.0.20`
- Update `go/codec`, `x/net`, and `protobuf` libraries to newer versions
- Update `base64x` to a newer commit and add `iasm` library as an indirect dependency
- Update `mimetype`, `cpuid`, `go-urn`, `x/arch`, `x/crypto`, and `x/sys` libraries to newer versions

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* ci: refactor CI workflows and improve robustness

- Update GitHub Actions cache from v3 to v4 in the workflow configuration

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-02-01 12:17:36 +08:00
Bo-Yi Wu 8ab47c694e
ci(lint): update tooling and workflows for consistency (#3834)
* chore: update tooling and workflows for consistency

- Update the version of a tool in the GitHub workflow from `v1.52.2` to `v1.55.2`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: refactor linter configuration in CI

- Remove the `depguard` linter from the `.golangci.yml` configuration

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* ci: refine CI workflow and test configurations

- Disable caching in the GitHub Actions workflow for `gin.yml`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* refactor: refactor return logic in tree operations

- Modify multiple return statements in `tree.go` to return a specific value instead of nothing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-02-01 11:03:26 +08:00
caption 4a40f8f1a4
fix(sec): upgrade golang.org/x/crypto to 0.17.0 (#3832) 2024-02-01 09:00:17 +08:00
dependabot[bot] 857db39f82
chore(deps): bump github/codeql-action from 2 to 3 (#3806)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-19 08:18:57 +08:00
Bo-Yi Wu 160c1730ef
chore: update GitHub Actions configuration (#3792)
- Change the cron schedule from `'0 17 * * 5'` to `"0 17 * * 5"` in the file `.github/workflows/codeql.yml`
- Change the value of `language` from `['go']` to `["go"]` in the file `.github/workflows/codeql.yml`
- Change the value of `go-version` from `'^1.18'` to `"^1.18"` in the file `.github/workflows/gin.yml`
- Add `1.21` to the list of `go` versions and change the value of `test-tags` in the file `.github/workflows/gin.yml`
- Change the value of `if` condition from `matrix.go-version == '1.20.x'` to `matrix.go-version == '1.21.x'` in the file `.github/workflows/gin.yml`
- Change the value of `on` from `'*'` to `"*"` in the file `.github/workflows/goreleaser.yml`
- Change the name of the job from `name: Checkout` to `name: Checkout` in the file `.github/workflows/goreleaser.yml`
- Change the name of the job from `name: Set up Go` to `name: Set up Go` in the file `.github/workflows/goreleaser.yml`
- Change the value of `go-version` from `1.20` to `"^1"` in

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-01-19 00:35:08 +08:00
dependabot[bot] 53fbf4dbfb
chore(deps): bump github.com/pelletier/go-toml/v2 from 2.0.8 to 2.1.1 (#3797)
Bumps [github.com/pelletier/go-toml/v2](https://github.com/pelletier/go-toml) from 2.0.8 to 2.1.1.
- [Release notes](https://github.com/pelletier/go-toml/releases)
- [Changelog](https://github.com/pelletier/go-toml/blob/v2/.goreleaser.yaml)
- [Commits](https://github.com/pelletier/go-toml/compare/v2.0.8...v2.1.1)

---
updated-dependencies:
- dependency-name: github.com/pelletier/go-toml/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-13 10:28:51 +08:00
dependabot[bot] 811f271a04
chore(deps): bump goreleaser/goreleaser-action from 4 to 5 (#3721)
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4 to 5.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](https://github.com/goreleaser/goreleaser-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-13 10:27:57 +08:00
dependabot[bot] 081b36ebdb
chore(deps): bump actions/setup-go from 4 to 5 (#3798)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-13 10:27:25 +08:00
Georgi Dimitrov 386d244068
fix(tree): correctly expand the capacity of params (#3502) 2023-12-07 08:38:55 +08:00
Omkar P 44d0dd7092
fix: Add pointer support for url query params (#3659) (#3666)
The pointer support in url query params (using []*Struct for binding query params) was previously available in Gin, but was removed in commit 0d50ce8 since there wasn't a test case for such a scenario, and so the case block was removed as a redundant one.
2023-11-16 23:46:43 +08:00