Skip to content

Add ignore_url for setting based files entitlement #123541

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

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Feb 26, 2025

File entitlements which read a setting may actually contain urls. This commit adds an optional ignore_url property for the entitlement to skip any values which are urls.

File entitlements which read a setting may actually contain urls. This
commit adds an optional `ignore_url` property for the entitlement to
skip any values which are urls.
@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 26, 2025
@rjernst rjernst requested a review from a team as a code owner February 26, 2025 19:09
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Feb 26, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@jdconrad jdconrad left a comment

Choose a reason for hiding this comment

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

LGTM

}
String path = pathLookup.settingResolver().apply(setting);
return path == null ? Stream.of() : Stream.of(Path.of(path));
return result.map(Path::of);
Copy link
Contributor

Choose a reason for hiding this comment

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

In what scenario would it make sense to not use ignore_url in a file entitlement? Wouldn't calling Path.of() explode on such a value if it weren't filtered out? Should this behavior be the default?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it would explode. But we don't support urls in all settings? These are very specific settings that allow a url to be present. I don't want to add leniency generally to all file settings.

@rjernst rjernst merged commit cee43fd into elastic:main Feb 26, 2025
17 checks passed
@rjernst rjernst deleted the entitlements/setting_url branch February 26, 2025 20:41
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Feb 26, 2025
File entitlements which read a setting may actually contain urls. This
commit adds an optional `ignore_url` property for the entitlement to
skip any values which are urls.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Feb 26, 2025
File entitlements which read a setting may actually contain urls. This
commit adds an optional `ignore_url` property for the entitlement to
skip any values which are urls.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Feb 26, 2025
File entitlements which read a setting may actually contain urls. This
commit adds an optional `ignore_url` property for the entitlement to
skip any values which are urls.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.18
8.x
9.0

elasticsearchmachine pushed a commit that referenced this pull request Feb 26, 2025
File entitlements which read a setting may actually contain urls. This
commit adds an optional `ignore_url` property for the entitlement to
skip any values which are urls.
elasticsearchmachine pushed a commit that referenced this pull request Feb 26, 2025
File entitlements which read a setting may actually contain urls. This
commit adds an optional `ignore_url` property for the entitlement to
skip any values which are urls.
elasticsearchmachine pushed a commit that referenced this pull request Feb 26, 2025
File entitlements which read a setting may actually contain urls. This
commit adds an optional `ignore_url` property for the entitlement to
skip any values which are urls.
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