From 32a14f898b705882b48507575d84588931bdb196 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 9 Jul 2024 10:21:50 +0200 Subject: [PATCH 01/11] start development cycle 1.1.0.2 --- pom.xml | 2 +- .../process/report/ReportProcessPluginDefinition.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5698dbe..f3d9541 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.medizininformatik-initiative mii-process-report - 1.1.0.1 + 1.1.0.2-SNAPSHOT UTF-8 diff --git a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java index fb1ee35..649d108 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java @@ -10,7 +10,7 @@ public class ReportProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "1.1.0.1"; + public static final String VERSION = "1.1.0.2"; public static final LocalDate RELEASE_DATE = LocalDate.of(2024, 7, 9); @Override From 06970109d03aa3843e8c762eb634940aedc35a0e Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Thu, 18 Jul 2024 15:28:23 +0200 Subject: [PATCH 02/11] add oauth2 client credentials flow support --- pom.xml | 4 +- .../report/ReportProcessPluginDefinition.java | 2 +- .../spring/config/FhirClientConfig.java | 68 ++++++++++++++++++- 3 files changed, 69 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index f3d9541..5def773 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.medizininformatik-initiative mii-process-report - 1.1.0.2-SNAPSHOT + 1.1.1.0-SNAPSHOT UTF-8 @@ -45,7 +45,7 @@ de.medizininformatik-initiative mii-processes-common - 1.0.1.0 + 1.0.2.0-SNAPSHOT org.springframework diff --git a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java index 649d108..f3371d2 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java @@ -10,7 +10,7 @@ public class ReportProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "1.1.0.2"; + public static final String VERSION = "1.1.1.0"; public static final LocalDate RELEASE_DATE = LocalDate.of(2024, 7, 9); @Override diff --git a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java index cefcc08..3a932c8 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java @@ -11,6 +11,10 @@ import ca.uhn.fhir.context.FhirContext; import de.medizininformatik_initiative.processes.common.fhir.client.FhirClientFactory; import de.medizininformatik_initiative.processes.common.fhir.client.logging.DataLogger; +import de.medizininformatik_initiative.processes.common.fhir.client.token.OAuth2TokenClient; +import de.medizininformatik_initiative.processes.common.fhir.client.token.OAuth2TokenProvider; +import de.medizininformatik_initiative.processes.common.fhir.client.token.TokenClient; +import de.medizininformatik_initiative.processes.common.fhir.client.token.TokenProvider; import dev.dsf.bpe.v1.documentation.ProcessDocumentation; @Configuration @@ -95,6 +99,51 @@ public class FhirClientConfig @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.password:#{null}}") private String fhirStoreProxyPassword; + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "The url of the oidc provider to request access tokens (token endpoint)", example = "http://foo.baz/realms/fhir-realm/protocol/openid-connect/token") + @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.issuer.url:#{null}}") + private String fhirStoreOAuth2IssuerUrl; + + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Identifier of the client (username) used for authentication when accessing the oidc provider token endpoint") + @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.client.id:#{null}}") + private String fhirStoreOAuth2ClientId; + + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Secret of the client (password) used for authentication when accessing the oidc provider token endpoint", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") + @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.client.password:#{null}}") + private String fhirStoreOAuth2ClientSecret; + + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "The timeout in milliseconds until a connection is established between the client and the oidc provider", recommendation = "Change default value only if timeout exceptions occur") + @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.timeout.connect:20000}") + private int fhirStoreOAuth2ConnectTimeout; + + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Maximum period of inactivity in milliseconds between two consecutive data packets of the client and the oidc provider", recommendation = "Change default value only if timeout exceptions occur") + @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.timeout.socket:60000}") + private int fhirStoreOAuth2SocketTimeout; + + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "PEM encoded file with one or more trusted root certificate to validate the oidc provider server certificate when connecting via https", recommendation = "Use docker secret file to configure", example = "/run/secrets/hospital_ca.pem") + @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.trust.certificates:#{null}}") + private String fhirStoreOAuth2TrustStore; + + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the oidc provider can only be reached through a proxy", example = "http://proxy.foo:8080") + @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.url:#{null}}") + private String fhirStoreOAuth2ProxyUrl; + + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Proxy username, set if the oidc provider can only be reached through a proxy which requests authentication") + @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.username:#{null}}") + private String fhirStoreOAuth2ProxyUsername; + + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Proxy password, set if the oidc provider can only be reached through a proxy which requests authentication", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") + @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.password:#{null}}") + private String fhirStoreOAuth2ProxyPassword; + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, description = "To enable debug logging of FHIR resources set to `true`") @Value("${de.medizininformatik.initiative.report.dic.fhir.dataLoggingEnabled:false}") @@ -111,8 +160,23 @@ public FhirClientFactory fhirClientFactory() return new FhirClientFactory(trustStorePath, certificatePath, privateKeyPath, fhirStorePrivateKeyPassword, fhirStoreConnectTimeout, fhirStoreSocketTimeout, fhirStoreConnectionRequestTimeout, fhirStoreBaseUrl, - fhirStoreUsername, fhirStorePassword, fhirStoreBearerToken, fhirStoreProxyUrl, fhirStoreProxyUsername, - fhirStoreProxyPassword, fhirStoreHapiClientVerbose, fhirContext, localIdentifierValue, dataLogger()); + fhirStoreUsername, fhirStorePassword, fhirStoreBearerToken, tokenProvider(), fhirStoreProxyUrl, + fhirStoreProxyUsername, fhirStoreProxyPassword, fhirStoreHapiClientVerbose, fhirContext, + localIdentifierValue, dataLogger()); + } + + public TokenProvider tokenProvider() + { + return new OAuth2TokenProvider(tokenClient()); + } + + public TokenClient tokenClient() + { + Path trustStoreOAuth2Path = checkExists(fhirStoreOAuth2TrustStore); + + return new OAuth2TokenClient(fhirStoreOAuth2IssuerUrl, fhirStoreOAuth2ClientId, fhirStoreOAuth2ClientSecret, + fhirStoreOAuth2ConnectTimeout, fhirStoreOAuth2SocketTimeout, trustStoreOAuth2Path, + fhirStoreOAuth2ProxyUrl, fhirStoreOAuth2ProxyUsername, fhirStoreOAuth2ProxyPassword); } public DataLogger dataLogger() From dea75928909825e3b896d479d01880cf4edbfe3c Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Fri, 26 Jul 2024 09:37:23 +0200 Subject: [PATCH 03/11] use default proxy if set and specific proxy is null --- .../spring/config/FhirClientConfig.java | 159 ++++++++++++------ 1 file changed, 103 insertions(+), 56 deletions(-) diff --git a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java index 3a932c8..81d3da7 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java @@ -9,143 +9,171 @@ import org.springframework.context.annotation.Configuration; import ca.uhn.fhir.context.FhirContext; + import de.medizininformatik_initiative.processes.common.fhir.client.FhirClientFactory; import de.medizininformatik_initiative.processes.common.fhir.client.logging.DataLogger; import de.medizininformatik_initiative.processes.common.fhir.client.token.OAuth2TokenClient; import de.medizininformatik_initiative.processes.common.fhir.client.token.OAuth2TokenProvider; import de.medizininformatik_initiative.processes.common.fhir.client.token.TokenClient; import de.medizininformatik_initiative.processes.common.fhir.client.token.TokenProvider; + +import dev.dsf.bpe.v1.ProcessPluginApi; import dev.dsf.bpe.v1.documentation.ProcessDocumentation; @Configuration public class FhirClientConfig { - // TODO: use default proxy config from DSF @Autowired private FhirContext fhirContext; - @ProcessDocumentation(required = true, processNames = { - "medizininformatik-initiativede_reportSend" }, description = "The base address of the FHIR server to read/store FHIR resources", example = "http://foo.bar/fhir") + @Autowired + private ProcessPluginApi api; + + @ProcessDocumentation(required = true, processNames = { "medizininformatik-initiativede_reportSend" }, + description = "The base address of the FHIR server to read/store FHIR resources", + example = "http://foo.bar/fhir") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.base.url:#{null}}") private String fhirStoreBaseUrl; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "PEM encoded file with one or more trusted root certificate to validate the FHIR server certificate when connecting via https", recommendation = "Use docker secret file to configure", example = "/run/secrets/hospital_ca.pem") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "PEM encoded file with one or more trusted root certificate to validate the FHIR server certificate when connecting via https", + recommendation = "Use docker secret file to configure", example = "/run/secrets/hospital_ca.pem") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.trust.certificates:#{null}}") private String fhirStoreTrustStore; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "PEM encoded file with client-certificate, if FHIR server requires mutual TLS authentication", recommendation = "Use docker secret file to configure", example = "/run/secrets/fhir_server_client_certificate.pem") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "PEM encoded file with client-certificate, if FHIR server requires mutual TLS authentication", + recommendation = "Use docker secret file to configure", + example = "/run/secrets/fhir_server_client_certificate.pem") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.certificate:#{null}}") private String fhirStoreCertificate; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Private key corresponding to the FHIR server client-certificate as PEM encoded file. Use *${env_variable}_PASSWORD* or *${env_variable}_PASSWORD_FILE* if private key is encrypted", recommendation = "Use docker secret file to configure", example = "/run/secrets/fhir_server_private_key.pem") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Private key corresponding to the FHIR server client-certificate as PEM encoded file. Use *${env_variable}_PASSWORD* or *${env_variable}_PASSWORD_FILE* if private key is encrypted", + recommendation = "Use docker secret file to configure", + example = "/run/secrets/fhir_server_private_key.pem") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.private.key:#{null}}") private String fhirStorePrivateKey; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Password to decrypt the FHIR server client-certificate encrypted private key", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*", example = "/run/secrets/fhir_server_private_key.pem.password") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Password to decrypt the FHIR server client-certificate encrypted private key", + recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*", + example = "/run/secrets/fhir_server_private_key.pem.password") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.private.key.password:#{null}}") private char[] fhirStorePrivateKeyPassword; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Basic authentication username, set if the server containing the FHIR data requests authentication using basic auth") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Basic authentication username, set if the server containing the FHIR data requests authentication using basic auth") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.basicauth.username:#{null}}") private String fhirStoreUsername; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Basic authentication password, set if the server containing the FHIR data requests authentication using basic auth", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*", example = "/run/secrets/fhir_server_basicauth.password") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Basic authentication password, set if the server containing the FHIR data requests authentication using basic auth", + recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*", + example = "/run/secrets/fhir_server_basicauth.password") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.basicauth.password:#{null}}") private String fhirStorePassword; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Bearer token for authentication, set if the server containing the FHIR data requests authentication using a bearer token, cannot be set using docker secrets") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Bearer token for authentication, set if the server containing the FHIR data requests authentication using a bearer token, cannot be set using docker secrets") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.bearer.token:#{null}}") private String fhirStoreBearerToken; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "The timeout in milliseconds until a connection is established between the client and the FHIR server", recommendation = "Change default value only if timeout exceptions occur") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "The timeout in milliseconds until a connection is established between the client and the FHIR server", + recommendation = "Change default value only if timeout exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.timeout.connect:20000}") private int fhirStoreConnectTimeout; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "The timeout in milliseconds used when requesting a connection from the connection manager between the client and the FHIR server", recommendation = "Change default value only if timeout exceptions occur") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "The timeout in milliseconds used when requesting a connection from the connection manager between the client and the FHIR server", + recommendation = "Change default value only if timeout exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.timeout.connection.request:20000}") private int fhirStoreConnectionRequestTimeout; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Maximum period of inactivity in milliseconds between two consecutive data packets of the client and the FHIR server", recommendation = "Change default value only if timeout exceptions occur") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Maximum period of inactivity in milliseconds between two consecutive data packets of the client and the FHIR server", + recommendation = "Change default value only if timeout exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.timeout.socket:60000}") private int fhirStoreSocketTimeout; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "The client will log additional debug output", recommendation = "Change default value only if exceptions occur") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "The client will log additional debug output", + recommendation = "Change default value only if exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.client.verbose:false}") private boolean fhirStoreHapiClientVerbose; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the server containing the FHIR data can only be reached through a proxy", example = "http://proxy.foo:8080") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Proxy location, set if the server containing the FHIR data can only be reached through a proxy", + example = "http://proxy.foo:8080") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.url:#{null}}") private String fhirStoreProxyUrl; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy username, set if the server containing the FHIR data can only be reached through a proxy which requests authentication") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Proxy username, set if the server containing the FHIR data can only be reached through a proxy which requests authentication") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.username:#{null}}") private String fhirStoreProxyUsername; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy password, set if the server containing the FHIR data can only be reached through a proxy which requests authentication", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Proxy password, set if the server containing the FHIR data can only be reached through a proxy which requests authentication", + recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.password:#{null}}") private String fhirStoreProxyPassword; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "The url of the oidc provider to request access tokens (token endpoint)", example = "http://foo.baz/realms/fhir-realm/protocol/openid-connect/token") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "The url of the oidc provider to request access tokens (token endpoint)", + example = "http://foo.baz/realms/fhir-realm/protocol/openid-connect/token") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.issuer.url:#{null}}") private String fhirStoreOAuth2IssuerUrl; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Identifier of the client (username) used for authentication when accessing the oidc provider token endpoint") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Identifier of the client (username) used for authentication when accessing the oidc provider token endpoint") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.client.id:#{null}}") private String fhirStoreOAuth2ClientId; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Secret of the client (password) used for authentication when accessing the oidc provider token endpoint", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Secret of the client (password) used for authentication when accessing the oidc provider token endpoint", + recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.client.password:#{null}}") private String fhirStoreOAuth2ClientSecret; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "The timeout in milliseconds until a connection is established between the client and the oidc provider", recommendation = "Change default value only if timeout exceptions occur") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "The timeout in milliseconds until a connection is established between the client and the oidc provider", + recommendation = "Change default value only if timeout exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.timeout.connect:20000}") private int fhirStoreOAuth2ConnectTimeout; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Maximum period of inactivity in milliseconds between two consecutive data packets of the client and the oidc provider", recommendation = "Change default value only if timeout exceptions occur") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Maximum period of inactivity in milliseconds between two consecutive data packets of the client and the oidc provider", + recommendation = "Change default value only if timeout exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.timeout.socket:60000}") private int fhirStoreOAuth2SocketTimeout; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "PEM encoded file with one or more trusted root certificate to validate the oidc provider server certificate when connecting via https", recommendation = "Use docker secret file to configure", example = "/run/secrets/hospital_ca.pem") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "PEM encoded file with one or more trusted root certificate to validate the oidc provider server certificate when connecting via https", + recommendation = "Use docker secret file to configure", example = "/run/secrets/hospital_ca.pem") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.trust.certificates:#{null}}") private String fhirStoreOAuth2TrustStore; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the oidc provider can only be reached through a proxy", example = "http://proxy.foo:8080") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Proxy location, set if the oidc provider can only be reached through a proxy", + example = "http://proxy.foo:8080") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.url:#{null}}") private String fhirStoreOAuth2ProxyUrl; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy username, set if the oidc provider can only be reached through a proxy which requests authentication") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Proxy username, set if the oidc provider can only be reached through a proxy which requests authentication") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.username:#{null}}") private String fhirStoreOAuth2ProxyUsername; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy password, set if the oidc provider can only be reached through a proxy which requests authentication", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "Proxy password, set if the oidc provider can only be reached through a proxy which requests authentication", + recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.password:#{null}}") private String fhirStoreOAuth2ProxyPassword; - @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "To enable debug logging of FHIR resources set to `true`") + @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, + description = "To enable debug logging of FHIR resources set to `true`") @Value("${de.medizininformatik.initiative.report.dic.fhir.dataLoggingEnabled:false}") private boolean fhirDataLoggingEnabled; @@ -158,11 +186,20 @@ public FhirClientFactory fhirClientFactory() Path certificatePath = checkExists(fhirStoreCertificate); Path privateKeyPath = checkExists(fhirStorePrivateKey); + String proxyUrl = fhirStoreProxyUrl, proxyUsername = fhirStoreProxyUsername, proxyPassword = fhirStorePassword; + if (proxyUrl == null && api.getProxyConfig().isEnabled() && !api.getProxyConfig() + .isNoProxyUrl(fhirStoreBaseUrl)) + { + proxyUrl = api.getProxyConfig().getUrl(); + proxyUsername = api.getProxyConfig().getUsername(); + proxyPassword = + api.getProxyConfig().getPassword() == null ? null : new String(api.getProxyConfig().getPassword()); + } + return new FhirClientFactory(trustStorePath, certificatePath, privateKeyPath, fhirStorePrivateKeyPassword, fhirStoreConnectTimeout, fhirStoreSocketTimeout, fhirStoreConnectionRequestTimeout, fhirStoreBaseUrl, - fhirStoreUsername, fhirStorePassword, fhirStoreBearerToken, tokenProvider(), fhirStoreProxyUrl, - fhirStoreProxyUsername, fhirStoreProxyPassword, fhirStoreHapiClientVerbose, fhirContext, - localIdentifierValue, dataLogger()); + fhirStoreUsername, fhirStorePassword, fhirStoreBearerToken, tokenProvider(), proxyUrl, proxyUsername, + proxyPassword, fhirStoreHapiClientVerbose, fhirContext, localIdentifierValue, dataLogger()); } public TokenProvider tokenProvider() @@ -174,9 +211,19 @@ public TokenClient tokenClient() { Path trustStoreOAuth2Path = checkExists(fhirStoreOAuth2TrustStore); + String proxyUrl = fhirStoreOAuth2ProxyUrl, proxyUsername = fhirStoreOAuth2ProxyUsername, proxyPassword = fhirStoreOAuth2ProxyPassword; + if (proxyUrl == null && api.getProxyConfig().isEnabled() && !api.getProxyConfig() + .isNoProxyUrl(fhirStoreOAuth2IssuerUrl)) + { + proxyUrl = api.getProxyConfig().getUrl(); + proxyUsername = api.getProxyConfig().getUsername(); + proxyPassword = + api.getProxyConfig().getPassword() == null ? null : new String(api.getProxyConfig().getPassword()); + } + return new OAuth2TokenClient(fhirStoreOAuth2IssuerUrl, fhirStoreOAuth2ClientId, fhirStoreOAuth2ClientSecret, - fhirStoreOAuth2ConnectTimeout, fhirStoreOAuth2SocketTimeout, trustStoreOAuth2Path, - fhirStoreOAuth2ProxyUrl, fhirStoreOAuth2ProxyUsername, fhirStoreOAuth2ProxyPassword); + fhirStoreOAuth2ConnectTimeout, fhirStoreOAuth2SocketTimeout, trustStoreOAuth2Path, proxyUrl, + proxyUsername, proxyPassword); } public DataLogger dataLogger() From 95327a453ec58b12f2b1aa000709457252df6739 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Fri, 26 Jul 2024 09:38:42 +0200 Subject: [PATCH 04/11] format and sort --- .../spring/config/FhirClientConfig.java | 144 ++++++++---------- 1 file changed, 60 insertions(+), 84 deletions(-) diff --git a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java index 81d3da7..5fb70db 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java @@ -9,14 +9,12 @@ import org.springframework.context.annotation.Configuration; import ca.uhn.fhir.context.FhirContext; - import de.medizininformatik_initiative.processes.common.fhir.client.FhirClientFactory; import de.medizininformatik_initiative.processes.common.fhir.client.logging.DataLogger; import de.medizininformatik_initiative.processes.common.fhir.client.token.OAuth2TokenClient; import de.medizininformatik_initiative.processes.common.fhir.client.token.OAuth2TokenProvider; import de.medizininformatik_initiative.processes.common.fhir.client.token.TokenClient; import de.medizininformatik_initiative.processes.common.fhir.client.token.TokenProvider; - import dev.dsf.bpe.v1.ProcessPluginApi; import dev.dsf.bpe.v1.documentation.ProcessDocumentation; @@ -29,151 +27,128 @@ public class FhirClientConfig @Autowired private ProcessPluginApi api; - @ProcessDocumentation(required = true, processNames = { "medizininformatik-initiativede_reportSend" }, - description = "The base address of the FHIR server to read/store FHIR resources", - example = "http://foo.bar/fhir") + @ProcessDocumentation(required = true, processNames = { + "medizininformatik-initiativede_reportSend" }, description = "The base address of the FHIR server to read/store FHIR resources", example = "http://foo.bar/fhir") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.base.url:#{null}}") private String fhirStoreBaseUrl; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "PEM encoded file with one or more trusted root certificate to validate the FHIR server certificate when connecting via https", - recommendation = "Use docker secret file to configure", example = "/run/secrets/hospital_ca.pem") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "PEM encoded file with one or more trusted root certificate to validate the FHIR server certificate when connecting via https", recommendation = "Use docker secret file to configure", example = "/run/secrets/hospital_ca.pem") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.trust.certificates:#{null}}") private String fhirStoreTrustStore; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "PEM encoded file with client-certificate, if FHIR server requires mutual TLS authentication", - recommendation = "Use docker secret file to configure", - example = "/run/secrets/fhir_server_client_certificate.pem") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "PEM encoded file with client-certificate, if FHIR server requires mutual TLS authentication", recommendation = "Use docker secret file to configure", example = "/run/secrets/fhir_server_client_certificate.pem") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.certificate:#{null}}") private String fhirStoreCertificate; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Private key corresponding to the FHIR server client-certificate as PEM encoded file. Use *${env_variable}_PASSWORD* or *${env_variable}_PASSWORD_FILE* if private key is encrypted", - recommendation = "Use docker secret file to configure", - example = "/run/secrets/fhir_server_private_key.pem") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Private key corresponding to the FHIR server client-certificate as PEM encoded file. Use *${env_variable}_PASSWORD* or *${env_variable}_PASSWORD_FILE* if private key is encrypted", recommendation = "Use docker secret file to configure", example = "/run/secrets/fhir_server_private_key.pem") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.private.key:#{null}}") private String fhirStorePrivateKey; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Password to decrypt the FHIR server client-certificate encrypted private key", - recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*", - example = "/run/secrets/fhir_server_private_key.pem.password") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Password to decrypt the FHIR server client-certificate encrypted private key", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*", example = "/run/secrets/fhir_server_private_key.pem.password") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.private.key.password:#{null}}") private char[] fhirStorePrivateKeyPassword; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Basic authentication username, set if the server containing the FHIR data requests authentication using basic auth") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Basic authentication username, set if the server containing the FHIR data requests authentication using basic auth") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.basicauth.username:#{null}}") private String fhirStoreUsername; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Basic authentication password, set if the server containing the FHIR data requests authentication using basic auth", - recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*", - example = "/run/secrets/fhir_server_basicauth.password") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Basic authentication password, set if the server containing the FHIR data requests authentication using basic auth", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*", example = "/run/secrets/fhir_server_basicauth.password") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.basicauth.password:#{null}}") private String fhirStorePassword; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Bearer token for authentication, set if the server containing the FHIR data requests authentication using a bearer token, cannot be set using docker secrets") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Bearer token for authentication, set if the server containing the FHIR data requests authentication using a bearer token, cannot be set using docker secrets") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.bearer.token:#{null}}") private String fhirStoreBearerToken; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "The timeout in milliseconds until a connection is established between the client and the FHIR server", - recommendation = "Change default value only if timeout exceptions occur") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "The timeout in milliseconds until a connection is established between the client and the FHIR server", recommendation = "Change default value only if timeout exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.timeout.connect:20000}") private int fhirStoreConnectTimeout; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "The timeout in milliseconds used when requesting a connection from the connection manager between the client and the FHIR server", - recommendation = "Change default value only if timeout exceptions occur") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "The timeout in milliseconds used when requesting a connection from the connection manager between the client and the FHIR server", recommendation = "Change default value only if timeout exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.timeout.connection.request:20000}") private int fhirStoreConnectionRequestTimeout; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Maximum period of inactivity in milliseconds between two consecutive data packets of the client and the FHIR server", - recommendation = "Change default value only if timeout exceptions occur") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Maximum period of inactivity in milliseconds between two consecutive data packets of the client and the FHIR server", recommendation = "Change default value only if timeout exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.timeout.socket:60000}") private int fhirStoreSocketTimeout; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "The client will log additional debug output", - recommendation = "Change default value only if exceptions occur") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "The client will log additional debug output", recommendation = "Change default value only if exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.client.verbose:false}") private boolean fhirStoreHapiClientVerbose; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Proxy location, set if the server containing the FHIR data can only be reached through a proxy", - example = "http://proxy.foo:8080") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the server containing the FHIR data can only be reached through a proxy", example = "http://proxy.foo:8080") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.url:#{null}}") private String fhirStoreProxyUrl; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Proxy username, set if the server containing the FHIR data can only be reached through a proxy which requests authentication") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Proxy username, set if the server containing the FHIR data can only be reached through a proxy which requests authentication") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.username:#{null}}") private String fhirStoreProxyUsername; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Proxy password, set if the server containing the FHIR data can only be reached through a proxy which requests authentication", - recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Proxy password, set if the server containing the FHIR data can only be reached through a proxy which requests authentication", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.password:#{null}}") private String fhirStoreProxyPassword; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "The url of the oidc provider to request access tokens (token endpoint)", - example = "http://foo.baz/realms/fhir-realm/protocol/openid-connect/token") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "The url of the oidc provider to request access tokens (token endpoint)", example = "http://foo.baz/realms/fhir-realm/protocol/openid-connect/token") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.issuer.url:#{null}}") private String fhirStoreOAuth2IssuerUrl; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Identifier of the client (username) used for authentication when accessing the oidc provider token endpoint") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Identifier of the client (username) used for authentication when accessing the oidc provider token endpoint") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.client.id:#{null}}") private String fhirStoreOAuth2ClientId; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Secret of the client (password) used for authentication when accessing the oidc provider token endpoint", - recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Secret of the client (password) used for authentication when accessing the oidc provider token endpoint", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.client.password:#{null}}") private String fhirStoreOAuth2ClientSecret; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "The timeout in milliseconds until a connection is established between the client and the oidc provider", - recommendation = "Change default value only if timeout exceptions occur") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "The timeout in milliseconds until a connection is established between the client and the oidc provider", recommendation = "Change default value only if timeout exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.timeout.connect:20000}") private int fhirStoreOAuth2ConnectTimeout; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Maximum period of inactivity in milliseconds between two consecutive data packets of the client and the oidc provider", - recommendation = "Change default value only if timeout exceptions occur") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Maximum period of inactivity in milliseconds between two consecutive data packets of the client and the oidc provider", recommendation = "Change default value only if timeout exceptions occur") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.timeout.socket:60000}") private int fhirStoreOAuth2SocketTimeout; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "PEM encoded file with one or more trusted root certificate to validate the oidc provider server certificate when connecting via https", - recommendation = "Use docker secret file to configure", example = "/run/secrets/hospital_ca.pem") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "PEM encoded file with one or more trusted root certificate to validate the oidc provider server certificate when connecting via https", recommendation = "Use docker secret file to configure", example = "/run/secrets/hospital_ca.pem") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.trust.certificates:#{null}}") private String fhirStoreOAuth2TrustStore; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Proxy location, set if the oidc provider can only be reached through a proxy", - example = "http://proxy.foo:8080") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the oidc provider can only be reached through a proxy", example = "http://proxy.foo:8080") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.url:#{null}}") private String fhirStoreOAuth2ProxyUrl; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Proxy username, set if the oidc provider can only be reached through a proxy which requests authentication") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Proxy username, set if the oidc provider can only be reached through a proxy which requests authentication") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.username:#{null}}") private String fhirStoreOAuth2ProxyUsername; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "Proxy password, set if the oidc provider can only be reached through a proxy which requests authentication", - recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "Proxy password, set if the oidc provider can only be reached through a proxy which requests authentication", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.password:#{null}}") private String fhirStoreOAuth2ProxyPassword; - @ProcessDocumentation(processNames = { "medizininformatik-initiativede_reportSend" }, - description = "To enable debug logging of FHIR resources set to `true`") + @ProcessDocumentation(processNames = { + "medizininformatik-initiativede_reportSend" }, description = "To enable debug logging of FHIR resources set to `true`") @Value("${de.medizininformatik.initiative.report.dic.fhir.dataLoggingEnabled:false}") private boolean fhirDataLoggingEnabled; @@ -187,13 +162,13 @@ public FhirClientFactory fhirClientFactory() Path privateKeyPath = checkExists(fhirStorePrivateKey); String proxyUrl = fhirStoreProxyUrl, proxyUsername = fhirStoreProxyUsername, proxyPassword = fhirStorePassword; - if (proxyUrl == null && api.getProxyConfig().isEnabled() && !api.getProxyConfig() - .isNoProxyUrl(fhirStoreBaseUrl)) + if (proxyUrl == null && api.getProxyConfig().isEnabled() + && !api.getProxyConfig().isNoProxyUrl(fhirStoreBaseUrl)) { proxyUrl = api.getProxyConfig().getUrl(); proxyUsername = api.getProxyConfig().getUsername(); - proxyPassword = - api.getProxyConfig().getPassword() == null ? null : new String(api.getProxyConfig().getPassword()); + proxyPassword = api.getProxyConfig().getPassword() == null ? null + : new String(api.getProxyConfig().getPassword()); } return new FhirClientFactory(trustStorePath, certificatePath, privateKeyPath, fhirStorePrivateKeyPassword, @@ -211,14 +186,15 @@ public TokenClient tokenClient() { Path trustStoreOAuth2Path = checkExists(fhirStoreOAuth2TrustStore); - String proxyUrl = fhirStoreOAuth2ProxyUrl, proxyUsername = fhirStoreOAuth2ProxyUsername, proxyPassword = fhirStoreOAuth2ProxyPassword; - if (proxyUrl == null && api.getProxyConfig().isEnabled() && !api.getProxyConfig() - .isNoProxyUrl(fhirStoreOAuth2IssuerUrl)) + String proxyUrl = fhirStoreOAuth2ProxyUrl, proxyUsername = fhirStoreOAuth2ProxyUsername, + proxyPassword = fhirStoreOAuth2ProxyPassword; + if (proxyUrl == null && api.getProxyConfig().isEnabled() + && !api.getProxyConfig().isNoProxyUrl(fhirStoreOAuth2IssuerUrl)) { proxyUrl = api.getProxyConfig().getUrl(); proxyUsername = api.getProxyConfig().getUsername(); - proxyPassword = - api.getProxyConfig().getPassword() == null ? null : new String(api.getProxyConfig().getPassword()); + proxyPassword = api.getProxyConfig().getPassword() == null ? null + : new String(api.getProxyConfig().getPassword()); } return new OAuth2TokenClient(fhirStoreOAuth2IssuerUrl, fhirStoreOAuth2ClientId, fhirStoreOAuth2ClientSecret, From 82f5bbc1e84983d858a2f5c9edf40e7221864db4 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Fri, 26 Jul 2024 09:56:12 +0200 Subject: [PATCH 05/11] fix typo --- .../process/report/spring/config/FhirClientConfig.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java index 5fb70db..d4f0a6f 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java @@ -161,7 +161,8 @@ public FhirClientFactory fhirClientFactory() Path certificatePath = checkExists(fhirStoreCertificate); Path privateKeyPath = checkExists(fhirStorePrivateKey); - String proxyUrl = fhirStoreProxyUrl, proxyUsername = fhirStoreProxyUsername, proxyPassword = fhirStorePassword; + String proxyUrl = fhirStoreProxyUrl, proxyUsername = fhirStoreProxyUsername, + proxyPassword = fhirStoreProxyPassword; if (proxyUrl == null && api.getProxyConfig().isEnabled() && !api.getProxyConfig().isNoProxyUrl(fhirStoreBaseUrl)) { From e84567e64ecb904448cd93c88bf42500c2f73f00 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Fri, 26 Jul 2024 11:11:31 +0200 Subject: [PATCH 06/11] add recommendation to use default dsf proxy --- .../process/report/spring/config/FhirClientConfig.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java index d4f0a6f..e924360 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java @@ -88,7 +88,7 @@ public class FhirClientConfig private boolean fhirStoreHapiClientVerbose; @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the server containing the FHIR data can only be reached through a proxy", example = "http://proxy.foo:8080") + "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the server containing the FHIR data can only be reached through a proxy", recommendation = "Use default DSF proxy configuration if possible", example = "http://proxy.foo:8080") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.url:#{null}}") private String fhirStoreProxyUrl; @@ -133,7 +133,7 @@ public class FhirClientConfig private String fhirStoreOAuth2TrustStore; @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the oidc provider can only be reached through a proxy", example = "http://proxy.foo:8080") + "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the oidc provider can only be reached through a proxy", recommendation = "Use default DSF proxy configuration if possible", example = "http://proxy.foo:8080") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.url:#{null}}") private String fhirStoreOAuth2ProxyUrl; From 68d0a99c78eec5fb2e6b3f1214740a09607bdd22 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 30 Jul 2024 09:00:05 +0200 Subject: [PATCH 07/11] improve documentation of proxy envs --- .../process/report/spring/config/FhirClientConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java index e924360..a931f64 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java @@ -133,17 +133,17 @@ public class FhirClientConfig private String fhirStoreOAuth2TrustStore; @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the oidc provider can only be reached through a proxy", recommendation = "Use default DSF proxy configuration if possible", example = "http://proxy.foo:8080") + "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the oidc provider can only be reached through a proxy, uses value from DEV_DSF_PROXY_URL if not set", example = "http://proxy.foo:8080") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.url:#{null}}") private String fhirStoreOAuth2ProxyUrl; @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy username, set if the oidc provider can only be reached through a proxy which requests authentication") + "medizininformatik-initiativede_reportSend" }, description = "Proxy username, set if the oidc provider can only be reached through a proxy which requests authentication, uses value from DEV_DSF_PROXY_USERNAME if not set") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.username:#{null}}") private String fhirStoreOAuth2ProxyUsername; @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy password, set if the oidc provider can only be reached through a proxy which requests authentication", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") + "medizininformatik-initiativede_reportSend" }, description = "Proxy password, set if the oidc provider can only be reached through a proxy which requests authentication, uses value from DEV_DSF_PROXY_PASSWORD if not set", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.oauth2.proxy.password:#{null}}") private String fhirStoreOAuth2ProxyPassword; From 624bb6134223b216bb10986ebae0c572807fdebf Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 30 Jul 2024 17:29:23 +0200 Subject: [PATCH 08/11] improve env description to use dsf proxy env if not set specificaly --- .../process/report/spring/config/FhirClientConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java index a931f64..2d9d03f 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/FhirClientConfig.java @@ -88,17 +88,17 @@ public class FhirClientConfig private boolean fhirStoreHapiClientVerbose; @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the server containing the FHIR data can only be reached through a proxy", recommendation = "Use default DSF proxy configuration if possible", example = "http://proxy.foo:8080") + "medizininformatik-initiativede_reportSend" }, description = "Proxy location, set if the server containing the FHIR data can only be reached through a proxy, uses value from DEV_DSF_PROXY_URL if not set", example = "http://proxy.foo:8080") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.url:#{null}}") private String fhirStoreProxyUrl; @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy username, set if the server containing the FHIR data can only be reached through a proxy which requests authentication") + "medizininformatik-initiativede_reportSend" }, description = "Proxy username, set if the server containing the FHIR data can only be reached through a proxy which requests authentication, uses value from DEV_DSF_PROXY_USERNAME if not set") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.username:#{null}}") private String fhirStoreProxyUsername; @ProcessDocumentation(processNames = { - "medizininformatik-initiativede_reportSend" }, description = "Proxy password, set if the server containing the FHIR data can only be reached through a proxy which requests authentication", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") + "medizininformatik-initiativede_reportSend" }, description = "Proxy password, set if the server containing the FHIR data can only be reached through a proxy which requests authentication, uses value from DEV_DSF_PROXY_PASSWORD if not set", recommendation = "Use docker secret file to configure by using *${env_variable}_FILE*") @Value("${de.medizininformatik.initiative.report.dic.fhir.server.proxy.password:#{null}}") private String fhirStoreProxyPassword; From fd90bd678d31fa98287f68c52d77cd32324bc6c0 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Wed, 31 Jul 2024 13:57:18 +0200 Subject: [PATCH 09/11] update dependencies --- pom.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 5def773..172c3c7 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 17 17 - 1.5.1 + 1.5.2 ../mii-processes-test-setup @@ -50,7 +50,7 @@ org.springframework spring-web - 6.1.6 + 6.1.11 provided @@ -103,12 +103,12 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.5 + 3.3.1 org.apache.maven.plugins maven-jar-plugin - 3.4.1 + 3.4.2 @@ -125,7 +125,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.3 + 3.6.0 package @@ -153,12 +153,12 @@ org.apache.maven.plugins maven-dependency-plugin - 3.6.1 + 3.7.1 org.apache.maven.plugins maven-clean-plugin - 3.3.2 + 3.4.0 org.codehaus.mojo @@ -181,7 +181,7 @@ net.revelc.code.formatter formatter-maven-plugin - 2.23.0 + 2.24.1 eclipse-formatter-config.xml @@ -189,7 +189,7 @@ net.revelc.code impsort-maven-plugin - 1.9.0 + 1.11.0 17 java.,javax.,org.,com. @@ -221,17 +221,17 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.5.0 + 3.6.2 com.github.spotbugs spotbugs-maven-plugin - 4.8.5.0 + 4.8.6.2 org.apache.maven.plugins maven-pmd-plugin - 3.22.0 + 3.24.0 From 18d045bae016b3a131cd59934cd3b04dcad69359 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Wed, 31 Jul 2024 18:53:10 +0200 Subject: [PATCH 10/11] use same version as dsf for spring-web --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 172c3c7..ed7da39 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ org.springframework spring-web - 6.1.11 + 6.1.10 provided From 022b21dd491154d564fecf54a3630b2c46e331eb Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Thu, 1 Aug 2024 08:25:29 +0200 Subject: [PATCH 11/11] release 1.1.1.0 --- pom.xml | 4 ++-- .../process/report/ReportProcessPluginDefinition.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ed7da39..1c248ff 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.medizininformatik-initiative mii-process-report - 1.1.1.0-SNAPSHOT + 1.1.1.0 UTF-8 @@ -45,7 +45,7 @@ de.medizininformatik-initiative mii-processes-common - 1.0.2.0-SNAPSHOT + 1.0.2.0 org.springframework diff --git a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java index f3371d2..38e21c3 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java @@ -11,7 +11,7 @@ public class ReportProcessPluginDefinition implements ProcessPluginDefinition { public static final String VERSION = "1.1.1.0"; - public static final LocalDate RELEASE_DATE = LocalDate.of(2024, 7, 9); + public static final LocalDate RELEASE_DATE = LocalDate.of(2024, 8, 1); @Override public String getName()