-
-
Notifications
You must be signed in to change notification settings - Fork 149
BugFix: Fixed query auth #1048
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
BugFix: Fixed query auth #1048
Conversation
Pull Request Test Coverage Report for Build 12629435832Details
💛 - Coveralls |
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.
fix is validated, @de-sh please review the code once
//list all streams from storage | ||
pub async fn list(req: HttpRequest) -> Result<impl Responder, StreamError> { | ||
let key = extract_session_key_from_req(&req) | ||
.map_err(|err| StreamError::Anyhow(anyhow::Error::msg(err.to_string())))?; |
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.
.map_err(|err| StreamError::Anyhow(anyhow::Error::msg(err.to_string())))?; | |
.map_err(|err| anyhow::Error::msg(err.to_string()))?; |
src/handlers/http/query.rs
Outdated
authorized = true; | ||
if let Some(tag) = tag { | ||
tags.push(tag) | ||
for table_name in tables.iter() { |
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.
I'd suggest reverting changes here and moving it to the call site
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.
e.g:
for stream_name in streams {
authorize_and_set_filter_tags(&mut query, &permissions, &stream_name).map_err(
|_| Status::permission_denied("User Does not have permission to access this"),
)?;
}
Auth flow for query and permission assignment for `ListStream` changed
fd3f204
to
f59cc8a
Compare
631e5b4
to
fa5d46f
Compare
…rseablehq#1048) --------- Co-authored-by: Nikhil Sinha <[email protected]>
Auth flow for query and permission assignment for
ListStream
changedFixes #XXXX.
Description
This PR fixes a flaw in the auth flow for the
query
APIIt also changes the Permission for the action
ListStream
fromUnit
toStream
which will limit the response of the API to only the streams that the user is allowed to seeThis PR has: