-
Notifications
You must be signed in to change notification settings - Fork 1
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
BAH-2962_token | Created a script to run on sms-service startup. #9
Conversation
anubhavBeehyv
commented
Oct 11, 2023
- Created a script to run on sms-service startup.
- Script generate a private and public key and a token which will be sent to openmrs via mounting.
@mohan-13 maybe you want to check the entry point script? also the dockerfile. Should we use yum or use apt? |
apt was not found in the container ..while yum commands were working fine . |
Yup, amazoncorretto base images comes with yum as the package manager. So that should be fine. |
ResponseEntity authenticationResponse = authenticator.authenticate(cookie); | ||
if (authenticationResponse.getStatusCode().is2xxSuccessful()) | ||
public ResponseEntity sendSMS(@RequestBody SMSContract smsContract, @RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authorizationHeader) throws Exception { | ||
boolean isValidToken = false; |
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.
Shouldn't we leverage Spring Security config which would intercept every request and do authorisation? Adding it in controller may not be a scalable solution in future if we add one more endpoint. @angshu thoughts?
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.
Added spring security please review this again
# Conflicts: # src/main/java/org/bahmni/sms/web/config/SecurityConfig.java # src/main/java/org/bahmni/sms/web/config/TokenValidatorFilter.java
# Conflicts: # package/docker/generate_token.sh # src/main/java/org/bahmni/sms/web/SMSController.java # src/main/java/org/bahmni/sms/web/security/TokenValidator.java # src/test/java/org/bahmni/sms/web/SMSControllerTest.java