Skip to content

Conversation

@rjernst
Copy link
Member

@rjernst rjernst commented Feb 28, 2025

Urls may make the FileAccessTree invalid. This commit removes the flag for filtering urls, instead always filtering them.

Urls may make the FileAccessTree invalid. This commit removes the flag
for filtering urls, instead always filtering them.
@rjernst rjernst added >refactoring 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 Feb 28, 2025
@rjernst rjernst requested a review from a team as a code owner February 28, 2025 15:10
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Feb 28, 2025
@elasticsearchmachine
Copy link
Collaborator

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

if (ignoreUrl) {
result = result.filter(s -> s.toLowerCase(Locale.ROOT).startsWith("https://") == false);
}
result = result.filter(s -> s.toLowerCase(Locale.ROOT).startsWith("https://") == false);
Copy link
Contributor

Choose a reason for hiding this comment

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

We can't rely on all setting rejecting http, right? Shouldn't we make sure to exclude such urls as well, so we keep the filtetree clean?

Copy link
Contributor

@ldematte ldematte left a comment

Choose a reason for hiding this comment

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

Looks good to me, one Q about removing different kind of URLs

Optional: would it make sense to have one or more tests that exercise resolvePaths?
Either calling it directly, or indirectly via a FileAccessTree test?

if (ignoreUrl) {
result = result.filter(s -> s.toLowerCase(Locale.ROOT).startsWith("https://") == false);
}
result = result.filter(s -> s.toLowerCase(Locale.ROOT).startsWith("https://") == false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we ignore all URLs? http://, ftp:// (if we even allow that thing).
Even file:// if passed down to FileAccessTree as is would make a mess of the path sting.

@rjernst
Copy link
Member Author

rjernst commented Feb 28, 2025

I agree we should be filtering all urls, but identifying arbitrary urls becomes much more complex. Right now these settings only support https, and they fail otherwise. Can we leave that as a followup? This PR is removing the ignoreUrl property, not changing the behavior of how we ignore urls.

Copy link
Contributor

@ldematte ldematte left a comment

Choose a reason for hiding this comment

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

OK to leave other URLs as a follow up

@rjernst rjernst enabled auto-merge (squash) March 2, 2025 18:17
@rjernst rjernst merged commit eace6a1 into elastic:main Mar 2, 2025
16 of 17 checks passed
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Mar 2, 2025
Urls may make the FileAccessTree invalid. This commit removes the flag
for filtering urls, instead always filtering them.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Mar 2, 2025
Urls may make the FileAccessTree invalid. This commit removes the flag
for filtering urls, instead always filtering them.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.18
8.x
9.0

rjernst added a commit to rjernst/elasticsearch that referenced this pull request Mar 2, 2025
Urls may make the FileAccessTree invalid. This commit removes the flag
for filtering urls, instead always filtering them.
elasticsearchmachine pushed a commit that referenced this pull request Mar 2, 2025
Urls may make the FileAccessTree invalid. This commit removes the flag
for filtering urls, instead always filtering them.
elasticsearchmachine pushed a commit that referenced this pull request Mar 2, 2025
Urls may make the FileAccessTree invalid. This commit removes the flag
for filtering urls, instead always filtering them.
elasticsearchmachine pushed a commit that referenced this pull request Mar 4, 2025
Urls may make the FileAccessTree invalid. This commit removes the flag
for filtering urls, instead always filtering them.

Co-authored-by: Elastic Machine <[email protected]>
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 >refactoring Team:Core/Infra Meta label for core/infra team v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants