Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Adds access control rules and allowed process configurations #77

Merged
merged 58 commits into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
27c28fe
com.google.common.base.Objects.equal to java.util.Objects.equals
hhund Jan 26, 2020
be263c9
added resource ActivityDefinition and some search parameters
hhund Jan 26, 2020
b23ba53
Merge branch 'master' into processAuthorization_ActivityDefinition
hhund Jan 27, 2020
f340b79
Merge branch 'master' into processAuthorization_ActivityDefinition
hhund Feb 10, 2020
72b64a7
Merge remote-tracking branch 'origin/master' into
hhund Feb 10, 2020
c44e71a
security facade rework
hhund Feb 17, 2020
f6d8bc0
work on authorization rules
hhund Feb 19, 2020
57ee565
new config parameter to distinguish between MeDIC and TTP
hhund Feb 19, 2020
1c2d284
more work on authorization rules and user filters
hhund Feb 20, 2020
d796bce
work on binary rules, integration tests, fhir client error handling
hhund Feb 23, 2020
d032fef
work on binary auth rules, user filter and integration test
hhund Feb 23, 2020
1d45b10
organization/endpoint id-systems to NamingSystem, work on auth rules
hhund Feb 24, 2020
59f77ee
work on authorization, passwords as char[], dependency version upgrades
hhund Feb 25, 2020
b2ca062
hapi version upgrade to 4.2.0, ..DaoJdbc, ...UserFilter cleanup
hhund Feb 25, 2020
6ae3dbf
work on authorization rules, include/revinclude filter during search
hhund Feb 26, 2020
266d08c
work on authorization in handling of batch and transaction bundles
hhund Mar 1, 2020
ca45baf
work on authorization rules
hhund Mar 1, 2020
9b40f6e
integration test fix
hhund Mar 1, 2020
83bb9b1
work on authorization rules, i.a. ActivityDefinition and Task
hhund Mar 3, 2020
6d73d33
work on authorization rules, create of ping, pong and start-ping working
hhund Mar 3, 2020
447fe46
work on authorization rules, Task authorization -> update
hhund Mar 3, 2020
64bd431
work on authorization rules, more rules not tested yet
hhund Mar 8, 2020
7e2a130
work on authorization rules, i.a. requestSimpleFeasibility bundle test
hhund Mar 9, 2020
322b9ae
work on authorization rules, i.a. GroupAuthorizationRule/GroupUserFilter
hhund Mar 10, 2020
e68d342
ActivityDefinitions for all processes, requesting/receiving org type
hhund Mar 10, 2020
4d69aa7
additional auth rules and user filters
hhund Mar 10, 2020
0e2c685
test bundle fixes, added missing auth tags
hhund Mar 10, 2020
25e14fc
docker-compose version upgrade
hhund Mar 10, 2020
10758f8
added separate audit logger to log into file fhir-audit.log
hhund Mar 10, 2020
e5b26fd
added missing EndpointAddress search parameter
hhund Mar 10, 2020
0dade5e
added check for unsupported query parameters while executing auth rules
hhund Mar 10, 2020
5fb7693
copy/paste error fix -> wrong url
hhund Mar 10, 2020
ac2f351
copy/paste error fix -> warning log text
hhund Mar 10, 2020
8268373
added missing resource ActivityDefinition
hhund Mar 10, 2020
b509eb9
copy/paste error fix -> wrong version
hhund Mar 10, 2020
7062cd6
removed zero length whitespace characters
hhund Mar 10, 2020
0770d0d
fixed search parameter definition urls and alpha. sort order in DAOs
hhund Mar 10, 2020
4c74545
added authorization tag to created whitelist transaction bundle
hhund Mar 10, 2020
7f71f9e
fixed message name (case sensitive) and process version (now 0.1.0)
hhund Mar 10, 2020
03cf9c1
process version number changes 1.0.0 -> 0.1.0
hhund Mar 10, 2020
89fd235
fixed message-names
hhund Mar 10, 2020
2d13844
increased remote read and connection timeouts
hhund Mar 10, 2020
c124041
additional practitioner.active = true check
hhund Mar 10, 2020
8824195
removed old comment, added debug old/new resource as json log entry
hhund Mar 10, 2020
71eee51
isCurrentUserPartOfReferencedOrganization now only checks id not version
hhund Mar 11, 2020
a79a670
logging fix
hhund Mar 11, 2020
c11cda2
EventManager now checks if resource can be read before sending event
hhund Mar 11, 2020
54b1a47
removed not neede constructor param, fhir parser config fix
hhund Mar 11, 2020
06e697f
missing active=true for test Practitioner resource
hhund Mar 11, 2020
d028c4c
changed authorization extension to support multiple authorization-roles
hhund Mar 11, 2020
edf7293
fixed starter to conform to resource validation
hhund Mar 11, 2020
3a5fb73
fixed serialization issues, feasibility process works with new authoriz.
hhund Mar 11, 2020
a0c378c
removes unneeded starter json files
wetret Mar 13, 2020
f318640
removed redundant check, better error message
hhund Mar 17, 2020
3bb535b
added null check
hhund Mar 17, 2020
305f17a
added DataFormatExceptionHandler to handle HAPI parsing errors -> 403
hhund Mar 17, 2020
153ed93
additional integration tests
hhund Mar 17, 2020
d7054f4
camunda upgrade 7.11 to 7.12
hhund Mar 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public interface Constants

String PROCESS_URI_BASE = "http://highmed.org/bpe/Process/";

String ORGANIZATION_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/CodeSystem/organization";
String ORGANIZATION_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/organization-identifier";
String ORGANIZATION_TYPE_SYSTEM = "http://highmed.org/fhir/CodeSystem/organization-type";
String ENDPOINT_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/CodeSystem/endpoint";
String ENDPOINT_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/endpoint-identifier";

String EXTENSION_PARTICIPATING_MEDIC_URI = "http://highmed.org/fhir/StructureDefinition/participating-medic";
String EXTENSION_QUERY_URI = "http://highmed.org/fhir/StructureDefinition/query";
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer;
import org.camunda.bpm.engine.impl.variable.serializer.ValueFields;
import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl;
import org.highmed.dsf.fhir.variables.FeasibilityQueryResultValues.FeasibilityQueryResultValue;
import org.springframework.beans.factory.InitializingBean;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class FeasibilityQueryResultSerializer
extends PrimitiveValueSerializer<FeasibilityQueryResultValues.FeasibilityQueryResultValue>
public class FeasibilityQueryResultSerializer extends PrimitiveValueSerializer<FeasibilityQueryResultValue>
implements InitializingBean
{
private final ObjectMapper objectMapper;
Expand All @@ -31,7 +31,7 @@ public void afterPropertiesSet() throws Exception
}

@Override
public void writeValue(FeasibilityQueryResultValues.FeasibilityQueryResultValue value, ValueFields valueFields)
public void writeValue(FeasibilityQueryResultValue value, ValueFields valueFields)
{
FeasibilityQueryResult target = value.getValue();
try
Expand All @@ -46,21 +46,20 @@ public void writeValue(FeasibilityQueryResultValues.FeasibilityQueryResultValue
}

@Override
public FeasibilityQueryResultValues.FeasibilityQueryResultValue convertToTypedValue(UntypedValueImpl untypedValue)
public FeasibilityQueryResultValue convertToTypedValue(UntypedValueImpl untypedValue)
{
return FeasibilityQueryResultValues.create((FeasibilityQueryResult) untypedValue.getValue());
}

@Override
public FeasibilityQueryResultValues.FeasibilityQueryResultValue readValue(ValueFields valueFields)
public FeasibilityQueryResultValue readValue(ValueFields valueFields)
{
byte[] bytes = valueFields.getByteArrayValue();

try
{
FeasibilityQueryResult target = (bytes == null || bytes.length <= 0) ?
null :
objectMapper.readValue(bytes, FeasibilityQueryResult.class);
FeasibilityQueryResult target = (bytes == null || bytes.length <= 0) ? null
: objectMapper.readValue(bytes, FeasibilityQueryResult.class);
return FeasibilityQueryResultValues.create(target);
}
catch (IOException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer;
import org.camunda.bpm.engine.impl.variable.serializer.ValueFields;
import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl;
import org.highmed.dsf.fhir.variables.FeasibilityQueryResultsValues.FeasibilityQueryResultsValue;
import org.springframework.beans.factory.InitializingBean;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class FeasibilityQueryResultsSerializer
extends PrimitiveValueSerializer<FeasibilityQueryResultsValues.FeasibilityQueryResultsValue>
public class FeasibilityQueryResultsSerializer extends PrimitiveValueSerializer<FeasibilityQueryResultsValue>
implements InitializingBean
{
private final ObjectMapper objectMapper;
Expand All @@ -31,7 +31,7 @@ public void afterPropertiesSet() throws Exception
}

@Override
public void writeValue(FeasibilityQueryResultsValues.FeasibilityQueryResultsValue value, ValueFields valueFields)
public void writeValue(FeasibilityQueryResultsValue value, ValueFields valueFields)
{
FeasibilityQueryResults targets = value.getValue();
try
Expand All @@ -46,21 +46,20 @@ public void writeValue(FeasibilityQueryResultsValues.FeasibilityQueryResultsValu
}

@Override
public FeasibilityQueryResultsValues.FeasibilityQueryResultsValue convertToTypedValue(UntypedValueImpl untypedValue)
public FeasibilityQueryResultsValue convertToTypedValue(UntypedValueImpl untypedValue)
{
return FeasibilityQueryResultsValues.create((FeasibilityQueryResults) untypedValue.getValue());
}

@Override
public FeasibilityQueryResultsValues.FeasibilityQueryResultsValue readValue(ValueFields valueFields)
public FeasibilityQueryResultsValue readValue(ValueFields valueFields)
{
byte[] bytes = valueFields.getByteArrayValue();

try
{
FeasibilityQueryResults targets = (bytes == null || bytes.length <= 0) ?
null :
objectMapper.readValue(bytes, FeasibilityQueryResults.class);
FeasibilityQueryResults targets = (bytes == null || bytes.length <= 0) ? null
: objectMapper.readValue(bytes, FeasibilityQueryResults.class);
return FeasibilityQueryResultsValues.create(targets);
}
catch (IOException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ public class FhirPlugin implements ProcessEnginePlugin
@SuppressWarnings("rawtypes")
private final List<TypedValueSerializer> serializer;

public FhirPlugin(DomainResourceSerializer domainResourceSerializer,
public FhirPlugin(FhirResourceSerializer fhirResourceSerializer,
FhirResourcesListSerializer fhirResourcesListSerializer,
MultiInstanceTargetSerializer multiInstanceTargetSerializer,
MultiInstanceTargetsSerializer multiInstanceTargetsSerializer,
FeasibilityQueryResultSerializer feasibilityQueryResultSerializer,
FeasibilityQueryResultsSerializer feasibilityQueryResultsSerializer, OutputSerializer outputSerializer,
OutputsSerializer outputsSerializer)
{
serializer = Arrays
.asList(domainResourceSerializer, multiInstanceTargetSerializer, multiInstanceTargetsSerializer,
feasibilityQueryResultSerializer, feasibilityQueryResultsSerializer, outputSerializer,
outputsSerializer);
serializer = Arrays.asList(fhirResourceSerializer, fhirResourcesListSerializer, multiInstanceTargetSerializer,
multiInstanceTargetsSerializer, feasibilityQueryResultSerializer, feasibilityQueryResultsSerializer,
outputSerializer, outputsSerializer);
}

@Override
Expand Down
19 changes: 14 additions & 5 deletions ...r/variables/OrganizationDeserializer.java → ...bles/FhirResourceJacksonDeserializer.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,38 @@
import java.io.IOException;
import java.util.Objects;

import org.hl7.fhir.r4.model.Organization;
import org.hl7.fhir.r4.model.Resource;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;

public class OrganizationDeserializer extends JsonDeserializer<Organization>
public class FhirResourceJacksonDeserializer extends JsonDeserializer<Resource>
{
private final FhirContext fhirContext;

public OrganizationDeserializer(FhirContext fhirContext)
public FhirResourceJacksonDeserializer(FhirContext fhirContext)
{
this.fhirContext = Objects.requireNonNull(fhirContext, "fhirContext");
}

@Override
public Organization deserialize(JsonParser p, DeserializationContext ctxt)
public Resource deserialize(JsonParser p, DeserializationContext ctxt)
throws IOException, JsonProcessingException
{
String string = p.readValueAsTree().toString();
return fhirContext.newJsonParser().parseResource(Organization.class, string);
return (Resource) newJsonParser().parseResource(string);
}

private IParser newJsonParser()
{
IParser p = fhirContext.newJsonParser();
p.setStripVersionsFromReferences(false);
p.setOverrideResourceIdWithBundleEntryFullUrl(false);
return p;
}
}
19 changes: 14 additions & 5 deletions ...hir/variables/OrganizationSerializer.java → ...iables/FhirResourceJacksonSerializer.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,38 @@
import java.io.IOException;
import java.util.Objects;

import org.hl7.fhir.r4.model.Organization;
import org.hl7.fhir.r4.model.Resource;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;

public class OrganizationSerializer extends JsonSerializer<Organization>
public class FhirResourceJacksonSerializer extends JsonSerializer<Resource>
{
private final FhirContext fhirContext;

public OrganizationSerializer(FhirContext fhirContext)
public FhirResourceJacksonSerializer(FhirContext fhirContext)
{
this.fhirContext = Objects.requireNonNull(fhirContext, "fhirContext");
}

@Override
public void serialize(Organization value, JsonGenerator jgen, SerializerProvider provider)
public void serialize(Resource value, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonGenerationException
{
String text = fhirContext.newJsonParser().encodeResourceToString(value);
String text = newJsonParser().encodeResourceToString(value);
jgen.writeRawValue(text);
}

private IParser newJsonParser()
{
IParser p = fhirContext.newJsonParser();
p.setStripVersionsFromReferences(false);
p.setOverrideResourceIdWithBundleEntryFullUrl(false);
return p;
}
}
Loading