Commit 1cda0dc
* Port #1409 to dtq-dev-9-base: fix(mediafilter): log unparsable-PDF filter-media errors as WARN, not ERROR (#1409)
Source: b0c4850 (dtq-dev PR #1409)
A corrupt or malformed PDF makes PDFBoxThumbnail and TikaTextExtractionFilter
throw a parse IOException that MediaFilterServiceImpl re-logs at ERROR, flooding
the nightly filter-media job and tripping log-based alerting even though the job
already skips the file and continues. Both filters now catch the IOException,
log at WARN and return null, so the bitstream is skipped cleanly. The encrypted
-PDF branch (InvalidPasswordException) stays at ERROR.
Applied verbatim -- both files are byte-identical with vanilla 9.3 on this
branch, and the v9 `Loader.loadPDF(new RandomAccessReadBuffer(source))` rewrite
did not disturb the catch chain the new block attaches to. No test on either
branch covers this path (the source PR has none either).
Co-authored-by: MatusBeke <matus.beke7@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Port #1407 to dtq-dev-9-base: [Port to dtq-dev] fix: SWORDv2 item double-delete with WorkflowManagerDefault (#1407)
Source: f241c47 (dtq-dev PR #1407)
ContainerManagerDSpace.doContainerDelete() now checks, before the final
itemService.delete(), whether a DELETE event for the same item UUID is already
queued on the context -- i.e. the item was deleted earlier in this transaction --
and skips the second delete. Historically that second delete threw when the item
came in through WorkflowManagerDefault.
Both delete paths keep deleteWrapper(); the guard is the explicit safety net the
source PR settled on, in its NPE-hardened form
(itemUUID.equals(event.getSubjectID()), constrained to Event.DELETE on
Constants.ITEM subjects). As the source PR states, the current base does not
double-delete on any path, so this is behaviour-neutral today.
Applied verbatim: the file is byte-identical with vanilla 9.3 on this branch and
Context.getEvents() / Event.getEventType / getSubjectType / getSubjectID are
unchanged in v9. The new java.util.UUID import lands after java.util.TreeMap and
org.dspace.event.Event after org.dspace.core.LogHelper, so checkstyle import
order (com < jakarta < org) is preserved.
Known gap carried over from the source PR: the negative branch of the guard
(delete skipped because a DELETE event is already queued) has no test on any
branch. The two existing Swordv2IT delete tests only cover the positive path.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Port #1408 to dtq-dev-9-base: [Port to dtq-dev] fix: harden LDAP auth (groupmap guard, DN logging) (#1408)
Source: 6615b01 (dtq-dev PR #1408)
Two of the source commit's three hunks are ported; the third is already here.
Ported (both in assignGroups()):
- A groupmap entry without a ':' separator, or with a blank left or right part,
no longer reaches `t[1]` (ArrayIndexOutOfBoundsException) and no longer leaves
an empty ldapSearchString -- which made containsIgnoreCase(dn, "" + ",") match
essentially every DN and assign the mapped group to all LDAP users. The entry
is now logged at ERROR with its index and skipped, and scanning continues at
the next index. Parsing uses split(":", 2) so a colon inside a DSpace group
name is preserved instead of truncated.
- System.out.println("dn:" + dn) becomes
log.debug(LogHelper.getHeader(context, "assignGroups", "dn=" + dn)) -- a
semi-sensitive DN off the default log level and out of stdout.
NOT ported -- VANILLA-COVERED: the e-mail fallback hunk (the 5-arg
setEpersonAttributes overload plus its two call sites). That fix went upstream as
23b999e (PRs DSpace#11293/DSpace#11331, authored by DataQuest) and is in dspace-9.3:
git merge-base --is-ancestor 23b999e dspace-9.3 -> 0
git diff dspace-9.3 origin/dtq-dev-9-base -- .../LDAPAuthentication.java -> empty
On this branch setEpersonAttributes already has both overloads, both call sites
already pass `email`, and `StringUtils.isNotEmpty(email)` occurs exactly twice --
the same count as on dtq-dev. Re-applying the hunk would have duplicated it.
Added beyond the source commit: LDAPAuthenticationTest, 5 unit tests over the
groupmap parsing (no LDAP server; ConfigurationService and GroupService mocked,
assignGroups reached by reflection because it is private). The source PR lists
the missing test under its own "Open points"; card BE-06's AC-3 needs exactly
this behaviour proven, and with no LDAP server anywhere in the estate a unit test
is the only way to prove it. Worth backporting to dtq-dev.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: jurinecko <juraj.roka@dataquest.sk>
Co-authored-by: MatusBeke <matus.beke7@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2c1c1dd commit 1cda0dc
5 files changed
Lines changed: 162 additions & 8 deletions
File tree
- dspace-api/src
- main/java/org/dspace
- app/mediafilter
- authenticate
- test/java/org/dspace/authenticate
- dspace-swordv2/src/main/java/org/dspace/sword2
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
| |||
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
| 613 | + | |
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
622 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
623 | 632 | | |
624 | 633 | | |
625 | 634 | | |
| |||
Lines changed: 108 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 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 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
Lines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
755 | 757 | | |
756 | 758 | | |
757 | 759 | | |
| 760 | + | |
758 | 761 | | |
759 | 762 | | |
760 | 763 | | |
761 | 764 | | |
762 | 765 | | |
763 | 766 | | |
764 | | - | |
765 | | - | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
766 | 772 | | |
767 | 773 | | |
768 | 774 | | |
| |||
788 | 794 | | |
789 | 795 | | |
790 | 796 | | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
791 | 817 | | |
0 commit comments