-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
base: main
Are you sure you want to change the base?
BugFix: Fixed query auth #1048
Conversation
Auth flow for query and permission assignment for `ListStream` changed
Pull Request Test Coverage Report for Build 12512483828Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - 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()))?; |
let res = CONFIG | ||
.storage() | ||
.get_object_store() | ||
.list_streams() | ||
.await | ||
.unwrap(); | ||
.unwrap() |
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.
.unwrap() | |
.unwrap() |
??
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
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: