-
Notifications
You must be signed in to change notification settings - Fork 80
Bulk destroy notifications #184
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
base: master
Are you sure you want to change the base?
Conversation
Add ability to bulk delete notifications with filtering options. Includes: - New API endpoint for bulk destroy - Controller support and route updates - Target model bulk destroy methods - Supporting views and JavaScript handlers
Resolves #172 |
To provide feedback, navigate to the Files changed tab and leave comments on the proposed code changes. Choose Start review for each comment, and then choose Request changes, and I'll propose revised changes. |
⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done |
@@ -5,7 +5,7 @@ class NotificationsApiController < NotificationsController | |||
include Swagger::NotificationsApi | |||
# Include CommonApiController to select target and define common methods | |||
include CommonApiController | |||
protect_from_forgery except: [:open_all] | |||
protect_from_forgery except: [:open_all, :bulk_destroy] |
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.
Warning
Description: The protect_from_forgery exception for :open_all and :bulk_destroy actions may expose the application to CSRF attacks. Consider implementing alternative CSRF protection for these actions, such as using API tokens or session-based authentication.
Severity: High
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.
The fix addresses the CSRF vulnerability by adding a TODO comment to implement alternative CSRF protection for the :open_all and :bulk_destroy actions. This is an incomplete fix as it doesn't provide the actual implementation. To complete the fix, the developer should implement API token authentication or session-based authentication for these actions, ensuring that only authorized requests can perform these operations.
protect_from_forgery except: [:open_all, :bulk_destroy] | |
include Swagger::NotificationsApi | |
# Include CommonApiController to select target and define common methods | |
include CommonApiController | |
# TODO: Implement alternative CSRF protection for :open_all and :bulk_destroy actions | |
protect_from_forgery except: [:open_all, :bulk_destroy] | |
rescue_from ActivityNotification::NotifiableNotFoundError, with: :render_notifiable_not_found |
✅ I finished the code review, and left comments with the issues I found. I will now generate code fix suggestions. |
⏳ I'm generating code changes based on the pipeline. I'll update this pull request when I'm done. |
|
1 similar comment
|
🔴 I couldn't create a revision for this pull request. |
@@ -589,5 +589,122 @@ | |||
end | |||
end | |||
end | |||
describe "DELETE #bulk_destroy" do |
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.
Add end to this line. This file includes syntax error.
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.
Fix the syntax error for testing.
This pull request adds bulk deletion functionality for notifications in an activity notification system. The key changes include:
bulk_destroy
endpoint for deleting multiple notifications at onceThis change improves efficiency by allowing batch deletion of notifications instead of requiring individual deletion operations.