Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions server/src/handlers/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
web::resource("").route(
web::post()
.to(llm::make_llm_request)
.authorize(Action::Query),
.authorize(Action::QueryLLM),
),
);

Expand Down Expand Up @@ -263,7 +263,10 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
// GET "/readiness" ==> Readiness check as per https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes
.service(web::resource("/readiness").route(web::get().to(health_check::readiness)))
// GET "/about" ==> Returns information about instance
.service(web::resource("/about").route(web::get().to(about::about)))
.service(
web::resource("/about")
.route(web::get().to(about::about).authorize(Action::GetAbout)),
)
.service(
web::scope("/logstream")
.service(
Expand Down
10 changes: 10 additions & 0 deletions server/src/rbac/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pub enum Action {
DeleteUser,
PutRoles,
GetRole,
GetAbout,
QueryLLM,
All,
}

Expand Down Expand Up @@ -91,6 +93,8 @@ impl RoleBuilder {
Action::PutRoles => Permission::Unit(action),
Action::GetRole => Permission::Unit(action),
Action::DeleteUser => Permission::Unit(action),
Action::GetAbout => Permission::Unit(action),
Action::QueryLLM => Permission::Unit(action),
Action::All => Permission::Stream(action, self.stream.clone().unwrap()),
};
perms.push(perm);
Expand Down Expand Up @@ -155,6 +159,8 @@ pub mod model {
Action::PutRetention,
Action::PutAlert,
Action::GetAlert,
Action::GetAbout,
Action::QueryLLM,
],
stream: Some("*".to_string()),
tag: None,
Expand All @@ -172,6 +178,8 @@ pub mod model {
Action::GetRetention,
Action::PutAlert,
Action::GetAlert,
Action::GetAbout,
Action::QueryLLM,
],
stream: None,
tag: None,
Expand All @@ -187,6 +195,8 @@ pub mod model {
Action::GetStats,
Action::GetRetention,
Action::GetAlert,
Action::GetAbout,
Action::QueryLLM,
],
stream: None,
tag: None,
Expand Down