|
1 | 1 | # Changelog |
2 | 2 |
|
3 | | -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. |
| 3 | +All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. |
| 4 | + |
| 5 | +## [4.0.0](https://github.com/Psifi-Solutions/csrf-csrf/compare/v3.0.7...v4.0.0) (2025-04-27) |
| 6 | + |
| 7 | + |
| 8 | +### ⚠ BREAKING CHANGES |
| 9 | + |
| 10 | +This list may not be an exhaustive list of breaking changes, for more information consult the [version 3 -> 4 upgrade guide](./UPGRADING.md#version-3---4) and the updated configuration documentation in the [README](./README.md). |
| 11 | + |
| 12 | +* Token generation now uses `createHmac`, the format has changed significantly, see the [CSRF token format](./UPGRADING.md#csrf-token-format-has-changed) section of the upgrade guide. |
| 13 | +* `getSessionIdentifier` is now required and must return a unique identifier per-request (and per-session) - this is an essential part of CSRF token security |
| 14 | +* `getTokenFromRequest` renamed to `getCsrfTokenFromRequest` |
| 15 | +* `generateToken` renamed to `generateCsrfToken` |
| 16 | +* `overwrite` and `validateOnReuse` parameters for `generateCsrfToken` have been merged into a single object parameter which also accepts `cookieOptions`: `generateCsrfToken(req, res, options);` |
| 17 | +* Default value for `validateOnReuse` is now `false` |
| 18 | +* Default value for `cookieOptions.sameSite` is now `strict` |
| 19 | +* `cookieOptions.signed` is no longer available, CSRF tokens are inherently signed, this is redundant |
| 20 | +* `delimiter` option removed, `csrfTokenDelimiter` and `messageDelimiter` are now used for the respective purpose |
| 21 | +* `signed` option in `cookieOptions` config option removed (redundant), csrf tokens generated by csrf-csrf are inherently signed |
| 22 | +* `size` config option now sets the size of the message used to construct the hmac, now defaults to `32` instead of `64`, this is combined with the return value of `getSessionIdentifier` to construct the hmac payload |
| 23 | +* Type `CsrfTokenCookieOverrides` renamed to `CsrfTokenCookieOptions` |
| 24 | +* Type `CsrfTokenCreator` renamed to `CsrfTokenGenerator` |
| 25 | +* Type `doubleCsrfProtection` renamed to `DoubleCsrfProtection` |
| 26 | +* Type `RequestMethod` renamed to `CsrfRequestMethod` |
| 27 | +* Type `CsrfIgnoredMethods` renamed to `CsrfIgnoredRequestMethods` |
| 28 | + |
| 29 | +### Features |
| 30 | + |
| 31 | +* change default value of sameSite to 'strict' ([ba5973e](https://github.com/Psifi-Solutions/csrf-csrf/commit/ba5973e44ddf7fdf0baeff038855f7307a5a1cd9)) |
| 32 | +* change validateOnReuse to false by default ([5fc62a9](https://github.com/Psifi-Solutions/csrf-csrf/commit/5fc62a98b797a7e1bc81a5d98a1c0509e1de4e76)) |
| 33 | +* expose per token cookie settings ([#60](https://github.com/Psifi-Solutions/csrf-csrf/issues/60)) ([456b317](https://github.com/Psifi-Solutions/csrf-csrf/commit/456b3179eac02deeb90cd7112f7ddbd6377c9758)) |
| 34 | +* **types:** add CsrfTokenGeneratorRequestUtil type ([72fd659](https://github.com/Psifi-Solutions/csrf-csrf/commit/72fd659f7e8ee9e82e820b1da9c393c4864dc43d)) |
| 35 | +* use hmac to generate csrf tokens ([e4c5ec3](https://github.com/Psifi-Solutions/csrf-csrf/commit/e4c5ec3ec0dc801ef0fca2ef89e1e4ff79f85aad)) |
4 | 36 |
|
5 | 37 | ### [3.2.2](https://github.com/Psifi-Solutions/csrf-csrf/compare/v3.2.1...v3.2.2) (2025-04-24) |
6 | 38 |
|
|
0 commit comments