Commit 6814843
Issue 1373: obtain special groups from user context when new token is generated (on token refresh) (ufal#1378)
* Issue 1373: obtain special groups from user context when new token is generated (on token refresh)
* resolve Copilot comments
* resolve Copilot Comments: compute special groups only when when user is authenticated
* Remove HttpSession dependency from ClarinShibAuthentication
Use request-scoped attributes for shib.authenticated instead of
HttpSession/JSESSIONID, aligning with upstream ShibAuthentication.
Follow-up to ufal#1373/ufal#1378.
* Guard against null special groups in Context.getSpecialGroups
A special-group UUID may reference a Group that has since been deleted;
GroupService.find returns null in that case. The list was built with an
unconditional add, so it could contain null elements, which caused an NPE
downstream (e.g. SpecialGroupClaimProvider.getValue maps group.getID()
while generating the JWT sg claim on token refresh). Filter nulls once
here so every caller is covered. Follow-up to ufal#1373/ufal#1378.
---------
Co-authored-by: Ondrej Kosarko <kosarko@ufal.mff.cuni.cz>
(cherry picked from commit 4c294b2)1 parent 867e43d commit 6814843
2 files changed
Lines changed: 23 additions & 25 deletions
File tree
- dspace-api/src/main/java/org/dspace
- authenticate/clarin
- core
Lines changed: 17 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
338 | 336 | | |
339 | 337 | | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
349 | 342 | | |
350 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
351 | 348 | | |
352 | 349 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | 350 | | |
357 | 351 | | |
358 | 352 | | |
359 | 353 | | |
360 | | - | |
361 | | - | |
| 354 | + | |
| 355 | + | |
362 | 356 | | |
363 | | - | |
364 | 357 | | |
365 | 358 | | |
366 | 359 | | |
367 | | - | |
368 | | - | |
| 360 | + | |
| 361 | + | |
369 | 362 | | |
370 | 363 | | |
371 | 364 | | |
| |||
1291 | 1284 | | |
1292 | 1285 | | |
1293 | 1286 | | |
1294 | | - | |
| 1287 | + | |
1295 | 1288 | | |
1296 | 1289 | | |
1297 | 1290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
717 | | - | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
718 | 723 | | |
719 | 724 | | |
720 | 725 | | |
| |||
0 commit comments