-
Notifications
You must be signed in to change notification settings - Fork 34
Merge Release 3.6.1 to main #140
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
Changes from all commits
a20e55b
42201d4
998b5ab
c2cd720
4388d59
c1ac206
db93a33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| <factorypath> | ||
| <factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.36/lombok-1.18.36.jar" enabled="true" runInBatchMode="false"/> | ||
| <factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar" enabled="true" runInBatchMode="false"/> | ||
| <factorypathentry kind="VARJAR" id="M2_REPO/org/mapstruct/mapstruct-processor/1.2.0.Final/mapstruct-processor-1.2.0.Final.jar" enabled="true" runInBatchMode="false"/> | ||
| </factorypath> | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -100,6 +100,10 @@ | |||||||||||||||||||||||||
| webLoginAbhaVerify = https://abhasbx.abdm.gov.in/abha/api/v3/phr/web/login/abha/verify | ||||||||||||||||||||||||||
| webLoginPhrCard = https://abhasbx.abdm.gov.in/abha/api/v3/phr/web/login/profile/abha/phr-card | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## ABDM V3 M2 APIs | ||||||||||||||||||||||||||
| generateTokenForLinkCareContext = https://dev.abdm.gov.in/api/hiecm/v3/token/generate-token | ||||||||||||||||||||||||||
| linkCareContext = https://dev.abdm.gov.in/api/hiecm/hip/v3/link/carecontext | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| x-CM-ID= sbx | ||||||||||||||||||||||||||
| abhaMode=sbx | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
@@ -113,4 +117,17 @@ | |||||||||||||||||||||||||
| logging.path=logs/ | ||||||||||||||||||||||||||
| logging.file.name=logs/fhir-api.log | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| cors.allowed-origins=http://localhost:* | ||||||||||||||||||||||||||
| cors.allowed-origins=http://localhost:* | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| hipSystemUrl= <Enter HIP request URL> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Elasticsearch Configuration | ||||||||||||||||||||||||||
| elasticsearch.host=localhost | ||||||||||||||||||||||||||
| elasticsearch.port=9200 | ||||||||||||||||||||||||||
| elasticsearch.username=elastic | ||||||||||||||||||||||||||
| elasticsearch.password=piramalES | ||||||||||||||||||||||||||
|
Check warning on line 128 in src/main/environment/common_example.properties
|
||||||||||||||||||||||||||
Check noticeCode scanning / SonarCloud Credentials should not be hard-coded Low
Make sure these credentials get revoked, changed, and removed from the code. See more on SonarQube Cloud
|
||||||||||||||||||||||||||
| elasticsearch.index.beneficiary=beneficiary_index | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Enable/Disable ES (for gradual rollout) | ||||||||||||||||||||||||||
| elasticsearch.enabled=true | ||||||||||||||||||||||||||
|
Comment on lines
+127
to
+132
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid concrete Elasticsearch credentials and enabled-by-default in example config. Line 127β129 ships real-looking defaults, and Line 132 enables ES by default. In sample configs, this increases accidental insecure rollout risk. Suggested change-elasticsearch.username=elastic
-elasticsearch.password=piramalES
+elasticsearch.username=<Enter Elasticsearch username>
+elasticsearch.password=<Enter Elasticsearch password>
@@
-elasticsearch.enabled=true
+elasticsearch.enabled=falseπ Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,8 +19,9 @@ public void addCorsMappings(CorsRegistry registry) { | |||||||
| Arrays.stream(allowedOrigins.split(",")) | ||||||||
| .map(String::trim) | ||||||||
| .toArray(String[]::new)) | ||||||||
| .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") | ||||||||
| .allowedHeaders("Content-Type", "Authorization") | ||||||||
| .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS") | ||||||||
| .allowedHeaders("Authorization", "Content-Type", "Accept", "Jwttoken", | ||||||||
| "serverAuthorization", "ServerAuthorization", "serverauthorization", "Serverauthorization") | ||||||||
|
Comment on lines
+23
to
+24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π§© Analysis chainπ Web query:
π‘ Result: Yes, in Spring MVC CORS configuration via WebMvcConfigurer, setting allowedHeaders("*") allows all custom request headers during preflight checks, regardless of header name casing. Citations:
π Script executed: # First, find the CorsConfig.java file and examine its content
fd CorsConfig.javaRepository: PSMRI/FHIR-API Length of output: 109 π Script executed: # Check the size and content of CorsConfig.java
if [ -f "src/main/java/com/wipro/fhir/config/CorsConfig.java" ]; then
wc -l "src/main/java/com/wipro/fhir/config/CorsConfig.java"
echo "---"
cat -n "src/main/java/com/wipro/fhir/config/CorsConfig.java"
fiRepository: PSMRI/FHIR-API Length of output: 1521 π Script executed: # Also check if there are other CORS-related configurations in the codebase
rg -i "corsconfig|@crossorigin|allowedheaders" --type java -lRepository: PSMRI/FHIR-API Length of output: 185 Replace hardcoded header list with wildcard to support custom headers required by FHIR integrations. Lines 23β24 restrict allowed headers to a predefined list, which prevents custom headers and requires code changes when integrations add new headers. FHIR APIs commonly need flexible header support for various healthcare standards and vendor-specific integrations. Suggested change- .allowedHeaders("Authorization", "Content-Type", "Accept", "Jwttoken",
- "serverAuthorization", "ServerAuthorization", "serverauthorization", "Serverauthorization")
+ .allowedHeaders("*")π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||
| .exposedHeaders("Authorization") | ||||||||
| .allowCredentials(true) | ||||||||
| .maxAge(3600); | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| package com.wipro.fhir.config; | ||
|
|
||
| import co.elastic.clients.elasticsearch.ElasticsearchClient; | ||
| import co.elastic.clients.json.jackson.JacksonJsonpMapper; | ||
| import co.elastic.clients.transport.ElasticsearchTransport; | ||
| import co.elastic.clients.transport.rest_client.RestClientTransport; | ||
| import org.apache.http.HttpHost; | ||
| import org.apache.http.auth.AuthScope; | ||
| import org.apache.http.auth.UsernamePasswordCredentials; | ||
| import org.apache.http.impl.client.BasicCredentialsProvider; | ||
| import org.apache.http.impl.nio.reactor.IOReactorConfig; | ||
| import org.elasticsearch.client.RestClient; | ||
| import org.elasticsearch.client.RestClientBuilder; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.scheduling.annotation.EnableAsync; | ||
| import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
|
||
| import java.util.concurrent.Executor; | ||
|
|
||
| @Configuration | ||
| @EnableAsync | ||
| public class ElasticsearchConfig { | ||
|
|
||
| @Value("${elasticsearch.host}") | ||
| private String esHost; | ||
|
|
||
| @Value("${elasticsearch.port}") | ||
| private int esPort; | ||
|
|
||
| @Value("${elasticsearch.username}") | ||
| private String esUsername; | ||
|
|
||
| @Value("${elasticsearch.password}") | ||
| private String esPassword; | ||
|
|
||
| @Value("${elasticsearch.connection.timeout:10000}") | ||
| private int connectionTimeout; | ||
|
|
||
| @Value("${elasticsearch.socket.timeout:120000}") | ||
| private int socketTimeout; | ||
|
|
||
| @Value("${elasticsearch.max.connections:200}") | ||
| private int maxConnections; | ||
|
|
||
| @Value("${elasticsearch.max.connections.per.route:100}") | ||
| private int maxConnectionsPerRoute; | ||
|
|
||
| @Bean | ||
| public ElasticsearchClient elasticsearchClient() { | ||
| BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider(); | ||
| credentialsProvider.setCredentials( | ||
| AuthScope.ANY, | ||
| new UsernamePasswordCredentials(esUsername, esPassword) | ||
| ); | ||
|
|
||
| RestClientBuilder builder = RestClient.builder( | ||
| new HttpHost(esHost, esPort, "http") | ||
| ); | ||
|
|
||
| // Apply timeout configurations | ||
| builder.setRequestConfigCallback(requestConfigBuilder -> | ||
| requestConfigBuilder | ||
| .setConnectTimeout(connectionTimeout) | ||
| .setSocketTimeout(socketTimeout) | ||
| .setConnectionRequestTimeout(connectionTimeout) | ||
| ); | ||
|
|
||
| // Apply connection pool settings | ||
| builder.setHttpClientConfigCallback(httpClientBuilder -> | ||
| httpClientBuilder | ||
| .setDefaultCredentialsProvider(credentialsProvider) | ||
| .setMaxConnTotal(maxConnections) | ||
| .setMaxConnPerRoute(maxConnectionsPerRoute) | ||
| .setDefaultIOReactorConfig( | ||
| IOReactorConfig.custom() | ||
| .setSoTimeout(socketTimeout) | ||
| .build() | ||
| ) | ||
| ); | ||
|
|
||
| RestClient restClient = builder.build(); | ||
|
|
||
| ElasticsearchTransport transport = new RestClientTransport( | ||
| restClient, | ||
| new JacksonJsonpMapper() | ||
| ); | ||
|
|
||
| return new ElasticsearchClient(transport); | ||
| } | ||
|
|
||
| @Bean(name = "esAsyncExecutor") | ||
| public Executor asyncExecutor() { | ||
| ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
| executor.setCorePoolSize(5); | ||
| executor.setMaxPoolSize(20); | ||
| executor.setQueueCapacity(500); | ||
| executor.setThreadNamePrefix("es-sync-"); | ||
| executor.setRejectedExecutionHandler(new java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy()); | ||
| executor.initialize(); | ||
| return executor; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π§© Analysis chain
π Script executed:
Repository: PSMRI/FHIR-API
Length of output: 1775
π Script executed:
Repository: PSMRI/FHIR-API
Length of output: 1205
Update
.factorypathLombok version to matchpom.xml.pom.xmldeclares Lombok 1.18.36 (line 30:<org.projectlombok.version>1.18.36</org.projectlombok.version>), but.factorypathspecifies 1.18.30. Update the.factorypathentry tolombok-1.18.36.jarto prevent annotation processor version mismatches during compilation.π€ Prompt for AI Agents