Skip to content
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

Merged
merged 10 commits into from
Nov 21, 2023

Conversation

anubhavBeehyv
Copy link

  • 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.

@angshu
Copy link
Member

angshu commented Oct 12, 2023

@mohan-13 maybe you want to check the entry point script? also the dockerfile. Should we use yum or use apt?

@anubhavBeehyv
Copy link
Author

@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 .

@mohan-13
Copy link
Member

@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;
Copy link
Member

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?

Copy link
Author

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

atishbeehyv123 and others added 2 commits November 20, 2023 16:59
# 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
@rahu1ramesh rahu1ramesh merged commit 2a86a8f into master Nov 21, 2023
2 checks passed
@rahu1ramesh rahu1ramesh deleted the BAH-2962-token branch November 21, 2023 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants