ref(search): Add EAP API attribute visibility checks#116091
Open
nsdeschenes wants to merge 6 commits into
Open
ref(search): Add EAP API attribute visibility checks#116091nsdeschenes wants to merge 6 commits into
nsdeschenes wants to merge 6 commits into
Conversation
Add a shared helper for hiding internal Sentry convention attributes from API surfaces and let SearchResolver track attributes hidden by API visibility configuration. This keeps default resolver behavior unchanged unless an API caller opts into visibility enforcement.
This was referenced May 22, 2026
The `as ATTRIBUTE_METADATA` pattern tells mypy this is an intentional re-export, fixing the attr-defined errors in tests that access it via `eap_utils.ATTRIBUTE_METADATA`.
|
|
||
| if column_definition: | ||
| if self.config.api_attribute_visibility_item_type is not None: | ||
| from sentry.search.eap.utils import can_expose_attribute_to_api |
Contributor
There was a problem hiding this comment.
Any specific reason why we import this here and not at the top? Unless it otherwise leads to a circular import, I think we should move it to the top
Contributor
Author
There was a problem hiding this comment.
i tried this out, seems to have broken many things 😬
Contributor
adrianviquez
left a comment
There was a problem hiding this comment.
Couple of comments, lmk what you think and can take a 2nd look!
The candidates set already prevents duplicates since we check `replacement not in candidates` before adding to pending.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1c0058e. Configure here.
Reverts the import move to avoid a circular import risk between resolver and utils modules.
When public_alias_override is set (e.g. equation resolution), the column_definition.public_alias becomes a synthetic label like "equation|…" which can_expose_attribute_to_api cannot evaluate against conventions, prefixes, or mappings.
adrianviquez
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The goal of this PR is to lie down the foundational work of removing/hiding internal attributes from non-staff/non-super-user requests.
To determine if an attribute should be hidden or not, we pull that information from the Sentry conventions package from the
visibilityfield from attribute metadata.These changes are limited to the eap search resolver, as such this PR does not doing any enforcement of these attributes, that will come in follow up PRs. As well, this PR adds in some tests.