Commit b13fb5e
Hold UpdateFilter authentication state per session (#6329)
UpdateFilter.authenticatedSuccessfully was an instance field on the
singleton filter, so once any super user authenticated at the first step
of the database-update wizard the flag stayed true for everyone. A
concurrent unauthenticated request could then POST straight to the
review-changes step and run the pending database updates on the strength
of another user's login.
Move the authenticated flag into the HttpSession so each session must
authenticate for itself. The shared update-in-progress state is left
global on purpose so multiple super users can still watch one running
update. Updates the E2E helpers to session scope, makes resetRequest carry
the session forward (a follow-up request is the same client), and adds a
regression test that a second session cannot reuse another session's
authentication.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent d992f17 commit b13fb5e
2 files changed
Lines changed: 41 additions & 19 deletions
File tree
- web/src
- main/java/org/openmrs/web/filter/update
- test/java/org/openmrs/web/filter/update
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
83 | 90 | | |
84 | 91 | | |
85 | 92 | | |
| |||
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
160 | | - | |
161 | | - | |
| 161 | + | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| |||
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
214 | | - | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| |||
Lines changed: 31 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
80 | | - | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | | - | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
187 | 205 | | |
188 | 206 | | |
189 | 207 | | |
| |||
431 | 449 | | |
432 | 450 | | |
433 | 451 | | |
| 452 | + | |
| 453 | + | |
434 | 454 | | |
| 455 | + | |
435 | 456 | | |
436 | 457 | | |
437 | 458 | | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
442 | 465 | | |
443 | 466 | | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
| 467 | + | |
| 468 | + | |
448 | 469 | | |
449 | 470 | | |
450 | 471 | | |
| |||
0 commit comments