Skip to content

Commit 33df4a8

Browse files
committed
Merge remote-tracking branch 'origin/hotfix/1.0.0.1' into main
2 parents 3e1d4f5 + e187996 commit 33df4a8

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
<groupId>dev.dsf</groupId>
88
<artifactId>dsf-process-allow-list</artifactId>
9-
<version>1.0.0.0</version>
9+
<version>1.0.0.1</version>
1010
<packaging>jar</packaging>
1111

1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<compileSource>17</compileSource>
1515
<compileTarget>17</compileTarget>
1616

17-
<dsf.version>1.1.0</dsf.version>
17+
<dsf.version>1.2.0</dsf.version>
1818
<dsf.location>../dsf</dsf.location>
1919
</properties>
2020

src/main/java/dev/dsf/bpe/AllowListProcessPluginDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
public class AllowListProcessPluginDefinition implements ProcessPluginDefinition
1212
{
13-
public static final String VERSION = "1.0.0.0";
14-
public static final LocalDate RELEASE_DATE = LocalDate.of(2023, 8, 22);
13+
public static final String VERSION = "1.0.0.1";
14+
public static final LocalDate RELEASE_DATE = LocalDate.of(2023, 9, 14);
1515

1616
@Override
1717
public String getName()

src/main/java/dev/dsf/bpe/service/CheckAllowList.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.hl7.fhir.r4.model.Organization;
1212
import org.hl7.fhir.r4.model.OrganizationAffiliation;
1313
import org.hl7.fhir.r4.model.Resource;
14+
import org.hl7.fhir.r4.model.ResourceType;
1415
import org.hl7.fhir.r4.model.StringType;
1516
import org.hl7.fhir.r4.model.Task;
1617
import org.slf4j.Logger;
@@ -76,10 +77,17 @@ private Predicate<BundleEntryComponent> entryNotAllowedWithError(Task task, Stri
7677
private boolean resourceNotAllowedWithError(BundleEntryComponent entry, Task task, String bundleUrl)
7778
{
7879
Resource resource = entry.getResource();
79-
boolean resourceAllowed = (resource instanceof Organization || resource instanceof OrganizationAffiliation
80-
|| resource instanceof Endpoint);
81-
82-
if (!resourceAllowed)
80+
boolean resourceAllowed = (HTTPVerb.DELETE.equals(entry.getRequest().getMethod())
81+
&& (entry.getRequest().getUrl().startsWith(ResourceType.Organization.name())
82+
|| entry.getRequest().getUrl().startsWith(ResourceType.OrganizationAffiliation.name())
83+
|| entry.getRequest().getUrl().startsWith(ResourceType.Endpoint.name())))
84+
|| (resource instanceof Organization || resource instanceof OrganizationAffiliation
85+
|| resource instanceof Endpoint);
86+
87+
if (HTTPVerb.DELETE.equals(entry.getRequest().getMethod()) && !resourceAllowed)
88+
addError(task, "Resource delete of '" + entry.getRequest().getUrl() + "' not allowed in Bundle with id '"
89+
+ bundleUrl + "'");
90+
else if (!HTTPVerb.DELETE.equals(entry.getRequest().getMethod()) && !resourceAllowed)
8391
addError(task, "Resource of type '" + resource.getResourceType().name()
8492
+ "' not allowed in Bundle with id '" + bundleUrl + "'");
8593

src/main/java/dev/dsf/bpe/spring/config/AllowListConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class AllowListConfig
1717
{
1818
@Autowired
19-
ProcessPluginApi api;
19+
private ProcessPluginApi api;
2020

2121
@Bean
2222
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)

0 commit comments

Comments
 (0)