Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue/122 Validation Forwarding Proxy Config #127

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,10 @@ public void testConnection()
{
logger.info(
"Testing connection to Data Store FHIR server with {trustStorePath: {}, certificatePath: {}, privateKeyPath: {}, privateKeyPassword: {},"
+ " basicAuthUsername {}, basicAuthPassword {}, bearerToken {}, serverBase: {}, proxyUrl {}, proxyUsername, proxyPassword {}}",
+ " basicAuthUsername: {}, basicAuthPassword: {}, bearerToken: {}, serverBase: {}, proxy: values from 'DEV_DSF_PROXY'... config}",
trustStorePath, certificatePath, privateKeyPath, privateKeyPassword != null ? "***" : "null",
dataStoreServerBasicAuthUsername, dataStoreServerBasicAuthPassword != null ? "***" : "null",
dataStoreServerBearerToken != null ? "***" : "null", dataStoreServerBase, proxyUrl, proxyUsername,
proxyPassword != null ? "***" : "null");
dataStoreServerBearerToken != null ? "***" : "null", dataStoreServerBase);

getDataStoreClient().testConnection();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ private void configureProxy(IRestfulClientFactory clientFactory, String proxyUrl
clientFactory.setProxy(url.getHost(), url.getPort());
clientFactory.setProxyCredentials(proxyUsername, proxyPassword);

logger.info("Using proxy for data FHIR server connection with {host: {}, port: {}, username: {}}",
url.getHost(), url.getPort(), proxyUsername);
logger.info("Using proxy for data FHIR server connection with values from 'DEV_DSF_PROXY'... config");
}
catch (MalformedURLException e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,10 @@ public void testConnection()
{
logger.info(
"Testing connection to fTTP with {trustStorePath: {}, certificatePath: {}, privateKeyPath: {}, privateKeyPassword: {},"
+ " basicAuthUsername: {}, basicAuthPassword: {}, serverBase: {}, apiKey: {}, study: {}, target: {}, proxyUrl: {}, proxyUsername: {}, proxyPassword: {}}",
+ " basicAuthUsername: {}, basicAuthPassword: {}, serverBase: {}, apiKey: {}, study: {}, target: {}, proxy: values from 'DEV_DSF_PROXY'... config}",
trustStorePath, certificatePath, privateKeyPath, privateKeyPassword != null ? "***" : "null",
fttpBasicAuthUsername, fttpBasicAuthPassword != null ? "***" : "null", fttpServerBase,
fttpApiKey != null ? "***" : "null", fttpStudy, fttpTarget, proxyUrl, proxyUsername,
proxyPassword != null ? "***" : "null");
fttpApiKey != null ? "***" : "null", fttpStudy, fttpTarget);

getFttpClient().testConnection();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ private void configureProxy(IRestfulClientFactory clientFactory, String proxyUrl
clientFactory.setProxy(url.getHost(), url.getPort());
clientFactory.setProxyCredentials(proxyUsername, proxyPassword);

logger.info("Using proxy for fTTP connection with {host: {}, port: {}, username: {}}", url.getHost(),
url.getPort(), proxyUsername);
logger.info("Using proxy for fTTP connection with values from 'DEV_DSF_PROXY'... config");
}
catch (MalformedURLException e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ else if (resource instanceof Encounter e)
e.setSubject(patientRef);
else if (resource instanceof Immunization i)
i.setPatient(patientRef);
else if (resource instanceof Medication m)
else if (resource instanceof Medication)
; // nothing to do
else if (resource instanceof MedicationAdministration ma)
ma.setSubject(patientRef);
Expand Down Expand Up @@ -94,7 +94,7 @@ else if (resource instanceof Encounter e)
return Optional.of(e.getSubject());
else if (resource instanceof Immunization i)
return Optional.of(i.getPatient());
else if (resource instanceof Medication m)
else if (resource instanceof Medication)
return Optional.empty();
else if (resource instanceof MedicationAdministration ma)
return Optional.of(ma.getSubject());
Expand Down Expand Up @@ -198,8 +198,8 @@ protected Optional<Patient> findPatientInLocalFhirStore(String pseudonym)
}
catch (Exception e)
{
logger.warn("Error while searching for Patient with pseudonym " + NAMING_SYSTEM_NUM_CODEX_CRR_PSEUDONYM
+ "|" + pseudonym, e);
logger.warn("Error while searching for Patient with pseudonym {}|{}", NAMING_SYSTEM_NUM_CODEX_CRR_PSEUDONYM,
pseudonym, e);
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ public Optional<Patient> getPatient(String reference)
logger.warn("Patient {} not found: {} - {}", reference, e.getClass().getName(), e.getMessage());

if (logger.isDebugEnabled())
logger.debug("Error while reading patient " + reference, e);
logger.debug("Error while reading patient {}", reference, e);

return Optional.empty();
}
Expand Down Expand Up @@ -684,7 +684,7 @@ public void updatePatient(Patient patient)
}
catch (Exception e)
{
logger.warn("Could not update patient " + id, e);
logger.warn("Could not update patient {}", id, e);
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private Optional<Patient> update(Patient existingPatient, Patient newPatient, St
}
catch (Exception e)
{
logger.warn("Could not update patient " + newPatient.getIdElement().toString(), e);
logger.warn("Could not update patient {}", newPatient.getIdElement().toString(), e);
throw e;
}
}
Expand Down Expand Up @@ -230,7 +230,7 @@ private Optional<Patient> create(Patient newPatient, String pseudonym, String bu
}
catch (Exception e)
{
logger.warn("Could not create patient " + newPatient.getIdElement().toString(), e);
logger.warn("Could not create patient {}", newPatient.getIdElement().toString(), e);
throw e;
}
}
Expand Down Expand Up @@ -318,7 +318,7 @@ private Optional<Resource> findResourceInLocalFhirStore(String url, Class<? exte
}
catch (Exception e)
{
logger.warn("Error while searching for Resource with url " + url, e);
logger.warn("Error while searching for Resource with url {}", url, e);
throw e;
}
}
Expand Down Expand Up @@ -426,8 +426,8 @@ else if (outcome.getOperationOutcome() != null && outcome.getOperationOutcome()
}
catch (Exception e)
{
logger.warn("Count not update " + newResource.getResourceType().name() + " "
+ newResource.getIdElement().toString(), e);
logger.warn("Count not update {} {}", newResource.getResourceType().name(),
newResource.getIdElement().toString(), e);
throw e;
}
}
Expand Down Expand Up @@ -497,8 +497,8 @@ else if (outcome.getOperationOutcome() != null && outcome.getOperationOutcome()
}
catch (Exception e)
{
logger.warn("Could not create " + newResource.getResourceType().name() + " "
+ newResource.getIdElement().toString(), e);
logger.warn("Could not create {} {}", newResource.getResourceType().name(),
newResource.getIdElement().toString(), e);
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected void doExecute(DelegateExecution execution, Variables variables) throw
catch (InvalidKeyException | BadPaddingException | IllegalBlockSizeException | NoSuchPaddingException
| NoSuchAlgorithmException | InvalidAlgorithmParameterException | IOException e)
{
logger.warn("Unable to decrypt data from DIC: " + e.getMessage(), e);
logger.warn("Unable to decrypt data from DIC: {}", e.getMessage(), e);
throw new BpmnError(CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DECRYPTION_OF_DATA_FROM_DIC_FAILED,
"Error while decrypting data from DIC");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected void doExecute(DelegateExecution execution, Variables variables) throw
}
catch (Exception e)
{
logger.warn("Error while reading Binary resoruce: " + e.getMessage(), e);
logger.warn("Error while reading Binary resoruce: {}", e.getMessage(), e);

throw new BpmnError(
CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DOWNLOAD_OF_ENCRYPTED_DATA_FROM_DTS_FAILED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected void doExecute(DelegateExecution execution, Variables variables) throw
| InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException
| ShortBufferException e)
{
logger.warn("Unable to encrypt validation error for DIC: " + e.getMessage(), e);
logger.warn("Unable to encrypt validation error for DIC: {}", e.getMessage(), e);
throw new BpmnError(
CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_ECRYPTION_OF_VALIDATION_ERROR_FOR_DIC_FAILED,
"Unable to encrypt validation error for DIC");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private IdType createBinaryResource(Binary binary)
catch (Exception e)
{
dataLogger.logData("Binary to create", binary);
logger.warn("Error while creating Binary resource: " + e.getMessage(), e);
logger.warn("Error while creating Binary resource: {}", e.getMessage(), e);

throw new BpmnError(
CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_UNABLE_TO_STORE_ECRYPTED_VALIDATION_ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected void doExecute(DelegateExecution execution, Variables variables) throw
catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException
| InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException | IOException e)
{
logger.warn("Unable to decrypt validation error from CRR: " + e.getMessage(), e);
logger.warn("Unable to decrypt validation error from CRR: {}", e.getMessage(), e);
throw new BpmnError(
CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DECRYPTION_OF_VALIDATION_ERROR_FROM_CRR_FAILED,
"Error while decrypting validation error from CRR");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected void doExecute(DelegateExecution execution, Variables variables) throw
}
catch (Exception e)
{
logger.warn("Error while reading Binary resoruce: " + e.getMessage(), e);
logger.warn("Error while reading Binary resoruce: {}", e.getMessage(), e);

throw new BpmnError(
CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DOWNLOAD_OF_ENCRYPTED_VALIDATION_ERROR_FROM_DTS_FAILED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected void doExecute(DelegateExecution execution, dev.dsf.bpe.v1.variables.V
| InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException
| ShortBufferException | IOException e)
{
logger.warn("Unable to encrypt data for CRR: " + e.getMessage(), e);
logger.warn("Unable to encrypt data for CRR: {}", e.getMessage(), e);
throw new BpmnError(CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_ECRYPTION_OF_DATA_FOR_CRR_FAILED,
"Unable to encrypt data for CRR");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,21 +372,22 @@ private <R extends DomainResource, C> R fixReferenceFromComponents(R resource, M
&& uuidsById.containsKey(oldReference.getReference()))
{
logger.debug(
"Replacing reference at " + path
+ " from resource {} with bundle temporary id in transport bundle",
i, getAbsoluteId(resource).getValue());
"Replacing reference at {}[{}] from resource {} with bundle temporary id in transport bundle",
path, i, getAbsoluteId(resource).getValue());
setReference.apply(component, new Reference(uuidsById.get(oldReference.getReference())));
}
else if ((oldReference.hasReference() && oldReference.getReference() == null
&& oldReference.getReferenceElement_()
.hasExtension("http://hl7.org/fhir/StructureDefinition/data-absent-reason"))
|| oldReference.hasExtension("http://hl7.org/fhir/StructureDefinition/data-absent-reason"))
{
logger.debug("Not removing empty reference at " + path + " with data-absent-reason extension", i);
logger.debug(
"Not removing empty reference at {}[{}] with data-absent-reason extension from resource {} in transport bundle",
path, i, getAbsoluteId(resource).getValue());
}
else
{
logger.warn("Removing reference at " + path + " from resource {} in transport bundle", i,
logger.warn("Removing reference at {}[{}] from resource {} in transport bundle", path, i,
getAbsoluteId(resource).getValue());
setReference.apply(component, null);
}
Expand Down Expand Up @@ -454,7 +455,7 @@ private <R extends DomainResource, C> void cleanUnsupportedReferenceFromComponen
C component = components.get(i);
if (hasReference.apply(component))
{
logger.warn("Removing reference at " + path + " from resource {} in transport bundle", i,
logger.warn("Removing reference at {}[{}] from resource {} in transport bundle", path, i,
getAbsoluteId(resource).getValue());
setReference.apply(component, null);
}
Expand All @@ -471,7 +472,7 @@ private <R extends DomainResource, C> void cleanUnsupportedReferenceFromComponen
C component = getComponents.apply(resource);
if (hasReference.apply(component))
{
logger.warn("Removing reference at " + path + " from resource {} in transport bundle",
logger.warn("Removing reference at {} from resource {} in transport bundle", path,
getAbsoluteId(resource).getValue());
setReference.apply(component, null);
}
Expand All @@ -490,7 +491,7 @@ private <R extends DomainResource, C> void cleanUnsupportedReferencesFromCompone
C component = components.get(i);
if (hasReferences.apply(component))
{
logger.warn("Removing references at " + path + " from resource {} in transport bundle", i,
logger.warn("Removing references at {}[{}] from resource {} in transport bundle", path, i,
getAbsoluteId(resource).getValue());
setReferences.apply(component, null);
}
Expand All @@ -514,7 +515,7 @@ private <R extends DomainResource, C1, C2> void cleanUnsupportedReferencesFromCo
C2 component2 = components2.get(i);
if (hasReference.apply(component2))
{
logger.warn("Removing reference at " + path + "[{}] from resource {} in transport bundle", i,
logger.warn("Removing reference at {}[{}] from resource {} in transport bundle", path, i,
getAbsoluteId(resource).getValue());
setReference.apply(component2, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private IdType createBinaryResource(Binary binary)
catch (Exception e)
{
dataLogger.logData("Binary to create", binary);
logger.warn("Error while creating Binary resource: " + e.getMessage(), e);
logger.warn("Error while creating Binary resource: {}", e.getMessage(), e);

throw new BpmnError(CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_UNABLE_TO_STORE_ECRYPTED_DATA,
"Unable to create Binary resource with encrypted data for DTS in local DSF FHIR server");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected void doExecute(DelegateExecution execution, Variables variables) throw
}
catch (Exception e)
{
logger.warn("Error while reading Binary resoruce: " + e.getMessage(), e);
logger.warn("Error while reading Binary resoruce: {}", e.getMessage(), e);

throw new BpmnError(
CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DOWNLOAD_OF_ENCRYPTED_DATA_FROM_DIC_FAILED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected void doExecute(DelegateExecution execution, Variables variables) throw
}
catch (Exception e)
{
logger.warn("Error while reading Binary resoruce: " + e.getMessage(), e);
logger.warn("Error while reading Binary resoruce: {}", e.getMessage(), e);

throw new BpmnError(
CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_DOWNLOAD_OF_ENCRYTPED_VALIDATION_ERROR_FROM_CRR_FAILED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private IdType createBinaryResource(Binary binary)
catch (Exception e)
{
dataLogger.logData("Binary to create", binary);
logger.warn("Error while creating Binary resource: " + e.getMessage(), e);
logger.warn("Error while creating Binary resource: {}", e.getMessage(), e);

throw new BpmnError(CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_UNABLE_TO_STORE_ECRYPTED_DATA,
"Unable to create Binary resource with encrypted data for CRR in local DSF FHIR server");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private IdType createBinaryResource(Binary binary)
catch (Exception e)
{
dataLogger.logData("Binary to create", binary);
logger.warn("Error while creating Binary resource: " + e.getMessage(), e);
logger.warn("Error while creating Binary resource: {}", e.getMessage(), e);

throw new BpmnError(
CODESYSTEM_NUM_CODEX_DATA_TRANSFER_ERROR_VALUE_UNABLE_TO_STORE_ECRYPTED_VALIDATION_ERROR,
Expand Down
Loading
Loading