-
Notifications
You must be signed in to change notification settings - Fork 45
Release 3.6.0 #317
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
Open
drtechie
wants to merge
392
commits into
main
Choose a base branch
from
release-3.6.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Release 3.6.0 #317
Changes from all commits
Commits
Show all changes
392 commits
Select commit
Hold shift + click to select a range
45399c2
fix: changed application properties
vishwab1 e305d5d
fix: removed firebase enabled
vishwab1 b9fd226
fix: added firebase enabled
vishwab1 84a75fa
fix firebase issue
SauravBizbRolly 0695327
Merge remote-tracking branch 'upstream/release-3.6.0' into release-3.6.0
SauravBizbRolly 6b3d22e
fix sms issue
SauravBizbRolly 355eafe
fix sms issue
SauravBizbRolly c1caeae
fix sms issue
SauravBizbRolly ff53e66
fix firebase code issue
SauravBizbRolly 9df0542
fix code issue
SauravBizbRolly c2b1a44
fix code issue
SauravBizbRolly eccc116
fix code issue
SauravBizbRolly abfc4e4
fix code issue
SauravBizbRolly ace7340
fix code issue
SauravBizbRolly 86042b9
fix code issue
SauravBizbRolly 555e274
fix code issue
SauravBizbRolly 17bad73
fix code issue
SauravBizbRolly 9f2ebd6
fix code issue
SauravBizbRolly edb6137
fix code issue
SauravBizbRolly 3dd6522
fix code issue
SauravBizbRolly 3aa039e
fix code issue
SauravBizbRolly 16194a1
fix code issue
SauravBizbRolly aaf41c9
fix code issue
SauravBizbRolly 4771ce6
fix code issue
SauravBizbRolly 6f1cc9a
Merge branch 'release-3.6.0' into release-3.6.0-develop
vishwab1 089035d
fix code issue
SauravBizbRolly f75892e
VAPT: File Upload Validation and Security Hardening (#285)
vishwab1 fa648d2
Update application.properties
SauravBizbRolly 79cc8b1
Beneficiary consent
SauravBizbRolly ab64879
Beneficiary consent
SauravBizbRolly 88b042a
Beneficiary consent
SauravBizbRolly 50416d6
Beneficiary consent
SauravBizbRolly afdf9f0
Beneficiary consent
SauravBizbRolly 0d22d68
firebase setup
SauravBizbRolly ad11e10
firebase setup
SauravBizbRolly 2f281b0
firebase setup
SauravBizbRolly f8d2784
firebase setup
SauravBizbRolly d113d36
firebase setup
SauravBizbRolly acd9ee1
Firebase Configuration in ci
SauravBizbRolly 77b823f
Firebase Configuration in ci
SauravBizbRolly 2ab86e1
firebase notification setup
SauravBizbRolly 3551a00
Firebase update userToken
SauravBizbRolly bddf0dc
Firebase update userToken
SauravBizbRolly affd611
Add firebase variables in common_docker.properties
SauravBizbRolly 13031c4
Add firebase variables in common_docker.properties
SauravBizbRolly 433ffec
update firebase variables in common_docker.properties
SauravBizbRolly af65376
update firebase variables in common_docker.properties
SauravBizbRolly d4d6cbf
update firebase variables in common_docker.properties
SauravBizbRolly 1441f99
fixed code
SauravBizbRolly 4376a8a
fixed code
SauravBizbRolly 807f043
Fixed security hotspot
SauravBizbRolly 2f728d3
Fixed security hotspot
SauravBizbRolly 2c8277f
Remove firebase base64 variable
SauravBizbRolly 157a6e6
Remove firebase base64 variable
SauravBizbRolly c88d2c1
fix firebase file access issue
SauravBizbRolly 1e900a3
fix firebase file access issue
SauravBizbRolly 845c138
dynamic form
SauravBizbRolly d6abd65
dynamic form
SauravBizbRolly 9a743da
dynamic form
SauravBizbRolly 6c1417d
dynamic form
SauravBizbRolly cd9417a
IDENTITY_BASE_URL fix
SauravBizbRolly 8bf6d0c
IDENTITY_BASE_URL fix
SauravBizbRolly 52660af
IDENTITY_BASE_URL fix
SauravBizbRolly 7d21b14
IDENTITY_BASE_URL fix
SauravBizbRolly 1a07e56
IDENTITY_BASE_URL fix
SauravBizbRolly 272db98
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly 78531fa
IDENTITY_BASE_URL fix
SauravBizbRolly a66ac6f
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly 534665d
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly d176d64
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly 634b9e2
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly c25aa3f
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly 697ba36
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly e2dab17
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly d3c6f2f
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly e6e992b
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly 1b5b9b9
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly 15b7055
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly 61ae6af
Update application.properties
SauravBizbRolly 8680ecb
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly e7c6b04
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly 376e704
Update JwtUserIdValidationFilter.java
SauravBizbRolly 795c427
Update CommonIdentityMapperDecorator.java
SauravBizbRolly ebd595e
Update JwtUserIdValidationFilter.java
SauravBizbRolly 3e9d00e
Update FirebaseNotificationController.java
SauravBizbRolly 82434e1
Update FirebaseNotificationService.java
SauravBizbRolly 34bd50d
Update BeneficiaryConsentController.java
SauravBizbRolly dff88e6
dynamic from feature
SauravBizbRolly 5441939
dynamic from feature
SauravBizbRolly 616dbfc
dynamic from feature
SauravBizbRolly bae3a68
dynamic from feature
SauravBizbRolly ad459c2
welcome sms
SauravBizbRolly e84e28f
fix issue
SauravBizbRolly 2b806a7
fix issue
SauravBizbRolly d2d8fb6
fix issue
SauravBizbRolly 7a5e8cd
Update application.properties
SauravBizbRolly 3a14f56
fix issue
SauravBizbRolly 00197a2
fix issue
SauravBizbRolly df1c324
fix issue
SauravBizbRolly d61a2dc
fix issue
SauravBizbRolly bbbb623
fix issue
SauravBizbRolly 1237757
fix issue
SauravBizbRolly 254a9a0
Update WelcomeBenificarySmsServiceImpl.java
SauravBizbRolly e1cf6bd
Update application.properties
SauravBizbRolly 5bc5445
Update IEMRAdminController.java
SauravBizbRolly 0aed4f0
fix issue
SauravBizbRolly 1b2e7a0
fix issue
SauravBizbRolly 2802fb3
fix issue
SauravBizbRolly 7030151
fix issue
SauravBizbRolly 7a280b6
fix issue
SauravBizbRolly b92d7d7
fix issue
SauravBizbRolly 4ed6798
fix issue
SauravBizbRolly ae5bc54
fix issue
SauravBizbRolly 9d05db2
fix issue
SauravBizbRolly 9ebd258
fix firebase issue
SauravBizbRolly 100245b
changed the pom correction
vishwab1 3379b71
fix sms issue
SauravBizbRolly 36a177e
fix sms issue
SauravBizbRolly 2f7b7d3
fix firebase code issue
SauravBizbRolly 4e65a33
fix code issue
SauravBizbRolly dd0957d
fix code issue
SauravBizbRolly 300659b
fix code issue
SauravBizbRolly 6112a78
fix code issue
SauravBizbRolly 7531f30
fix code issue
SauravBizbRolly 268642e
fix code issue
SauravBizbRolly ff5dc76
fix code issue
SauravBizbRolly e9c9dea
fix code issue
SauravBizbRolly a1ec0ee
fix code issue
SauravBizbRolly f69fab4
fix code issue
SauravBizbRolly 717148c
fix code issue
SauravBizbRolly 59e7a85
fix code issue
SauravBizbRolly acb2ff2
fix code issue
SauravBizbRolly d5fdbd7
fix code issue
SauravBizbRolly 9aebcc7
fix code issue
SauravBizbRolly aabe287
fix code issue
SauravBizbRolly 91ef53d
Merge remote-tracking branch 'upstream/release-3.6.0' into release-3.6.0
SauravBizbRolly aaf013c
fix code issue
SauravBizbRolly cf526ce
fix code issue
SauravBizbRolly 8938dd1
Update application.properties
SauravBizbRolly 5f0d92b
Update ScheduleForGrievanceDataSync.java
SauravBizbRolly 0cb6287
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly c584be7
Update WelcomeBenificarySmsServiceImpl.java
SauravBizbRolly 8fbf9f1
Update application.properties
SauravBizbRolly f928523
Update common_ci.properties
SauravBizbRolly 3adda88
Update common_docker.properties
SauravBizbRolly 1753021
Update NHMDetailCallReportScheduler.java
SauravBizbRolly c504ef9
merge with main
SauravBizbRolly 7dbc8ee
merge with main
SauravBizbRolly e4717c8
merge with main
SauravBizbRolly c32fb6b
merge with main
SauravBizbRolly e73d1cc
Merge pull request #288 from PSMRI/release-3.6.0-develop
SauravBizbRolly 50e2313
fix: fix the session expiry issue (#286)
vanitha1822 bf2c62d
Merge branch 'release-3.5.0' of https://github.com/PSMRI/Common-API i…
5Amogh c181b2a
Content disposition modified signature (#287)
ravishanigarapu 5e39ca1
feat: amm-1337 platform feedback module
5Amogh d2f44b1
feat: amm-1337 entities updated based on change in DDL
5Amogh 54acf48
Merge pull request #289 from PSMRI/develop-amogh
5Amogh 4149b14
merge with main
SauravBizbRolly 1fca232
merge with main
SauravBizbRolly 896012c
merge with main
SauravBizbRolly 067cc02
Merge pull request #290 from toarunmishra/release-3.7.0
SauravBizbRolly ac39698
fix ben death param issue
SauravBizbRolly ce7fa31
fix ben death param issue
SauravBizbRolly e5d4234
fix strict-origin-when-cross-origin
SauravBizbRolly c4603b0
fix strict-origin-when-cross-origin
SauravBizbRolly 13aa4ba
fix strict-origin-when-cross-origin
SauravBizbRolly b14952b
fix strict-origin-when-cross-origin
SauravBizbRolly eba0f45
fix strict-origin-when-cross-origin
SauravBizbRolly 0dfad08
fix strict-origin-when-cross-origin
SauravBizbRolly 19ade96
fix: dev-linux issue fix
5Amogh 8635a02
fix: dev-linux issue fix (#291)
5Amogh d0dc555
fix strict-origin-when-cross-origin
SauravBizbRolly dddc108
fix strict-origin-when-cross-origin
SauravBizbRolly 0505d4e
fix: dev-linux issue fix
5Amogh ffdc20d
Merge pull request #292 from PSMRI/develop-amogh
5Amogh a97d332
fix: dev-linux issue fix
5Amogh 3686d5c
Merge pull request #293 from PSMRI/develop-amogh
5Amogh 70695b7
fix: dev-linux issue fix
5Amogh ae474a9
fix: dev-linux issue fix
5Amogh 53376cd
Merge pull request #294 from PSMRI/develop-amogh
5Amogh 9ffee16
Update pom.xml
5Amogh aa94a5a
Update pom.xml
5Amogh 6c00a6b
Update pom.xml
5Amogh f93e2f4
refresh token unauthorize issue (#296)
ravishanigarapu e5789f4
fix: missing env added
5Amogh ca036e6
Merge pull request #297 from PSMRI/rel-3.5.1-env-fix
5Amogh 7f6f4dc
Merge branch 'release-3.6.0' into release-3.5.1
5Amogh 3336300
Merge pull request #298 from PSMRI/release-3.5.1
5Amogh 435fb88
finding userId baserd on createdBy (#299)
ravishanigarapu 8fd476b
Nd/vs/fix ben (#300)
vanitha1822 18a3151
Merge branch 'release-3.6.0' into release-3.5.0
snehar-nd 7ec95be
Merge pull request #301 from PSMRI/release-3.5.0
snehar-nd 942ae41
fix: swagger env values made dynamic
5Amogh c822bbb
fix: swagger env values made dynamic
5Amogh 75d6fa0
fix: aam-1752 , fetch only active signature
snehar-nd cf2c838
Merge pull request #302 from PSMRI/sn/3.6
snehar-nd 57bdd89
Revert "fix: aam-1752 , fetch only active signature"
snehar-nd 3c3541d
Merge pull request #303 from PSMRI/revert-302-sn/3.6
snehar-nd 7bc8d71
fix: only get the Active signature
snehar-nd c072918
fix:active signature
vishwab1 eafd705
fix:exception handling
vishwab1 09000bd
fix:exception handling
vishwab1 772a9e0
fix strict-origin-when-cross-origin
SauravBizbRolly b1fccb9
Merge branch 'release-3.6.0' into sn/3.6
snehar-nd d7fefd6
Merge pull request #305 from PSMRI/sn/3.6
snehar-nd c581bf3
Merge remote-tracking branch 'upstream/release-3.6.0' into release-3.7.0
SauravBizbRolly 4604845
fix strict-origin-when-cross-origin
SauravBizbRolly 4b7cb37
fix strict-origin-when-cross-origin
SauravBizbRolly c668610
fix strict-origin-when-cross-origin
SauravBizbRolly 9324652
fix strict-origin-when-cross-origin
SauravBizbRolly 168291a
fix strict-origin-when-cross-origin
SauravBizbRolly 1121b75
fix strict-origin-when-cross-origin
SauravBizbRolly de6f6b2
fix: amm-1930 wasa-validation added for sms template api
5Amogh 19239f8
fix: amm-1931 JWT token reduced expiry timing
snehar-nd a38c33d
Merge pull request #309 from PSMRI/release-3.6.0
5Amogh cca9524
Merge pull request #310 from PSMRI/feature/sms-validation-3.6.0
5Amogh 8f4efa0
Merge pull request #311 from PSMRI/sn/wasa
snehar-nd ddee5bd
Bump version from 3.6.0 to 3.6.1
5Amogh e41a47e
fix: amm-1927 http options vulnerability fixed through cors
5Amogh 4081825
fix: amm 1927 implementing suggested code fixes by coderabbit
5Amogh 6112133
fix: amm 1927 removal of hardcoded localhost part
5Amogh 106515c
fix: amm 1927 removal of restrictive pattern for options & sticking R…
5Amogh 8a95694
fix: amm-1929 username and passwords are passed plain
snehar-nd a51d441
fix: amm-1929 removed hardcoded decrypted value
snehar-nd f453611
fix: internal url disclosure (#308)
vanitha1822 1d12209
Merge pull request #313 from PSMRI/sn/wasa
snehar-nd c6929cf
Merge pull request #312 from PSMRI/AMM-1927
5Amogh ba4da8f
Merge remote-tracking branch 'upstream/release-3.6.1' into release-3.7.0
SauravBizbRolly ca7bc2e
fix strict-origin-when-cross-origin
SauravBizbRolly 5b195cf
fix strict-origin-when-cross-origin
SauravBizbRolly e7828c2
fix strict-origin-when-cross-origin
SauravBizbRolly 543b022
add column in create BeneficiaryModel
SauravBizbRolly 19a5291
Add UAT domain to allowed CORS origins
SauravBizbRolly cb2ac7f
Update application.properties
SauravBizbRolly a49f09b
Remove CORS allowed origin from properties
SauravBizbRolly 948d72c
add column in create BeneficiaryModel
SauravBizbRolly be6843f
Merge remote-tracking branch 'upstream/release-3.7.0' into release-3.7.0
SauravBizbRolly 65d5b3b
add column in create BeneficiaryModel
SauravBizbRolly 03ee687
Merge pull request #314 from PSMRI/release-3.6.1
drtechie 50e2180
Merge pull request #315 from PSMRI/release-3.7.0
drtechie 44b8e84
Merge branch 'release-3.6.0-temp' into release-3.8.0
drtechie e614249
Merge pull request #316 from PSMRI/release-3.8.0
drtechie 1f63a40
fix: cors spell fixes and import of packages updates
5Amogh 289d6ca
Merge pull request #318 from PSMRI/amo-3.6
5Amogh df3f76d
fix: deployment issue fix
5Amogh deb6a33
feat: amm-1959 dhis token for cho report re-direction
5Amogh 565015c
Merge pull request #319 from PSMRI/amo-3.6
5Amogh 0fb2ea5
fix: beneficiary history on revisit (#320)
vanitha1822 b4d7cb0
fix: call type mapper (#322)
vishwab1 2b23cd6
Enable SMS Functionality in MMU App to Send Prescriptions (#325)
vishwab1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/main/java/com/iemr/common/config/firebase/FirebaseMessagingConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| package com.iemr.common.config.firebase; | ||
|
|
||
| import com.google.auth.oauth2.GoogleCredentials; | ||
| import com.google.firebase.FirebaseApp; | ||
| import com.google.firebase.FirebaseOptions; | ||
| import com.google.firebase.messaging.FirebaseMessaging; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.core.io.ClassPathResource; | ||
|
|
||
| import java.io.ByteArrayInputStream; | ||
| import java.io.FileInputStream; | ||
| import java.io.IOException; | ||
| import java.util.Base64; | ||
|
|
||
| @Configuration | ||
| public class FirebaseMessagingConfig { | ||
| private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName()); | ||
|
|
||
| @Value("${firebase.enabled:false}") | ||
| private boolean firebaseEnabled; | ||
|
|
||
| @Value("${firebase.credential-file:}") | ||
| private String firebaseCredentialFile; | ||
|
|
||
|
|
||
| @Bean | ||
| @ConditionalOnProperty(name = "firebase.enabled", havingValue = "true") | ||
| public FirebaseMessaging firebaseMessaging() throws IOException { | ||
| if (!firebaseEnabled) { | ||
| logger.error("⚠️ Firebase disabled by config"); | ||
| return null; | ||
| } | ||
|
|
||
| try { | ||
| if (firebaseCredentialFile == null || firebaseCredentialFile.isBlank()) { | ||
| logger.error("⚠️ No Firebase credentials path provided"); | ||
| return null; // don't throw, app will still start | ||
| } | ||
|
|
||
| GoogleCredentials credentials = GoogleCredentials.fromStream( | ||
| new ClassPathResource(firebaseCredentialFile).getInputStream() | ||
| ); | ||
| FirebaseOptions options = FirebaseOptions.builder() | ||
| .setCredentials(credentials) | ||
| .build(); | ||
|
|
||
| FirebaseApp firebaseApp = FirebaseApp.getApps().isEmpty() | ||
| ? FirebaseApp.initializeApp(options) | ||
| : FirebaseApp.getInstance(); | ||
|
|
||
| return FirebaseMessaging.getInstance(firebaseApp); | ||
|
|
||
| } catch (Exception e) { | ||
| logger.error("⚠️ Firebase init failed: " + e.getMessage()); | ||
| return null; // keep app running | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,3 +37,4 @@ public void execute() { | |
| } | ||
|
|
||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
...main/java/com/iemr/common/controller/beneficiaryConsent/BeneficiaryConsentController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| /* | ||
| * AMRIT – Accessible Medical Records via Integrated Technology | ||
| * Integrated EHR (Electronic Health Records) Solution | ||
| * | ||
| * Copyright (C) "Piramal Swasthya Management and Research Institute" | ||
| * | ||
| * This file is part of AMRIT. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see https://www.gnu.org/licenses/. | ||
| */ | ||
| package com.iemr.common.controller.beneficiaryConsent; | ||
|
|
||
| import com.iemr.common.data.beneficiaryConsent.BeneficiaryConsentRequest; | ||
| import com.iemr.common.service.beneficiaryOTPHandler.BeneficiaryOTPHandler; | ||
| import com.iemr.common.utils.mapper.InputMapper; | ||
| import com.iemr.common.utils.response.OutputResponse; | ||
| import io.lettuce.core.dynamic.annotation.Param; | ||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import jakarta.ws.rs.core.MediaType; | ||
| import org.json.JSONObject; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RequestMethod; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RequestMapping(value = { "/beneficiaryConsent" }) | ||
| @RestController | ||
| public class BeneficiaryConsentController { | ||
| final Logger logger = LoggerFactory.getLogger(this.getClass().getName()); | ||
|
|
||
| @Autowired | ||
| private BeneficiaryOTPHandler beneficiaryOTPHandler; | ||
|
|
||
| @Operation(summary = "Send Consent") | ||
| @RequestMapping(value = "/sendConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) | ||
| public String sendConsent(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) { | ||
|
|
||
| OutputResponse response = new OutputResponse(); | ||
|
|
||
| try { | ||
| BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class); | ||
|
|
||
| String success = beneficiaryOTPHandler.sendOTP(obj); // method name unchanged if internal logic still uses 'OTP' | ||
| logger.info(success.toString()); | ||
| response.setResponse(success); | ||
|
|
||
|
|
||
| } catch (Exception e) { | ||
| response.setError(500, "error : " + e); | ||
| } | ||
| return response.toString(); | ||
| } | ||
|
|
||
| @Operation(summary = "Validate Consent") | ||
| @RequestMapping(value = "/validateConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) | ||
| public String validateConsent(@Param(value = "{\"mobNo\":\"String\",\"otp\":\"Integer\"}") @RequestBody String requestOBJ) { | ||
|
|
||
| OutputResponse response = new OutputResponse(); | ||
|
|
||
| try { | ||
| BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class); | ||
|
|
||
| JSONObject responseOBJ = beneficiaryOTPHandler.validateOTP(obj); | ||
| if (responseOBJ != null) | ||
| response.setResponse(responseOBJ.toString()); | ||
| else | ||
| response.setError(500, "failure"); | ||
|
|
||
| } catch (Exception e) { | ||
| logger.error("error in validating Consent : " + e); | ||
| response.setError(500, "error : " + e); | ||
| } | ||
| return response.toString(); | ||
| } | ||
|
|
||
| @Operation(summary = "Resend Consent") | ||
| @RequestMapping(value = "/resendConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) | ||
| public String resendConsent(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) { | ||
| logger.info(requestOBJ.toString()); | ||
Check noticeCode scanning / SonarCloud Logging should not be vulnerable to injection attacks Low
Change this code to not log user-controlled data. See more on SonarQube Cloud
|
||
|
|
||
| OutputResponse response = new OutputResponse(); | ||
|
|
||
| try { | ||
| BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class); | ||
|
|
||
| String success = beneficiaryOTPHandler.resendOTP(obj); | ||
| logger.info(success.toString()); | ||
|
|
||
| if (success.contains("otp")) | ||
| response.setResponse(success); | ||
| else | ||
| response.setError(500, "failure"); | ||
|
|
||
| } catch (Exception e) { | ||
| logger.error("error in re-sending Consent : " + e); | ||
| response.setError(500, "error : " + e); | ||
| } | ||
| return response.toString(); | ||
| } | ||
|
|
||
|
|
||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
🌐 Web query:
Spring @Bean method return null BeanCreationException💡 Result:
Cause
How to fix (pick one)
References
🌐 Web query:
Spring @ConditionalOnProperty bean instantiation behavior💡 Result:
Summary — how @ConditionalOnProperty works and when beans are created:
The condition is evaluated at configuration time (when Spring processes configuration/auto-configuration). If the condition does NOT match, the bean definition is not registered (so the bean is not created). If it matches, the bean definition is registered and the bean is instantiated as usual during context initialization. [1][2]
Matching rules:
Class-level vs method-level:
Practical note: @ConditionalOnProperty simply prevents registration when the condition fails (it does not throw by default); other configuration and beans continue to be processed. [3]
Sources: Spring Boot API and reference docs for ConditionalOnProperty; community explanation. [1][2][3]
🏁 Script executed:
# First, let's examine the actual file to understand the context better cat -n src/main/java/com/iemr/common/config/firebase/FirebaseMessagingConfig.javaRepository: PSMRI/Common-API
Length of output: 2803
Remove
nullreturns from@Beanmethod; they causeBeanCreationExceptionSpring does not accept
nullfrom@Beanfactory methods—returningnulltriggers aBeanCreationExceptionduring startup. The current code returnsnullin three paths (lines 36, 42, 60), which will fail bean initialization and crash the application.Additionally, the
@ConditionalOnProperty(firebase.enabled)annotation already handles the enable/disable logic: iffirebase.enabled ≠ true, Spring skips bean registration entirely. The redundant check at line 34–36 is unnecessary.Replace
nullreturns with exceptions:firebaseEnabledcheck (the@ConditionalOnPropertyalready covers this).IllegalStateException("Firebase credentials path not configured")instead of returningnull.null; optionally wrap with context:throw new IllegalStateException("Firebase initialization failed", e).This ensures deterministic startup behaviour: either a valid bean is created, or startup fails with a clear error message pointing to the actual misconfiguration.
🤖 Prompt for AI Agents