Commit Graph

1764 Commits

Author SHA1 Message Date
Johannes Eiglsperger 8791c96960
feat(fs): Export, test and document OnlyFilesFS (#3939) 2024-05-08 15:47:54 +08:00
Bo-Yi Wu b1c1e7b572
ci: update Go version requirements and remove test files (#3957)
- Update the Go version requirements in `.github/workflows/gin.yml`
- Remove test files for Go versions 1.18 and 1.19
- Update the required Go version in `debug.go` and `debug_test.go`
- Rename and modify files related to Go version 1.19 and 1.20 in the `internal/bytesconv` directory

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-05-08 10:14:42 +08:00
Kostadin Plachkov 7d147928ee
fix(gin): data race warning for gin mode (#1580)
* fix: data race warning (#1180)

* Fix the tests

* refactor: remove unnecessary imports and optimize codebase

- Remove unnecessary import of `flag`

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

* test: refactor test assertions for mode settings

- Update test assertions for mode setting in `mode_test.go`

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

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-05-08 09:13:36 +08:00
Pedro Aguiar f5f5da8fa0
docs(gin): update link to dont-trust-all-proxies section (#3938) (#3945)
Update link [1] to [2] after PR #3449 was merged.

[1] https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies
[2] https://github.com/gin-gonic/gin/blob/master/docs/doc.md#dont-trust-all-proxies

Closes
2024-05-08 06:31:01 +08:00
lgbgbl 8dd088927a
refactor(binding): use strings.Cut to replace strings.Index (#3522) 2024-05-08 06:28:15 +08:00
Flc゛ e60113dc95
docs(engine): fix comments for the `With` (#3955)
Signed-off-by: Flc゛ <four_leaf_clover@foxmail.com>
2024-05-08 05:29:54 +08:00
Bo-Yi Wu 490accf5d7
docs: update documentation and release notes for Gin v1.10.0 (#3953)
* docs: update documentation and release notes for Gin v1.10.0

- Add release notes for Gin v1.10.0
- Include new features and bug fixes in the changelog
- Document enhancements and build process updates
- Update documentation for context and middleware functions
- Upgrade dependencies and optimize unit tests

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

* feat: refactor CI, enhance file binding, and update dependencies

- Add proxy-server authentication feature
- Add support for custom BindUnmarshaler for binding
- Fix binding error while not uploading file
- Refactor CI and update dependencies
- Add support for RFC 9512: application/yaml
- Optimize the Copy method of the Context struct
- Update various Go dependencies to latest versions

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

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-05-07 12:50:01 +08:00
Bo-Yi Wu 75ccf94d60
feat: update version constant to v1.10.0 (#3952)
- Update the version constant from "v1.9.1" to "v1.10.0"

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-05-07 11:23:42 +08:00
Bo-Yi Wu 39089af625
chore: refactor configuration files for better readability (#3951)
- Remove filters from the `changelog` section in `.goreleaser.yaml`

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-05-07 10:16:38 +08:00
Bo-Yi Wu 638aa19e7d
chore: update external dependencies to latest versions (#3950)
- Update `github.com/go-playground/validator/v10` from v10.19.0 to v10.20.0
- Update `github.com/pelletier/go-toml/v2` from v2.2.0 to v2.2.2
- Update `golang.org/x/net` from v0.22.0 to v0.25.0
- Update `google.golang.org/protobuf` from v1.33.0 to v1.34.1
- Update `golang.org/x/arch` from v0.7.0 to v0.8.0
- Update `golang.org/x/crypto` from v0.21.0 to v0.23.0
- Update `golang.org/x/sys` from v0.18.0 to v0.20.0
- Update `golang.org/x/text` from v0.14.0 to v0.15.0

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-05-07 10:15:53 +08:00
dkkb a18219566c
feat(binding): Support custom BindUnmarshaler for binding. (#3933) 2024-05-07 09:43:15 +08:00
dependabot[bot] b4f66e965b
chore(deps): bump github.com/bytedance/sonic from 1.11.3 to 1.11.6 (#3940)
Bumps [github.com/bytedance/sonic](https://github.com/bytedance/sonic) from 1.11.3 to 1.11.6.
- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](https://github.com/bytedance/sonic/compare/v1.11.3...v1.11.6)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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:23 +08:00
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