Skip to content

Conversation

@ldematte
Copy link
Contributor

@ldematte ldematte commented Mar 6, 2025

While implementing #124111 I realized we do not have (currently) a way to write a IT test to ensure that "always allowed" actions can be performed even when there is no policy/no entitlement for them.
One example is access to specific, always allowed directories.

This PR adds a new IT test class to run tests for actions that should always be allowed.

@ldematte ldematte added >test Issues or PRs that are addressing/adding tests auto-backport Automatically create backport pull requests when merged v8.18.1 v8.19.0 v9.0.1 v9.1.0 :Core/Infra/Entitlements Entitlements infrastructure labels Mar 6, 2025
@ldematte ldematte requested a review from a team as a code owner March 6, 2025 11:25
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Mar 6, 2025
@ldematte ldematte requested a review from rjernst March 7, 2025 14:06
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.18
8.x
9.0
ldematte added a commit that referenced this pull request Mar 12, 2025
…ke 2) (#124429) Writing tests for #123861, turns out that #124195 is not enough. We really need new IT test cases for "always allowed" actions: in order to be sure they are allowed, we need to setup the plugin with no policy. This PR adds test cases for that, plus the support for writing test functions that accept one Environment parameter: many test paths we test and allow/deny are relative to paths in Environment, so it's useful to have access to it (see readAccessConfigDirectory as an example)
ldematte added a commit to ldematte/elasticsearch that referenced this pull request Mar 12, 2025
…ke 2) (elastic#124429) Writing tests for elastic#123861, turns out that elastic#124195 is not enough. We really need new IT test cases for "always allowed" actions: in order to be sure they are allowed, we need to setup the plugin with no policy. This PR adds test cases for that, plus the support for writing test functions that accept one Environment parameter: many test paths we test and allow/deny are relative to paths in Environment, so it's useful to have access to it (see readAccessConfigDirectory as an example)
elasticsearchmachine pushed a commit that referenced this pull request Mar 12, 2025
…ke 2) (#124429) (#124627) Writing tests for #123861, turns out that #124195 is not enough. We really need new IT test cases for "always allowed" actions: in order to be sure they are allowed, we need to setup the plugin with no policy. This PR adds test cases for that, plus the support for writing test functions that accept one Environment parameter: many test paths we test and allow/deny are relative to paths in Environment, so it's useful to have access to it (see readAccessConfigDirectory as an example)
ldematte added a commit to ldematte/elasticsearch that referenced this pull request Mar 13, 2025
…ke 2) (elastic#124429) Writing tests for elastic#123861, turns out that elastic#124195 is not enough. We really need new IT test cases for "always allowed" actions: in order to be sure they are allowed, we need to setup the plugin with no policy. This PR adds test cases for that, plus the support for writing test functions that accept one Environment parameter: many test paths we test and allow/deny are relative to paths in Environment, so it's useful to have access to it (see readAccessConfigDirectory as an example)
ldematte added a commit to ldematte/elasticsearch that referenced this pull request Mar 13, 2025
…ke 2) (elastic#124429) Writing tests for elastic#123861, turns out that elastic#124195 is not enough. We really need new IT test cases for "always allowed" actions: in order to be sure they are allowed, we need to setup the plugin with no policy. This PR adds test cases for that, plus the support for writing test functions that accept one Environment parameter: many test paths we test and allow/deny are relative to paths in Environment, so it's useful to have access to it (see readAccessConfigDirectory as an example)
elasticsearchmachine pushed a commit that referenced this pull request Mar 13, 2025
…ke 2) (#124429) (#124703) Writing tests for #123861, turns out that #124195 is not enough. We really need new IT test cases for "always allowed" actions: in order to be sure they are allowed, we need to setup the plugin with no policy. This PR adds test cases for that, plus the support for writing test functions that accept one Environment parameter: many test paths we test and allow/deny are relative to paths in Environment, so it's useful to have access to it (see readAccessConfigDirectory as an example)
elasticsearchmachine pushed a commit that referenced this pull request Mar 13, 2025
…ke 2) (#124429) (#124704) Writing tests for #123861, turns out that #124195 is not enough. We really need new IT test cases for "always allowed" actions: in order to be sure they are allowed, we need to setup the plugin with no policy. This PR adds test cases for that, plus the support for writing test functions that accept one Environment parameter: many test paths we test and allow/deny are relative to paths in Environment, so it's useful to have access to it (see readAccessConfigDirectory as an example)
albertzaharovits pushed a commit to albertzaharovits/elasticsearch that referenced this pull request Mar 13, 2025
…ke 2) (elastic#124429) Writing tests for elastic#123861, turns out that elastic#124195 is not enough. We really need new IT test cases for "always allowed" actions: in order to be sure they are allowed, we need to setup the plugin with no policy. This PR adds test cases for that, plus the support for writing test functions that accept one Environment parameter: many test paths we test and allow/deny are relative to paths in Environment, so it's useful to have access to it (see readAccessConfigDirectory as an example)
jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request Mar 13, 2025
…ke 2) (elastic#124429) Writing tests for elastic#123861, turns out that elastic#124195 is not enough. We really need new IT test cases for "always allowed" actions: in order to be sure they are allowed, we need to setup the plugin with no policy. This PR adds test cases for that, plus the support for writing test functions that accept one Environment parameter: many test paths we test and allow/deny are relative to paths in Environment, so it's useful to have access to it (see readAccessConfigDirectory as an example)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged :Core/Infra/Entitlements Entitlements infrastructure Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests v8.18.1 v8.19.0 v9.0.1 v9.1.0

3 participants