Skip to content

Commit

Permalink
Merge pull request #311 from medizininformatik-initiative/release/v5.0.1
Browse files Browse the repository at this point in the history
Release v5.0.1
  • Loading branch information
EmteZogaf authored Jun 28, 2024
2 parents 491a25c + 5c82fa8 commit c460f75
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [5.0.A] - 2024-06-29

### Fixed
- Injection of environment variable value for OAuth client id was broken ([#308](https://github.com/medizininformatik-initiative/feasibility-backend/issues/308))

## [5.0.0] - 2024-06-26

### Added
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>de.medizininformatik-initiative</groupId>
<artifactId>FeasibilityGuiBackend</artifactId>
<version>5.0.0</version>
<version>5.0.1</version>

<name>FeasibilityGuiBackend</name>
<description>Backend of the Feasibility GUI</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public DirectSpringConfig(@Value("${app.broker.direct.useCql:false}") boolean us
@Value("${app.broker.direct.auth.basic.username}") String username,
@Value("${app.broker.direct.auth.basic.password}") String password,
@Value("${app.broker.direct.auth.oauth.issuer.url}") String issuer,
@Value("${app.broker.direct.auth.oauth.client.id") String clientId,
@Value("${app.broker.direct.auth.oauth.client.id}") String clientId,
@Value("${app.broker.direct.auth.oauth.client.secret}") String clientSecret) {
this.useCql = useCql;
this.flareBaseUrl = flareBaseUrl;
Expand All @@ -57,8 +57,10 @@ public BrokerClient directBrokerClient(WebClient directWebClientFlare,
@Value("${app.broker.direct.obfuscateResultCount:false}") boolean obfuscateResultCount,
FhirConnector fhirConnector, FhirHelper fhirHelper) {
if (useCql) {
log.info("Enable direct broker (type: cql)");
return new DirectBrokerClientCql(fhirConnector, obfuscateResultCount, fhirHelper);
} else {
log.info("Enable direct broker (type: flare)");
return new DirectBrokerClientFlare(directWebClientFlare, obfuscateResultCount);
}
}
Expand All @@ -67,30 +69,32 @@ public BrokerClient directBrokerClient(WebClient directWebClientFlare,
public IGenericClient getFhirClient(FhirContext fhirContext) {
IGenericClient iGenericClient = fhirContext.newRestfulGenericClient(cqlBaseUrl);
if (!isNullOrEmpty(password) && !isNullOrEmpty(username)) {
log.info("Enable direct broker with basic authentication (type: cql, url: {}, username: {})", cqlBaseUrl,
log.info("Configure direct broker instance with basic authentication (type: cql, url: {}, username: {})",
cqlBaseUrl,
username);
iGenericClient.registerInterceptor(new BasicAuthInterceptor(username, password));
} else if (!isNullOrEmpty(issuer) && !isNullOrEmpty(clientId) && !isNullOrEmpty(clientSecret)) {
log.info("Enable direct broker with oauth authentication (type: cql, url: {}, issuer: {}, client-id: {})",
log.info("Configure direct broker instance with oauth authentication"
+ " (type: cql, url: {}, issuer: {}, client-id: {})",
cqlBaseUrl, issuer, clientId);
iGenericClient.registerInterceptor(new OAuthInterceptor(issuer, clientId, clientSecret));
} else {
log.info("Enable direct broker (type: cql, url: {})", cqlBaseUrl);
log.info("Configure direct broker instance (type: cql, url: {})", cqlBaseUrl);
}
return iGenericClient;
}

@Bean
public WebClient directWebClientFlare() {
if (!isNullOrEmpty(password) && !isNullOrEmpty(username)) {
log.info("Enable direct broker with basic authentication (type: flare, url: {}, username: {})",
log.info("Configure direct broker instance with basic authentication (type: flare, url: {}, username: {})",
flareBaseUrl, username);
return WebClient.builder()
.filter(basicAuthentication(username, password))
.baseUrl(flareBaseUrl)
.build();
} else {
log.info("Enable direct broker (type: flare, url: {})", flareBaseUrl);
log.info("Configure direct broker instance (type: flare, url: {})", flareBaseUrl);
return WebClient.create(flareBaseUrl);
}
}
Expand Down

0 comments on commit c460f75

Please sign in to comment.