Commit 62cb46a
committed
fix(restheart-mongo): pin JWT key + correct globalNoise format for deterministic replay
Two record/replay determinism fixes the full keploy/enterprise compat
matrix needs to go green:
1) RHO `/jwtConfigProvider/key` pinned to a fixed string. Default is
`key: null` which makes RESTHeart auto-generate a random HS256 secret
per container start. Recorded JWT bearers carry an HS256 signature
over the payload using that secret, so a fresh-container replay phase
rejects the recorded bearer with 401 even though --freezeTime keeps
`exp` valid. Pinning the secret keeps the bearer signature verifiable
across record→replay container restarts.
2) keploy.yml.template rewritten to use NESTED globalNoise format
(`body: { field: [] }`) instead of flat dotted keys (`body.field: []`).
Keploy's matcher reads `globalNoise.global` as map[section][field]regex
and treats dotted keys as literal outer keys, never matching the body
section. Verified by walking pkg/matcher/http/match.go and the
employee-manager sample's commented example. Fields added:
header.{Date, Content-Length, Auth-Token},
body.{_etag, _oid, _id, lastModified, client_ip, latencyMs, access_token}.
Validated locally with all three matrix cells (record-stable-replay-pr,
record-pr-replay-pr, record-pr-replay-stable) — each reaches 296/296
PASSED with these two changes plus the lane-side --port and --freezeTime
flags already in keploy/enterprise#1889.1 parent 2541e2b commit 62cb46a
2 files changed
Lines changed: 58 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
12 | 37 | | |
13 | 38 | | |
14 | 39 | | |
15 | 40 | | |
16 | 41 | | |
17 | 42 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
0 commit comments