-
-
Notifications
You must be signed in to change notification settings - Fork 147
update list filters to support save view in prism #1343
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
update list filters to support save view in prism #1343
Conversation
WalkthroughThe filtering logic in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Filters
participant Auth
User->>Filters: list_filters()
loop For each filter
Filters->>Filters: Get filter_query (default to "")
alt filter.type == SQL
Filters->>Auth: user_auth_for_query(query)
else filter.type == Search or Filter
Filters->>Auth: user_auth_for_datasets(dataset, permissions)
end
end
Filters-->>User: Return authorized filters
Possibly related PRs
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (10)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/users/filters.rs (2)
192-195
: Comment now contradicts the implementationThe comment still describes the old authorization split (SQL | Filter vs Search).
After the logic change (SQL
→ query-based;Search
/Filter
→ dataset-based) the comment is misleading and will confuse maintainers.Please update or remove these lines.
199-205
: Avoid per-item permission look-ups
Users.get_permissions(key)
is invoked inside the loop for every non-SQL filter.
Ifget_permissions
performs any I/O or locking, this can become an unnecessary hotspot.- for f in read.iter() { + let permissions = Users.get_permissions(key); + for f in read.iter() { ... - } else if *filter_type == FilterType::Search || *filter_type == FilterType::Filter { - let dataset_name = &f.stream_name; - let permissions = Users.get_permissions(key); + } else if *filter_type == FilterType::Search || *filter_type == FilterType::Filter { + let dataset_name = &f.stream_name; if user_auth_for_datasets(&permissions, &[dataset_name.to_string()]).is_ok() {This keeps the hot path lock-free and marginally improves throughput.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/users/filters.rs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: Build Default aarch64-apple-darwin
- GitHub Check: Build Default x86_64-pc-windows-msvc
- GitHub Check: Build Default x86_64-apple-darwin
- GitHub Check: Build Default x86_64-unknown-linux-gnu
- GitHub Check: Build Kafka aarch64-apple-darwin
- GitHub Check: Build Default aarch64-unknown-linux-gnu
- GitHub Check: Build Kafka x86_64-unknown-linux-gnu
- GitHub Check: coverage
- GitHub Check: Quest Smoke and Load Tests for Standalone deployments
- GitHub Check: Quest Smoke and Load Tests for Distributed deployments
do not skip if query string is empty update user access to the dataset instead of query string for filters
e51f791
to
2ec90d7
Compare
do not skip if query string is empty
update user access to the dataset instead of query string for filters
Summary by CodeRabbit
Bug Fixes
Refactor