Skip to content

Commit fdb1093

Browse files
committed
use safe resource access, add artifactItem for tika-core, remove not needed entry in allowed bpe classes
1 parent fa696ed commit fdb1093

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

dsf-bpe/dsf-bpe-process-api-v2-impl/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@
245245
<artifactId>opentelemetry-instrumentation-annotations</artifactId>
246246
<version>2.4.0</version>
247247
</artifactItem>
248+
<artifactItem>
249+
<groupId>org.apache.tika</groupId>
250+
<artifactId>tika-core</artifactId>
251+
<version>${apache.tika.version}</version>
252+
</artifactItem>
248253
</artifactItems>
249254
</configuration>
250255
</execution>

dsf-bpe/dsf-bpe-server/src/main/resources/bpe/api/v2/allowed-bpe-classes.list

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ org.apache.commons.io
1212
org.apache.commons.lang3
1313
org.apache.commons.text
1414
org.apache.http
15-
org.apache.tika.config.TikaConfig
16-
org.apache.tika.detect.Detector
17-
org.apache.tika.io.TikaInputStream
18-
org.apache.tika.metadata.Metadata
19-
org.apache.tika.mime.MediaType
2015
org.camunda.bpm.engine.delegate
2116
org.camunda.bpm.engine.impl.bpmn.parser.FieldDeclaration
2217
org.camunda.bpm.engine.impl.el.FixedValue

dsf-bpe/dsf-bpe-test-plugin-v2/src/main/java/dev/dsf/bpe/test/service/MimetypeServiceTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,45 +32,45 @@ public void execute(ProcessPluginApi api, Variables variables) throws ErrorBound
3232
public void testAttachmentBundle(MimetypeService mimetypeService)
3333
{
3434
List<Resource> resources = getResourcesNotDocumentReferenceFromPath(
35-
"/fhir/Bundle/DocumentReference-with-Attachment-Bundle.xml");
35+
"fhir/Bundle/DocumentReference-with-Attachment-Bundle.xml");
3636
testResourcesStream(resources, mimetypeService);
3737
}
3838

3939
@PluginTest
4040
public void testAttachmentCsv(MimetypeService mimetypeService)
4141
{
4242
List<Resource> resources = getResourcesNotDocumentReferenceFromPath(
43-
"/fhir/Bundle/DocumentReference-with-Attachment-CSV.xml");
43+
"fhir/Bundle/DocumentReference-with-Attachment-CSV.xml");
4444
testResourcesStream(resources, mimetypeService);
4545
}
4646

4747
@PluginTest
4848
public void testAttachmentMeasureReport(MimetypeService mimetypeService)
4949
{
5050
List<Resource> resources = getResourcesNotDocumentReferenceFromPath(
51-
"/fhir/Bundle/DocumentReference-with-Attachment-MeasureReport.xml");
51+
"fhir/Bundle/DocumentReference-with-Attachment-MeasureReport.xml");
5252
testResourcesStream(resources, mimetypeService);
5353
}
5454

5555
@PluginTest
5656
public void testAttachmentNdJson(MimetypeService mimetypeService)
5757
{
5858
List<Resource> resources = getResourcesNotDocumentReferenceFromPath(
59-
"/fhir/Bundle/DocumentReference-with-Attachment-NdJson.xml");
59+
"fhir/Bundle/DocumentReference-with-Attachment-NdJson.xml");
6060
testResourcesStream(resources, mimetypeService);
6161
}
6262

6363
@PluginTest
6464
public void testAttachmentZip(MimetypeService mimetypeService)
6565
{
6666
List<Resource> resources = getResourcesNotDocumentReferenceFromPath(
67-
"/fhir/Bundle/DocumentReference-with-Attachment-ZIP.xml");
67+
"fhir/Bundle/DocumentReference-with-Attachment-ZIP.xml");
6868
testResourcesStream(resources, mimetypeService);
6969
}
7070

7171
private List<Resource> getResourcesNotDocumentReferenceFromPath(String pathToBundle)
7272
{
73-
try (InputStream input = getClass().getResourceAsStream(pathToBundle))
73+
try (InputStream input = MimetypeServiceTest.class.getClassLoader().getResourceAsStream(pathToBundle))
7474
{
7575
Bundle bundle = FhirContext.forR4().newXmlParser().parseResource(Bundle.class, input);
7676
return bundle.getEntry().stream().filter(Bundle.BundleEntryComponent::hasResource)

0 commit comments

Comments
 (0)