Implement DocRequest on notification config and alerting request classes#980
Conversation
PR Reviewer Guide 🔍(Review updated until commit 260fa4f)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 260fa4f Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 6d67985
Suggestions up to commit 6a86018
Suggestions up to commit b1d4440
Suggestions up to commit 2876330
Suggestions up to commit 9de6440
|
Enables the security plugin's ResourceAccessEvaluator to automatically intercept and authorize GET, UPDATE, DELETE operations on protected notification_config resources at the transport layer. - GetNotificationConfigRequest: returns id() for single-ID requests, null for search/multi-ID (DLS handles those) - UpdateNotificationConfigRequest: returns configId - DeleteNotificationConfigRequest: returns id() for single-ID deletes, null for multi-ID - Added CONFIG_INDEX_NAME constant to NotificationConstants Note: CreateNotificationConfigRequest is NOT marked as DocRequest since create operations don't access existing resources — the security plugin's ResourceIndexListener handles ownership registration automatically on index write. Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
3785c80 to
9de6440
Compare
|
Persistent review updated to latest commit 9de6440 |
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit b1d4440.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Persistent review updated to latest commit 2876330 |
2876330 to
b1d4440
Compare
|
Persistent review updated to latest commit b1d4440 |
b1d4440 to
6a86018
Compare
|
Persistent review updated to latest commit 6a86018 |
Enables the security plugin's ResourceAccessEvaluator to automatically intercept and authorize operations on protected resources at the transport layer. Notifications: - GetNotificationConfigRequest: implements DocRequest with id() for single-ID requests, null for search/multi-ID (DLS handles those) - UpdateNotificationConfigRequest: implements DocRequest with configId - DeleteNotificationConfigRequest: implements DocRequest with id() for single-ID deletes, null for multi-ID - All override type() to return "notification_config" - Added CONFIG_INDEX_NAME and CONFIG_RESOURCE_TYPE constants Alerting: - DocRequest implemented on Get, Delete, Index, and Acknowledge request classes for monitors, workflows, comments, alerts, and findings Note: Create requests that generate new resources (without accessing existing ones) do NOT implement DocRequest. Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
6a86018 to
6d67985
Compare
|
Persistent review updated to latest commit 6d67985 |
- DeleteMonitorRequest, DeleteWorkflowRequest, DocLevelMonitorFanOutRequest: point at SCHEDULED_JOBS_INDEX (where monitors/workflows live) rather than the alerts index pattern. The previous mapping would make the security plugin's ActionFilter look up the resource in the wrong index and fail to gate access. - IndexCommentRequest: replace TODO stubs with the comments index and the (possibly-blank) commentId, matching DeleteCommentRequest. Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
|
Persistent review updated to latest commit 260fa4f |
Description
Implements
DocRequeston notification-config and alerting request classes so the security plugin'sResourceAccessEvaluatorcan automatically intercept and authorize direct-access operations (GET, UPDATE, DELETE, ACK) on protected resources at the transport layer.Companion PRs:
Notifications changes
GetNotificationConfigRequest— returnsid()for single-ID requests,nullfor search/multi-ID (DLS handles those).UpdateNotificationConfigRequest— returnsconfigId.DeleteNotificationConfigRequest— returnsid()for single-ID deletes,nullfor multi-ID.CreateNotificationConfigRequest— returnsconfigId(may be null for auto-generated IDs).CONFIG_INDEX_NAMEconstant toNotificationConstants.Alerting changes
Adds
DocRequestto the alerting request classes whose transport actions target a registered resource (`monitor`) or a subordinate of one (alerts/findings/comments).Primary resource operations — index/id point at the resource itself:
Subordinate operations — index/id point at the parent resource so the ActionFilter gates access transitively:
Comment operations — index/id point at the comment itself; alerting still gates transitively via the underlying alert fetch:
Also introduces `AlertingConstants` with `ALL_ALERT_INDEX_PATTERN` and `ALL_COMMENTS_INDEX_PATTERN` for shared reuse.
Related Issues
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.