Commit Graph

4143 Commits (6e399dc9867fd4cda59dc788a7991085cb71d7f6)

Author SHA1 Message Date
JIeJaitt 6e399dc986 Merge branch 'feature/improve-check-constraint' of github.com:JIeJaitt/fiber into feature/improve-check-constraint 2025-04-01 09:36:25 +08:00
JIeJaitt 87203a5d0d 📚 Doc: Add caution note about custom constraints overriding built-in constraints in routing guide 2025-04-01 09:33:28 +08:00
RW b2debdbc47
Merge branch 'main' into feature/improve-check-constraint 2025-03-31 16:59:01 +02:00
Jason McNeil bb12633c8b
Revert "🔥 feat: Add support for context.Context in keyauth middleware" (#3364)
Revert "🔥 feat: Add support for context.Context in keyauth middleware (#3287)"

This reverts commit 4177ab4086.

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2025-03-31 16:55:01 +02:00
Juan Calderon-Perez 36b93818f9
Merge pull request #3384 from gofiber/dependabot/go_modules/github.com/fxamacker/cbor/v2-2.8.0
build(deps): bump github.com/fxamacker/cbor/v2 from 2.7.0 to 2.8.0
2025-03-31 08:26:44 -04:00
Juan Calderon-Perez dec28010e9
Update go.mod 2025-03-31 08:14:32 -04:00
Juan Calderon-Perez 2f794d9f88
Update go.mod 2025-03-31 08:14:18 -04:00
dependabot[bot] d8f9548650
build(deps): bump github.com/fxamacker/cbor/v2 from 2.7.0 to 2.8.0
Bumps [github.com/fxamacker/cbor/v2](https://github.com/fxamacker/cbor) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/fxamacker/cbor/releases)
- [Commits](https://github.com/fxamacker/cbor/compare/v2.7.0...v2.8.0)

---
updated-dependencies:
- dependency-name: github.com/fxamacker/cbor/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-31 12:07:59 +00:00
Kashiwa c2e39b7570
♻️ Refactor: Add findNextNonEscapedCharPosition for single-byte charset cases (#3378)
♻️ Refactor: add findNextNonEscapedCharsetPosition to process a single-byte parameter

```
goos: linux
goarch: amd64
pkg: github.com/gofiber/fiber/v3
cpu: AMD EPYC 9J14 96-Core Processor
                                                                               │   old.txt   │              new.txt               │
                                                                               │   sec/op    │   sec/op     vs base               │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      160.4n ± 1%   159.0n ± 0%  -0.84% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        151.6n ± 0%   150.8n ± 0%  -0.53% (p=0.005 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       151.7n ± 0%   150.6n ± 0%  -0.73% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              162.3n ± 0%   160.8n ± 0%  -0.96% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           452.9n ± 1%   435.8n ± 0%  -3.79% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   455.6n ± 1%   435.7n ± 0%  -4.38% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  524.4n ± 1%   507.6n ± 1%  -3.19% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 528.2n ± 0%   508.7n ± 0%  -3.69% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                528.1n ± 0%   510.6n ± 0%  -3.31% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      500.3n ± 0%   489.0n ± 0%  -2.27% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     502.1n ± 0%   489.9n ± 0%  -2.44% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    515.5n ± 0%   498.8n ± 0%  -3.24% (p=0.000 n=20)
geomean                                                                          339.4n        331.1n       -2.46%

                                                                               │  old.txt   │               new.txt               │
                                                                               │    B/op    │    B/op     vs base                 │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      144.0 ± 0%   144.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        136.0 ± 0%   136.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       136.0 ± 0%   136.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              152.0 ± 0%   152.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           368.0 ± 0%   368.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   368.0 ± 0%   368.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
geomean                                                                          288.8        288.8       +0.00%
¹ all samples are equal

                                                                               │  old.txt   │               new.txt               │
                                                                               │ allocs/op  │ allocs/op   vs base                 │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
geomean                                                                          6.868        6.868       +0.00%
¹ all samples are equal
```
2025-03-31 09:49:40 +02:00
M. Efe Çetin d19e993597
feat: Add support for application state management (#3360)
*  feat: add support for application state management

* increase test coverage

* fix linter

* Fix typo

* add GetStateWithDefault helper

* add docs

* update what's new

* add has method

* fix linter

* update

* Add missing helpers for golang built-in types

* Fix lint issues

* Fix unit-tests. Update documentation

* Fix docs, add missing benchmarks

* Fix tests file

* Update default example and test

* Apply suggestions from code review

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Co-authored-by: Juan Calderon-Perez <jgcalderonperez@protonmail.com>
Co-authored-by: RW <rene@gofiber.io>
2025-03-31 09:31:59 +02:00
Juan Calderon-Perez 75281bd874
🧹 chore: Simplify HealthCheck middleware (#3380)
* Simplify middleware

* Rename default endpoints
2025-03-30 11:46:52 +02:00
JIeJaitt f16644cd9f Merge branch 'feature/improve-check-constraint' of github.com:JIeJaitt/fiber into feature/improve-check-constraint 2025-03-27 15:34:59 +08:00
JIeJaitt d92e7f6a41 📚 Doc: Update custom constraints section to clarify overriding behavior 2025-03-27 15:33:38 +08:00
JIeJaitt 113746a227 ♻️ Refactor: Remove outdated test cases from path_testcases_test.go and clean up CheckConstraint method in path.go 2025-03-27 15:33:38 +08:00
JIeJaitt 3b199a76a0 ♻️ Refactor: Remove unused CheckConstraint test cases and reorganize benchmark test cases for clarity 2025-03-27 15:33:38 +08:00
JIeJaitt 778134f600 🩹 Fix: Update CheckConstraint method to return true for noConstraint and improve error handling 2025-03-27 15:33:38 +08:00
JIeJaitt 255ab13556 🩹 Fix: lint error 2025-03-27 15:33:38 +08:00
JIeJaitt fafabff29c 🚨 Test: Add comprehensive tests for CheckConstraint method with various constraint scenarios 2025-03-27 15:33:38 +08:00
JIeJaitt d10b727fc3 Reapply "🔥 Feature: Enhance CheckConstraint method for improved error handling"
This reverts commit 9e6c8e68df.
2025-03-27 15:33:38 +08:00
JIeJaitt c14d0ab87c Revert "🔥 Feature: Enhance CheckConstraint method for improved error handling"
This reverts commit 68e8777b4c.
2025-03-27 15:33:38 +08:00
JIeJaitt de9dc5131a 🔥 Feature: Enhance CheckConstraint method for improved error handling 2025-03-27 15:33:38 +08:00
JIeJaitt 0e022567f9 📚 Doc: Update custom constraints section to clarify overriding behavior 2025-03-27 15:30:14 +08:00
Kashiwa e90fe8afbc
♻️Refactor: remove redundant field `method` in `DefaultCtx` (#3372)
* ♻️Refactor: remove redundant field method in defaultCtx

* ♻️Refactor: rename getMethodINT to getMethodInt
2025-03-26 13:16:53 +01:00
Juan Calderon-Perez dab20c9df5
🧹 chore: Add Immutable benchmarks for default case (#3374)
Add benchmarks for default case with Immutable
2025-03-26 13:09:43 +01:00
Juan Calderon-Perez bf8ebeb318
Merge branch 'main' into feature/improve-check-constraint 2025-03-25 07:03:59 -04:00
Kashiwa 4bf292945d
♻️Refactor: reduce DefaultCtx from 736 to 728 bytes (#3368) 2025-03-25 08:30:41 +01:00
Mazyar Yousefiniyae shad 7606c618d3
📚 Doc: Add more validation examples (#3369)
* add examples on valudator guid

* ref: return prev validation comment
2025-03-25 08:25:56 +01:00
Kashiwa ef40c04ede
♻️ Refactor: reduce DefaultCtx from 768 bytes to 736 bytes (#3353)
* ♻️ Refactor: reduce DefaultCtx from 768 bytes to 736 bytes

* ♻️ Refactor: add comments

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2025-03-23 16:58:43 +01:00
Edvard e947e03ed2
🔥 feat(logger): Add predefined log formats (#3359)
* feat(logger): Add predefined log formats

This commit introduces predefined log formats for the logger middleware, enhancing its flexibility and ease of use. Users can now specify formats like "common", "combined", and "json" in addition to the default format.

Changes:

- Added a `format.go` file to store predefined log format constants.
- Updated `config.go` to include documentation for the `Format` configuration option, explaining the available placeholders and predefined formats.
- Modified `logger.go` to utilize the predefined formats based on the `Format` configuration.
- Added a new test case `Test_Logger_CLF` in `logger_test.go` to verify the "common" log format.

* feat(logger): Use predefined formats and fix default format

This commit updates the logger middleware to utilize the predefined log formats introduced in a previous commit. It also fixes the default format to use the `FormatDefault` constant.

Changes:

-   Updated `config.go` to use `FormatDefault` constant for the default format.
-   Updated `default_logger.go` to use `FormatDefault` constant for the default format.
-   Added new test cases in `logger_test.go` to verify the "common", "combined" and "json" log formats.
-   Updated `format.go` to add newline character to the end of the default format.

* feat(logger): Document and exemplify predefined formats

* fix(logger): Improve test assertions based on golangci-lint

* docs(logger): Improve documentation and formatting logger.md based on markdownlint-cli2

* docs(logger): Improve documentation based on markdownlint-cli2

* fix(logger): Improve combined and JSON format tests

* feat(logger): Add ECS log format

* feat(logger): Add CustomFormat option

This commit introduces a `CustomFormat` option to the `Config` struct, allowing users to specify a predefined format (like "common", "combined", "json", or "ecs")

* feat(logger): Add ECS log format to examples and config

* docs(logger): Update examples in whats_new.md

* feat(logger): Remove CustomFormat option and renamed Format consts

-   Removed `CustomFormat` field from `Config`.
-   Removed `LoggerConfig` map.
-   Rename predefined formats constants.

* docs(logger): Update documentation and examples after format refactor

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2025-03-21 16:13:21 +01:00
Oleksandr Redko f6ac929fde
🧹 chore: Mark unused tests with t.SkipNow (#3366)
* 🚨 test: uncomment test and mark it with t.SkipNow

* fix lint issues
2025-03-20 14:35:59 +01:00
JIeJaitt 8d922b4e27
Merge branch 'main' into feature/improve-check-constraint 2025-03-20 09:11:17 +08:00
M. Efe Çetin 87f3f0c8b6
🐛 bug: fix client iterators when using break statement (#3357)
* 🐛 bug: fix client iterators when using break statement

* fix linter
2025-03-19 11:00:16 +01:00
JIeJaitt 91f3f5dba7 ♻️ Refactor: Remove outdated test cases from path_testcases_test.go and clean up CheckConstraint method in path.go 2025-03-19 17:39:46 +08:00
JIeJaitt 5be0aae6a7 ♻️ Refactor: Remove unused CheckConstraint test cases and reorganize benchmark test cases for clarity 2025-03-19 17:19:52 +08:00
JIeJaitt 827877fa36 🩹 Fix: Update CheckConstraint method to return true for noConstraint and improve error handling 2025-03-19 15:53:28 +08:00
JIeJaitt a2744452e5 🩹 Fix: lint error 2025-03-18 17:45:48 +08:00
JIeJaitt 4f280c2bf1 🚨 Test: Add comprehensive tests for CheckConstraint method with various constraint scenarios 2025-03-18 17:06:59 +08:00
JIeJaitt 3778143edd Reapply "🔥 Feature: Enhance CheckConstraint method for improved error handling"
This reverts commit 9e6c8e68df.
2025-03-18 16:47:06 +08:00
JIeJaitt 9e6c8e68df Revert "🔥 Feature: Enhance CheckConstraint method for improved error handling"
This reverts commit 68e8777b4c.
2025-03-18 16:42:00 +08:00
JIeJaitt 68e8777b4c 🔥 Feature: Enhance CheckConstraint method for improved error handling 2025-03-18 16:37:18 +08:00
Juan Calderon-Perez 395c8fafa9
🧹 chore: Fix linter workflow failures (#3354)
* Fix linter workflow failures

* Bump golang.org/x/net to v0.36.0

* Try skipping golangci-lint cache

* Update linter.yml

* fix: directives and spaces

* fix: better configuration

* fix: golangci-lint install

* Update golangci-lint version

* Enable SA4023

* Update golangci-lint config

* Remove duplicated rule

---------

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-03-17 08:29:51 +01:00
Juan Calderon-Perez b56a141d59
docs: Update helmet.md default values (#3350)
Update helmet.md
2025-03-14 07:51:34 +01:00
Juan Calderon-Perez ef4437cd65
Merge pull request #3348 from devhaozi/patch-1
docs: Update Helmet Middleware default values
2025-03-12 19:20:10 -04:00
耗子 eb7b00b4fb
fix: default value comment 2025-03-13 01:44:57 +08:00
JIeJaitt c0599ee1d4
🔥 feat: Add Skip function to logger middleware (#3333)
* 🔥 Feature(logger): Add Filter option to logger middleware

* 📚 Doc(logger): Clarify Filter middleware description

* 🚨 Test(logger): Enhance logger filter test with parallel subtests

* 🔒 Test(logger): Add mutex to prevent race conditions in logger test

* 🔥 Feature(logger): Add Filter option to logger middleware

* 📚 Doc(logger): Clarify Filter middleware description

* 🚨 Test(logger): Enhance logger filter test with parallel subtests

* 🔒 Test(logger): Add mutex to prevent race conditions in logger test

* 🚨 Test(logger): Refactor logger test to improve test isolation

* Fix issue with unit-tests

* Update middleware/logger/logger_test.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Apply logger filter as soon as possible

* 📚 Doc: Add logger filter configuration example to whats_new.md

* 📚 Doc: Update logger filter documentation in whats_new.md

* 📚 Doc: Update logger filter documentation and examples

* 🩹 Fix: improve what_new.md

* Update logic for Filter() in Logger middleware. Add more unit-tests

* Rename fields to match expressjs/morgan

* Update middleware/logger/default_logger.go

---------

Co-authored-by: Juan Calderon-Perez <jgcalderonperez@protonmail.com>
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: RW <rene@gofiber.io>
2025-03-10 09:06:11 +01:00
Kashiwa 1b26cf6b5e
♻️ Refactor: optimize routeParser by using sync.Pool (#3343)
* ♻️ Refactor: add routerParser pool

```
goos: linux
goarch: amd64
pkg: github.com/gofiber/fiber/v3
cpu: AMD EPYC 9J14 96-Core Processor
                                                                               │   ori.txt   │              pool.txt               │
                                                                               │   sec/op    │   sec/op     vs base                │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      173.9n ± 0%   159.3n ± 1%   -8.37% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        163.9n ± 0%   150.9n ± 0%   -7.90% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       165.4n ± 1%   150.6n ± 1%   -8.95% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              174.9n ± 0%   160.6n ± 0%   -8.15% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           520.2n ± 0%   438.1n ± 1%  -15.78% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   521.8n ± 0%   436.8n ± 0%  -16.29% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  630.0n ± 0%   525.0n ± 0%  -16.67% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 633.3n ± 0%   526.4n ± 0%  -16.89% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                627.8n ± 0%   527.5n ± 0%  -15.97% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      602.1n ± 0%   501.9n ± 0%  -16.65% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     604.9n ± 0%   504.3n ± 0%  -16.62% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    616.7n ± 0%   512.8n ± 1%  -16.86% (p=0.000 n=20)
geomean                                                                          390.5n        336.5n       -13.84%

                                                                               │  ori.txt   │              pool.txt              │
                                                                               │    B/op    │    B/op     vs base                │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      152.0 ± 0%   144.0 ± 0%   -5.26% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        144.0 ± 0%   136.0 ± 0%   -5.56% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       144.0 ± 0%   136.0 ± 0%   -5.56% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              160.0 ± 0%   152.0 ± 0%   -5.00% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           440.0 ± 0%   368.0 ± 0%  -16.36% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   440.0 ± 0%   368.0 ± 0%  -16.36% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  536.0 ± 0%   432.0 ± 0%  -19.40% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 536.0 ± 0%   432.0 ± 0%  -19.40% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                536.0 ± 0%   432.0 ± 0%  -19.40% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      528.0 ± 0%   424.0 ± 0%  -19.70% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     528.0 ± 0%   424.0 ± 0%  -19.70% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    528.0 ± 0%   424.0 ± 0%  -19.70% (p=0.000 n=20)
geomean                                                                          337.9        288.8       -14.52%

                                                                               │   ori.txt   │              pool.txt              │
                                                                               │  allocs/op  │ allocs/op   vs base                │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                       5.000 ± 0%   4.000 ± 0%  -20.00% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                         5.000 ± 0%   4.000 ± 0%  -20.00% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                        5.000 ± 0%   4.000 ± 0%  -20.00% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16               5.000 ± 0%   4.000 ± 0%  -20.00% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           13.000 ± 0%   9.000 ± 0%  -30.77% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   13.000 ± 0%   9.000 ± 0%  -30.77% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  14.000 ± 0%   9.000 ± 0%  -35.71% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 14.000 ± 0%   9.000 ± 0%  -35.71% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                14.000 ± 0%   9.000 ± 0%  -35.71% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      14.000 ± 0%   9.000 ± 0%  -35.71% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     14.000 ± 0%   9.000 ± 0%  -35.71% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    14.000 ± 0%   9.000 ± 0%  -35.71% (p=0.000 n=20)
geomean                                                                           9.811        6.868       -29.99%
```

* 🩹 Fix: golangci-lint problem
2025-03-10 09:04:04 +01:00
Kashiwa 600ebd95ce
♻️ Refactor: replace isInCharset with bytes.IndexByte (#3342) 2025-03-07 15:33:22 +01:00
vinicius 4177ab4086
🔥 feat: Add support for context.Context in keyauth middleware (#3287)
* feat(middleware): add support to context.Context in keyauth middleware

pretty straightforward option to use context.Context instead of just
fiber.Ctx, tests added accordingly.

* fix(middleware): include import that was missing from previous commit

* fix(middleware): include missing import

* Replace logger with panic

* Update keyauth_test.go

* Update keyauth_test.go

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2025-03-07 08:23:24 +01:00
Juan Calderon-Perez 208b9e36ba
Merge pull request #3341 from gofiber/dependabot/go_modules/golang.org/x/crypto-0.36.0
build(deps): bump golang.org/x/crypto from 0.35.0 to 0.36.0
2025-03-06 07:43:17 -05:00
dependabot[bot] 6a9cd7d212
build(deps): bump golang.org/x/crypto from 0.35.0 to 0.36.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.35.0 to 0.36.0.
- [Commits](https://github.com/golang/crypto/compare/v0.35.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 12:29:49 +00:00