Skip to content

Resolve the gating resource id through a provider hook #6529

Description

@DarshitChanpura

The evaluator gates a request using the id and type that the request itself reports (ResourceAccessEvaluator.java:83). When the resource governing access is not the one named in the request, the plugin has to perform the check by hand.

alerting's alert comments are the case: an update or delete carries the comment id, and the monitor that governs access is known only after reading the comment or the alert, so TransportIndexAlertingCommentAction calls verifyAccess(monitorId, "monitor", action) itself.

evaluateAsync is already asynchronous, so a provider-supplied resolver from request to (type, id) could perform that lookup inside the framework and produce the 403 before the transport action runs.

This relocates the lookup rather than eliminating it. The gain is a uniform deny path that plugins no longer own.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestuntriagedRequire the attention of the repository maintainers and may need to be prioritized

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions