From 583c542c921f798322813ce1ecb52a595e51c2f9 Mon Sep 17 00:00:00 2001 From: patrick-werner Date: Wed, 31 Mar 2021 12:34:28 +0200 Subject: [PATCH 1/4] changed CORS to allowed origin pattern --- .../ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java | 2 +- src/main/resources/application.yaml | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java b/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java index 8154714..0333e71 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/BaseJpaRestfulServer.java @@ -280,7 +280,7 @@ public class BaseJpaRestfulServer extends RestfulServer { config.addAllowedHeader("X-Requested-With"); config.addAllowedHeader("Prefer"); List allAllowedCORSOrigins = appProperties.getCors().getAllowed_origin(); - allAllowedCORSOrigins.forEach(config::addAllowedOrigin); + allAllowedCORSOrigins.forEach(config::addAllowedOriginPattern); config.addExposedHeader("Location"); diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 6d685bd..015bc71 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -82,12 +82,11 @@ hapi: #partitioning: # allow_references_across_partitions: false # partitioning_include_in_search_hashes: false - #cors: - # allow_Credentials: true - # Supports multiple, comma separated allowed origin entries - # cors.allowed_origin=http://localhost:8080,https://localhost:8080,https://fhirtest.uhn.ca - # allowed_origin: - # - '*' + cors: + allow_Credentials: true + # These are allowed_origin patterns, see: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/cors/CorsConfiguration.html#setAllowedOriginPatterns-java.util.List- + allowed_origin: + - '*' # logger: # error_format: 'ERROR - ${requestVerb} ${requestUrl}' From ae1ada1578d56323f985799ebe8751056ab97654 Mon Sep 17 00:00:00 2001 From: Sean McIlvenna Date: Wed, 14 Apr 2021 11:48:41 -0700 Subject: [PATCH 2/4] Making comments in config consistent. Reorganizing a bit to be a little cleaner. Adding `client_id_strategy` --- src/main/resources/application.yaml | 69 +++++++++++++---------------- 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 015bc71..e47f360 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -17,46 +17,42 @@ spring: # hibernate.cache.use_second_level_cache: false # hibernate.cache.use_structured_entries: false # hibernate.cache.use_minimal_puts: false - - # These settings will enable fulltext search with lucene +### These settings will enable fulltext search with lucene # hibernate.search.enabled: true # hibernate.search.backend.type: lucene # hibernate.search.backend.analysis.configurer: ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer # hibernate.search.backend.directory.type: local-filesystem # hibernate.search.backend.directory.root: target/lucenefiles # hibernate.search.backend.lucene_version: lucene_current - batch: job: enabled: false - hapi: fhir: - ### enable to use the ApacheProxyAddressStrategy which uses X-Forwarded-* headers - ### to determine the FHIR server address -# use_apache_address_strategy: false - ### forces the use of the https:// protocol for the returned server address. - ### alternatively, it may be set using the X-Forwarded-Proto header. -# use_apache_address_strategy_https: false - ### enable to set the Server URL -# server_address: http://hapi.fhir.org/baseR4 ### This is the FHIR version. Choose between, DSTU2, DSTU3, R4 or R5 fhir_version: R4 +### enable to use the ApacheProxyAddressStrategy which uses X-Forwarded-* headers +### to determine the FHIR server address +# use_apache_address_strategy: false +### forces the use of the https:// protocol for the returned server address. +### alternatively, it may be set using the X-Forwarded-Proto header. +# use_apache_address_strategy_https: false +### enable to set the Server URL +# server_address: http://hapi.fhir.org/baseR4 # defer_indexing_for_codesystems_of_size: 101 - #implementationguides: - #example from registry (packages.fhir.org) - #swiss: - #name: swiss.mednet.fhir - #version: 0.8.0 - #example not from registry - #ips_1_0_0: - #url: https://build.fhir.org/ig/HL7/fhir-ips/package.tgz - #name: hl7.fhir.uv.ips - #version: 1.0.0 - - #supported_resource_types: - # - Patient - # - Observation +# implementationguides: +### example from registry (packages.fhir.org) +# swiss: +# name: swiss.mednet.fhir +# version: 0.8.0 +# example not from registry +# ips_1_0_0: +# url: https://build.fhir.org/ig/HL7/fhir-ips/package.tgz +# name: hl7.fhir.uv.ips +# version: 1.0.0 +# supported_resource_types: +# - Patient +# - Observation # allow_cascading_deletes: true # allow_contains_searches: true # allow_external_references: true @@ -75,19 +71,19 @@ hapi: # etag_support_enabled: true # expunge_enabled: true # daoconfig_client_id_strategy: null +# client_id_strategy: ALPHANUMERIC # fhirpath_interceptor_enabled: false # filter_search_enabled: true # graphql_enabled: true # narrative_enabled: true - #partitioning: - # allow_references_across_partitions: false - # partitioning_include_in_search_hashes: false +# partitioning: +# allow_references_across_partitions: false +# partitioning_include_in_search_hashes: false cors: allow_Credentials: true # These are allowed_origin patterns, see: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/cors/CorsConfiguration.html#setAllowedOriginPatterns-java.util.List- allowed_origin: - '*' - # logger: # error_format: 'ERROR - ${requestVerb} ${requestUrl}' # format: >- @@ -102,13 +98,11 @@ hapi: # retain_cached_searches_mins: 60 # reuse_cached_search_results_millis: 60000 tester: - home: name: Local Tester server_address: 'http://localhost:8080/fhir' refuse_to_fetch_third_party_urls: false fhir_version: R4 - global: name: Global Tester server_address: "http://hapi.fhir.org/baseR4" @@ -133,14 +127,11 @@ hapi: # startTlsRequired: # quitWait: # lastn_enabled: true - ### This is configuration for normalized quantity serach level default is 0 - ### 0: NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED - default - ### 1: NORMALIZED_QUANTITY_STORAGE_SUPPORTED - ### 2: NORMALIZED_QUANTITY_SEARCH_SUPPORTED +### This is configuration for normalized quantity serach level default is 0 +### 0: NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED - default +### 1: NORMALIZED_QUANTITY_STORAGE_SUPPORTED +### 2: NORMALIZED_QUANTITY_SEARCH_SUPPORTED # normalized_quantity_search_level: 2 - - -# #elasticsearch: # debug: # pretty_print_json_log: false From 867290448683d2a609ca2b7e7e466a910698e6fc Mon Sep 17 00:00:00 2001 From: tor003 Date: Wed, 28 Apr 2021 20:17:47 +0200 Subject: [PATCH 3/4] readme suggestion --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 95edfc7..8d8e220 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,13 @@ spring: password: admin driverClassName: com.mysql.jdbc.Driver ``` +On some systems, it might be necessary to override hibernate's default naming strategy. The naming strategy must be set using spring.jpa.hibernate.naming.physical-strategy. + +```yaml +spring: + jpa: + hibernate.physical_naming_strategy: NAME_OF_PREFERRED_STRATEGY +``` ### PostgreSQL configuration From 90def787221e0137b6abcc35513c5df14e57e285 Mon Sep 17 00:00:00 2001 From: JavaImpala Date: Sun, 2 May 2021 23:22:29 +0200 Subject: [PATCH 4/4] fixed property naming in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d8e220..fecb5e8 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ spring: password: admin driverClassName: com.mysql.jdbc.Driver ``` -On some systems, it might be necessary to override hibernate's default naming strategy. The naming strategy must be set using spring.jpa.hibernate.naming.physical-strategy. +On some systems, it might be necessary to override hibernate's default naming strategy. The naming strategy must be set using spring.jpa.hibernate.physical_naming_strategy. ```yaml spring: