83 Commits

Author SHA1 Message Date
Muhammed Efe Çetin
088cde594d
Merge remote-tracking branch 'origin/master' into v3-beta 2023-02-05 23:43:42 +03:00
leonklingele
ac4ce21d9c
🐛 Bug: Fix issues introduced in linting PR (#2319)
* internal: revert linting changes

Changes to the internal package should not have been made in 167a8b5e9421e0ab51fbf44c5621632f4a1a90c5.

* middleware/monitor: revert changes to exported field "ChartJSURL"

This is a breaking change introduced in 167a8b5e9421e0ab51fbf44c5621632f4a1a90c5.

* middleware/monitor: fix error checking

Fix the errorenous error checking introduced in 167a8b5e9421e0ab51fbf44c5621632f4a1a90c5.

* 🐛 Bug: Fix issues introduced in linting PR #2319

* 🐛 Bug: Fix issues introduced in linting PR #2319

* Bug: Fix issues introduced in linting PR #2319

---------

Co-authored-by: René Werner <rene@gofiber.io>
2023-02-02 15:57:40 +01:00
leonklingele
167a8b5e94
🚀 Feature: Add and apply more stricter golangci-lint linting rules (#2286)
* golangci-lint: add and apply more stricter linting rules

* github: drop security workflow now that we use gosec linter inside golangci-lint

* github: use official golangci-lint CI linter

* Add editorconfig and gitattributes file
2023-01-27 09:01:37 +01:00
M. Efe Çetin
5406560033
🧹 chore: make most tests parallel (#2299)
* 🧹 chore: make most tests parallel

* revert some tests

* revert some tests

* revert some tests
2023-01-15 23:21:37 +08:00
leonklingele
fd1a29ea79
🚀 Feature: Generate msgp tests (#2263)
* middleware: also generate msgp tests

* middleware/session: drop unused go:generate directive

* middleware: disable msgp's -io option to not generate unused methods
2022-12-11 17:40:07 +01:00
leonklingele
802defa5ff
v3 (chore): cleanup (#2255)
* middleware: switch to new Ctx interface in documentation

* all: use any instead of interface{}
2022-12-03 15:39:57 +03:00
Kris Carr
f26d9b1d4e
v3 (deps): update to use gofiber/utils/v2 (#2184) 2022-10-31 16:44:53 +03:00
Muhammed Efe Çetin
9428befb9c
Merge remote-tracking branch 'origin/master' into v3-beta 2022-10-28 17:26:17 +03:00
Muhammed Efe Çetin
ca6f25a890
v3 (deps): move utils to https://github.com/gofiber/utils 2022-09-23 21:19:44 +03:00
Muhammed Efe Çetin
319b8ea3a8
Merge remote-tracking branch 'origin/master' into v3-beta 2022-09-03 23:56:45 +03:00
RW
ec96d161a0
Fix csrf middleware behavior with header key lookup (#2063)
* 🐛 [Bug]: Strange CSRF middleware behavior with header KeyLookup configuration #2045
2022-08-30 14:48:31 +02:00
Jason McNeil
6272d759eb
🚀 [Feature]: middleware/csrf custom extractor (#2052)
* feat(middleware/csrf): allow custom Extractor

* test: update Test_CSRF_From_Custom

* docs: add comma

* docs: update KeyLookup docs
2022-08-28 18:57:47 +02:00
Trim21
c964fda009
v3(tests): use testify for assertion (#2036)
* replace

* write

* rewrite more

* rewrite

* rewrite

* fix

* rewrite
2022-08-22 07:57:10 +02:00
Muhammed Efe Çetin
4105b008c2
Merge remote-tracking branch 'origin/master' into v3-beta 2022-08-19 14:33:31 +03:00
M. Efe Çetin
a458bd344c
v3 (feature): convert fiber.Ctx type to interface (#1928)
*  v3: convert fiber.Ctx type to interface

* update ctx methods

* add new methods to customize ctx, fix some problems

* update comments.

* fix something
2022-07-13 07:48:29 +02:00
Muhammed Efe Çetin
3b943d79c9
v3: remove internal/template/html, replace internal/memory by internal/storage/memory 2022-06-04 14:19:59 +03:00
Muhammed Efe Çetin
8a15f77fc4
v3: move most deps to go.mod 2022-06-02 17:37:53 +03:00
Muhammed Efe Çetin
edd89de2d6
v3: remove deprecations 2022-05-31 17:50:31 +03:00
Muhammed Efe Çetin
c7f45ec38e
v3: replace interface{}s by any 2022-05-31 17:41:38 +03:00
Muhammed Efe Çetin
1188144d78
🎉 v3: init 2022-05-31 17:35:49 +03:00
Abhishek Mehandiratta
68fcd8c88f
Feature: Session Only Cookies (#1752)
* feat(ctx): add SessionOnly property on Cookie struct

* feat(middleware/config): add CookieSessionOnly property on middleware Config struct

* feat(csrf): link config CookieSessionOnly with fiber.Cookie in create middleware function

* fix(ctx_test): add tests for SessionOnly cookie in test_ctx_cookie

* fix(readme): update readme in csrf middleware for CookieSessionOnly property

* remove deprecated property from CookieSessionOnly explaination comments
2022-02-07 13:35:00 +01:00
Jason McNeil
59e4bf6cc5
🔧 fix(middleware/csrf): unmatched token returns nil error (#1667)
* Update csrf.go

* Update csrf_test.go

* fix(middleware/csrf): missing token return and unit test

* Update csrf_test.go
2021-12-29 02:13:20 +01:00
Jason McNeil
af6b204e50
CookieSameSite default "Lax" (#1640) 2021-12-02 07:41:44 +01:00
Gusted
7b7dcf29f7
♻️ Tidy up the codebase (#1613)
* run gofmt

* add t.Helper()

* Simplify assigns

* Simplify make operation

* Remove unused field in struct

* Fix typo

* Run gofumpt ./

* Consistent spacing

* len(...) can never be negative

* Use ReplaceAll

* Simplify operation

* Remove deadcode

* Fix typo

* Tidy up `} else { if ...`

* Fix AssertEqual

* Remove t.Helper() to fix go1.14.15
2021-11-05 08:00:03 +01:00
Nik Schaefer
a6868c24b9
📚 Doc: Correct Session to Crsf in Import (#1277) 2021-04-10 16:19:40 -04:00
iRedMail
078b6e295a
Fix comment in middleware/csrf/config.go 2021-03-20 12:58:08 +08:00
Joey
0f18e0f1b0
Merge pull request #1194 from gofiber/csrf-mw-restructuring
CSRF MW Restructuring
2021-03-09 15:32:16 +01:00
hi019
13f0d5bb61 Remove global variable 2021-03-09 09:29:47 -05:00
hi019
983919fd18
CSRF Docs - Add note about how to get token (#1196) 2021-03-01 20:32:22 -05:00
hi019
b31953ab8d Revert "Remove global variable"
This reverts commit 2d4d2f7c
2021-03-01 16:38:56 -05:00
hi019
2d4d2f7c47 Remove global variable 2021-03-01 16:30:04 -05:00
hi019
86e43593cd CSRF MW Restructuring 2021-03-01 16:25:32 -05:00
Jason McNeil
53e5dc523e
🩹 Fix: CSRF middleware cookie<>storage bug squashed and other improvements (#1180)
* expire cookie on Post, Delete, Patch and Put

Cookie should always expire on Post, Delete, Patch and Put as it is either valid and will be removed from storage, or is not in storage and invalid

* token and cookie match

* retrigger checks

* csrf tests

* csrf per session strategy
2021-03-01 17:44:17 +01:00
hinoguma
1ad5a618cb make default handler to private. fix testcase for invalid token and empty token. 2021-01-23 12:39:27 +09:00
hinoguma
19e6a4429d add custom error func for csrf middleware 2021-01-23 03:45:47 +09:00
hi019
494474aebd
Merge branch 'master' into master 2020-12-13 22:08:51 -05:00
amalshaji
86f258c4ae fixed cookie error in csrf.go 2020-12-10 10:45:21 +05:30
Fenny
323d9d89cc 🩹 fix manager logic 2020-11-23 07:38:42 +01:00
hi019
bc7b240158 improve mw 2020-11-21 12:36:16 -05:00
hi019
e828c17554 Standardize MW docs 2020-11-17 12:12:49 -05:00
Fenny
9be8eedcc6 🩹 fix cache mw
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-11-17 13:03:18 +01:00
Fenny
6338ce855c 🩹 fix csrf test 2020-11-14 03:09:53 +01:00
Fenny
9a0551049c 📝 update readme 2020-11-14 00:47:31 +01:00
Fenny
6b48509ce9 update cookie config fields 2020-11-14 00:45:55 +01:00
Fenny
558d802cdd 🩹 Fix expiration check 2020-11-13 18:34:01 +01:00
Fenny
ef35d00a79 🦺 simplify session config 2020-11-11 23:51:32 +01:00
Fenny
ec8fdb32de 🧽 clean code structure 2020-11-11 21:44:37 +01:00
Fenny
b29d500fc0 🩹 verify csrf on state changing methods 2020-11-11 21:39:22 +01:00
Fenny
ce897c0b66 🩹 fix tests 2020-11-11 18:34:46 +01:00
Fenny
66ee4de7d8 🕊 rename token to key 2020-11-11 18:19:53 +01:00