Skip to content

Commit 37ec1f2

Browse files
committed
added rbac, modified listing of streams
1 parent ed4c1e0 commit 37ec1f2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/handlers/http/modal/server.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ impl Server {
167167
pub fn get_prism_logstream() -> Scope {
168168
web::scope("/logstream").service(
169169
web::scope("/{logstream}").service(
170-
web::resource("/info").route(web::get().to(http::prism_logstream::get_info)),
170+
web::resource("/info").route(
171+
web::get()
172+
.to(http::prism_logstream::get_info)
173+
.authorize_for_stream(Action::GetStreamInfo),
174+
),
171175
),
172176
)
173177
}

src/prism/home/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,18 @@ pub async fn generate_home_response(key: &SessionKey) -> Result<HomeResponse, Pr
7777

7878
// get all stream titles
7979
let stream_titles: Vec<String> = PARSEABLE
80-
.streams
81-
.list()
80+
.storage
81+
.get_object_store()
82+
.list_streams()
83+
.await
84+
.unwrap()
8285
.into_iter()
8386
.filter(|logstream| {
8487
Users.authorize(key.clone(), Action::ListStream, Some(logstream), None)
8588
== crate::rbac::Response::Authorized
8689
})
87-
.collect();
90+
.sorted()
91+
.collect_vec();
8892

8993
// get all alert IDs (TODO: RBAC)
9094
// do we need to move alerts into the PARSEABLE struct?

0 commit comments

Comments
 (0)