Conversation
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
fynmanoj
left a comment
There was a problem hiding this comment.
None of the test cases are verifying the callback.
|
|
||
| @Value("${messageGateway.endpoint.email}") | ||
| private String mgMail; | ||
| @Value("${spring.mail.host}") |
There was a problem hiding this comment.
why do we need to use 'spring' here
| with: | ||
| security_control: registry.jit.io/control-semgrep-alpine:latest | ||
|
|
There was a problem hiding this comment.
looks like there are lots of formatting changes, you can remove this from this PR
| @@ -0,0 +1 @@ | |||
|
|
|||
| endpoint: | ||
| email: "/emails" | ||
|
|
||
| spring: |
There was a problem hiding this comment.
you can ignore this level: spring. we don't need unless we cant avoid it
| smtp: | ||
| auth: false | ||
| starttls: | ||
| enable: false No newline at end of file |
There was a problem hiding this comment.
google smtp requies TLS. can we test this with TLS for more compatibility?
| Scenario: Sending an email to the recipient with failure in callback | ||
| Given I can inject MockServer | ||
| And I can start mock server | ||
| And I can register the stub with "/sendMail" endpoint for "POST" request with status of 200 |
There was a problem hiding this comment.
All tests with same callback URL may cause issues like it use to cause before. use unique strings and add a check based on URL
| And I have tenant as "paymentBB2" | ||
| And I generate clientCorrelationId | ||
| When I send an email to the following recipients with subject "Test Email" and body "This is a test email" with callbackurl as "/sendMail" and get 202 | ||
| | recipient1@example.com | |
There was a problem hiding this comment.
move subject and body to this datatable
| rootNode = request.getRequest().getBodyAsString(); | ||
| logger.info("Rootnode value:" + rootNode); | ||
| assertThat(rootNode | ||
| .contains("Email could not be sent to [recipient1@example.com] because of Mail server connection failed")) |
There was a problem hiding this comment.
already mentioned in other PR, The error request body is not proper.
the message should be in sentence case
| if (!(request.getRequest().getBodyAsString()).isEmpty() && request.getRequest().getUrl().equals("/sendMail")) { | ||
| String rootNode = null; | ||
| rootNode = request.getRequest().getBodyAsString(); | ||
| logger.info("Rootnode value:" + rootNode); |
There was a problem hiding this comment.
donot use + for concatenating log statements
| And the email service is running | ||
| And I have tenant as "paymentBB2" | ||
| And I generate clientCorrelationId | ||
| When I send an email to the following recipients with subject "Test Email" and body "This is a test email" with callbackurl as "/sendMail" and get 202 |
There was a problem hiding this comment.
None of the test cases are verifying the callback.
Description
The Tc design is done based on greenmail mock
[].Format:
[jira_ticket] descriptionex: [phee-123] PR title.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Followed the PR title naming convention mentioned above.
Acknowledge that we will not merge PRs that are not passing the checks ("green") - it is your (author's) responsibility to get a proposed PR to pass all the checks, not primarily the project's maintainers.
The PR title should include a JIRA ticket
Design-related bullet points or design document links related to this PR added in the description above.
Updated corresponding Postman Collection or API documentation for the changes in this PR.
Create/update unit or integration tests for verifying the changes made.
Add required Swagger annotation and update API documentation with details of any API changes if applicable
Followed the naming conventions as given in https://docs.google.com/document/d/1Q4vaMSzrTxxh9TS0RILuNkSkYCxotuYk1Xe0CMIkkCU/edit?usp=sharing
Followed coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
FYI our guidelines for code reviews same as https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.