keycloak-express-middleware 6.2.0 → 6.3.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 +24 -0
- package/README.md +930 -11
- package/docs/recipes.md +575 -0
- package/index.d.ts +55 -0
- package/index.js +256 -0
- package/package.json +1 -1
- package/test/middleware-functions.test.js +140 -0
- package/test/docker-keycloak/.env +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [6.3.0] - 2026-03-18
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Outbound Service Helpers** for service-to-service and user-context API calls:
|
|
9
|
+
- `getServiceToken(options)` — Client Credentials token helper with in-memory cache, single-flight refresh, and configurable validity window
|
|
10
|
+
- `callProtectedApi(options)` — Outbound HTTP helper with auth modes (`service`, `user`, `passthrough`, `none`), normalized response shape, timeout support, and automatic one-time retry on `401` in service mode
|
|
11
|
+
- **TypeScript coverage** for outbound helpers:
|
|
12
|
+
- `ServiceTokenOptions`, `ServiceTokenResult`
|
|
13
|
+
- `CallProtectedApiOptions`, `CallProtectedApiResult`
|
|
14
|
+
|
|
15
|
+
### Documentation
|
|
16
|
+
- Expanded README API reference with complete sections for:
|
|
17
|
+
- `getServiceToken(options)`
|
|
18
|
+
- `callProtectedApi(options)`
|
|
19
|
+
- Added practical service-integration examples and cross-links to recipes
|
|
20
|
+
- Updated `docs/recipes.md` Recipe 5 with production-style outbound flow, fallback mapping, and error shaping patterns
|
|
21
|
+
|
|
22
|
+
### Tests
|
|
23
|
+
- Added unit tests for outbound helper behavior:
|
|
24
|
+
- token cache reuse
|
|
25
|
+
- single-flight concurrency behavior
|
|
26
|
+
- `401` refresh+retry path in `service` auth mode
|
|
27
|
+
- user-token auth mode behavior
|
|
28
|
+
|
|
5
29
|
## [6.2.0] - 2026-03-18
|
|
6
30
|
|
|
7
31
|
### Added
|