feat: notify users about security setting changes#448
feat: notify users about security setting changes#448davideluque wants to merge 7 commits intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the application's security posture by introducing automated email notifications for critical changes to a user's security settings. Users will now receive immediate alerts when their TOTP status changes or recovery codes are regenerated, and when passkeys are added or removed, providing an important layer of awareness and protection against unauthorized account modifications. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces an important security feature: notifying users via email about changes to their security settings, such as TOTP and passkey modifications. The implementation correctly uses a queued job for sending emails, preventing request blocking and improving resilience. The changes are well-structured, include comprehensive functional tests, and update the project documentation. I have one suggestion to improve the maintainability of the new mailer component.
|
@copilot review |
|
@davideluque I've opened a new pull request, #449, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable security feature by notifying users of changes to their security settings, such as TOTP and passkey modifications. The implementation is well-structured, utilizing a dedicated mailer and service for queuing notifications. The changes are accompanied by thorough documentation and test coverage. My review focuses on simplifying the test setup by removing redundant code and leveraging the global test configuration, which will improve maintainability.
8646da0 to
a53bc18
Compare
| @@ -1,8 +1,15 @@ | |||
| import env from '#start/env' | |||
There was a problem hiding this comment.
I am in doubt if the changes made to this file are necessary.
| @@ -27,6 +27,8 @@ export const schema = { | |||
| SMTP_PORT: Env.schema.number.optional(), | |||
There was a problem hiding this comment.
| @@ -0,0 +1,38 @@ | |||
| import { test } from '@japa/runner' | |||
There was a problem hiding this comment.
Did we not include the happy path here because it is tested in the other tests? What happens if the other tests are removed? Does the service become untested? I see it can be DRY to test the happy path in other tests, so we avoid testing the same path many times. At the same time, I am in doubt about the benefit when this service is isolated. Of course, this is not a super complex feature, so it might be okay to leave this service untested if the other tests are removed, but I still want to clear up my doubts.
| @@ -0,0 +1,51 @@ | |||
| import { test } from '@japa/runner' | |||
There was a problem hiding this comment.
Same question as in: https://github.com/abtion/adonisjs-template/pull/448/changes#r2941373940
| @@ -2,93 +2,112 @@ import { withGlobalTransaction } from '#services/db' | |||
| import { createUser } from '#tests/support/factories/user' | |||
There was a problem hiding this comment.
Look into how we do mail stubbing in DMG and compare the two
Summary
Testing