Commit Graph

20 Commits (167a8b5e9421e0ab51fbf44c5621632f4a1a90c5)

Author SHA1 Message Date
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
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
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
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
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
Fenny ce897c0b66 🩹 fix tests 2020-11-11 18:34:46 +01:00
Fenny 053dfd383d 🩹 fix crsf middleware 2020-11-11 15:25:35 +01:00
Fenny 9f2c0691b0 🩹 fix test cases 2020-10-24 01:00:09 +02:00
kiyon 616ff8f532 👷 remove unnecessary fiber app config 2020-09-17 13:41:06 +08:00
kiyon 0ad36c7526 👷 improve csrf mw test cases
Co-authored-by: Rene rene@gofiber.io
2020-09-16 15:17:17 +08:00
kiyon 3cedf2dc3e 👷 improve csrf mw test cases 2020-09-16 11:15:10 +08:00
kiyon e13411e184 👷 improve mw test cases
add Next test case
2020-09-16 09:44:05 +08:00
Fenny 2768ea2a77 🙌 make utils public
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-09-14 12:12:29 +02:00
Fenny a3cac71ae8 🔦 move utils to internal 2020-09-14 09:09:06 +02:00
Fenny b8cb100e28 v2 2020-09-14 05:47:17 +02:00
Fenny ec5d66e7a8 v2 2020-09-13 11:20:11 +02:00