@warlock.js/auth 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -54
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
# Changelog — @warlock.js/auth
|
|
2
|
-
|
|
3
|
-
All notable changes to `@warlock.js/auth` are documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
|
|
6
|
-
|
|
7
|
-
## 4.2.11
|
|
8
|
-
|
|
9
|
-
### Changed
|
|
10
|
-
|
|
11
|
-
- Bumped `@mongez/reinforcements` to 3.3.0
|
|
12
|
-
|
|
13
|
-
## 4.2.10
|
|
14
|
-
|
|
15
|
-
### Fixed
|
|
16
|
-
|
|
17
|
-
- `@mongez/copper`, `@mongez/events`, and `@mongez/reinforcements` are now regular `dependencies` instead of `peerDependencies` —
|
|
18
|
-
|
|
19
|
-
## 4.2.0
|
|
20
|
-
|
|
21
|
-
### Added
|
|
22
|
-
|
|
23
|
-
- `loginThrottleMiddleware` — failure-aware brute-force / credential-stuffing protection
|
|
24
|
-
- `accessToken` / `refreshToken` configuration blocks, making a separate refresh-token secret first-class.
|
|
25
|
-
- Overridable token storage — register a custom model under `config.auth.accessToken.model` / `
|
|
26
|
-
- `tokenType` (`access` | `refresh`) claim, stamped on issue and verified on read, so an access token can
|
|
27
|
-
- `expires_at` on access tokens; `warlock auth.cleanup` now purges expired access tokens
|
|
28
|
-
|
|
29
|
-
### Fixed
|
|
30
|
-
|
|
31
|
-
- Default access-token lifetime was ~3.6 seconds (a numeric `expiresIn`
|
|
32
|
-
- Targeted revocation queried `userId` instead of the `user_id` column, so logout
|
|
33
|
-
- Token deletions were fire-and-forget
|
|
34
|
-
- The route middleware matched on `userType` instead of the `user_type` column.
|
|
35
|
-
- `revokeAllTokens` / `revokeTokenFamily` reported an empty set
|
|
36
|
-
- A throwing synchronous auth-event listener no longer turns a completed login into a `500`.
|
|
37
|
-
|
|
38
|
-
### Security
|
|
39
|
-
|
|
40
|
-
- `warlock jwt.generate` now derives `JWT_SECRET` / `JWT_REFRESH_SECRET` from a CSPRNG (`Random.token`) instead of `Math.random()
|
|
41
|
-
- Refresh-token rotation is atomic
|
|
42
|
-
|
|
43
|
-
### Deprecated
|
|
44
|
-
|
|
45
|
-
- The `auth.jwt.*` configuration block
|
|
46
|
-
|
|
47
|
-
### Removed
|
|
48
|
-
|
|
49
|
-
- Unread `access_tokens` columns `is_active` and `last_access`.
|
|
50
|
-
- The unused `auth.password.salt` configuration key.
|
|
51
|
-
|
|
52
|
-
## 4.1.15
|
|
53
|
-
|
|
54
|
-
- Baseline — per-package changelog tracking starts at this version.
|
|
1
|
+
# Changelog — @warlock.js/auth
|
|
2
|
+
|
|
3
|
+
All notable changes to `@warlock.js/auth` are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
|
|
6
|
+
|
|
7
|
+
## 4.2.11
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Bumped `@mongez/reinforcements` to 3.3.0
|
|
12
|
+
|
|
13
|
+
## 4.2.10
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- `@mongez/copper`, `@mongez/events`, and `@mongez/reinforcements` are now regular `dependencies` instead of `peerDependencies` — they're framework-internal utilities your app never imports, so declaring them as peers produced `unmet peer dependency` warnings on install.
|
|
18
|
+
|
|
19
|
+
## 4.2.0
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- `loginThrottleMiddleware` — failure-aware brute-force / credential-stuffing protection: counts only failed logins, locks per-account and per-IP, and rejects pre-controller with `429` (cache-backed, fails open). Adds `AuthErrorCodes.TooManyAttempts` (`EC004`).
|
|
24
|
+
- `accessToken` / `refreshToken` configuration blocks, making a separate refresh-token secret first-class.
|
|
25
|
+
- Overridable token storage — register a custom model under `config.auth.accessToken.model` / `refreshToken.model` and `.extend()` the exported schemas to add columns (e.g. a multi-tenant `organization_id`).
|
|
26
|
+
- `tokenType` (`access` | `refresh`) claim, stamped on issue and verified on read, so an access token can't be presented as a refresh token.
|
|
27
|
+
- `expires_at` on access tokens; `warlock auth.cleanup` now purges expired access tokens too.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- Default access-token lifetime was ~3.6 seconds (a numeric `expiresIn` read as milliseconds) and is now **1 hour**.
|
|
32
|
+
- Targeted revocation queried `userId` instead of the `user_id` column, so logout / refresh-token removal threw on Postgres and silently no-oped on MongoDB; token queries now route through named model statics.
|
|
33
|
+
- Token deletions were fire-and-forget (false success for callers, uncatchable rejections) and are now awaited.
|
|
34
|
+
- The route middleware matched on `userType` instead of the `user_type` column.
|
|
35
|
+
- `revokeAllTokens` / `revokeTokenFamily` reported an empty set, so `token.revoked` / `token.familyRevoked` never fired; the revoked rows are now captured before revocation.
|
|
36
|
+
- A throwing synchronous auth-event listener no longer turns a completed login into a `500`.
|
|
37
|
+
|
|
38
|
+
### Security
|
|
39
|
+
|
|
40
|
+
- `warlock jwt.generate` now derives `JWT_SECRET` / `JWT_REFRESH_SECRET` from a CSPRNG (`Random.token`) instead of `Math.random()`.
|
|
41
|
+
- Refresh-token rotation is atomic — a guarded conditional `UPDATE` means two concurrent rotations can't both succeed, and a replayed token revokes its entire family.
|
|
42
|
+
|
|
43
|
+
### Deprecated
|
|
44
|
+
|
|
45
|
+
- The `auth.jwt.*` configuration block. Use `accessToken` / `refreshToken` instead — the legacy shape is still read and mapped forward with a one-time deprecation warning.
|
|
46
|
+
|
|
47
|
+
### Removed
|
|
48
|
+
|
|
49
|
+
- Unread `access_tokens` columns `is_active` and `last_access`.
|
|
50
|
+
- The unused `auth.password.salt` configuration key.
|
|
51
|
+
|
|
52
|
+
## 4.1.15
|
|
53
|
+
|
|
54
|
+
- Baseline — per-package changelog tracking starts at this version.
|
package/package.json
CHANGED
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"ms": "^2.1.3"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@warlock.js/fs": "4.
|
|
27
|
-
"@warlock.js/cache": "4.
|
|
28
|
-
"@warlock.js/cascade": "4.
|
|
29
|
-
"@warlock.js/core": "4.
|
|
30
|
-
"@warlock.js/logger": "4.
|
|
31
|
-
"@warlock.js/seal": "4.
|
|
26
|
+
"@warlock.js/fs": "4.5.0",
|
|
27
|
+
"@warlock.js/cache": "4.5.0",
|
|
28
|
+
"@warlock.js/cascade": "4.5.0",
|
|
29
|
+
"@warlock.js/core": "4.5.0",
|
|
30
|
+
"@warlock.js/logger": "4.5.0",
|
|
31
|
+
"@warlock.js/seal": "4.5.0"
|
|
32
32
|
},
|
|
33
|
-
"version": "4.
|
|
33
|
+
"version": "4.5.0",
|
|
34
34
|
"type": "module",
|
|
35
35
|
"main": "./esm/index.mjs",
|
|
36
36
|
"module": "./esm/index.mjs",
|