API: add access policy management and source deny rules

This commit is contained in:
Alexey
2026-11-06 22:37:15 +03:00
parent af806d2f3d
commit b1d8f221d6
24 changed files with 1885 additions and 55 deletions
+2 -1
View File
@@ -36,6 +36,7 @@ use crate::transport::middle_proxy::MePool;
use crate::web::control::WebRuntimePublication;
use crate::web::trace::WebTraceStore;
mod access_policy;
mod config_edit;
mod config_projection;
mod config_state;
@@ -306,7 +307,7 @@ fn allowed_methods_for_path(path: &str) -> Option<&'static str> {
"/v1/system/reload" => Some(ALLOW_POST),
"/v1/config/validate" => Some(ALLOW_POST),
"/v1/users" => Some(ALLOW_GET_POST),
"/v1/config" => Some(ALLOW_GET_PATCH),
"/v1/config" | "/v1/access/policy" => Some(ALLOW_GET_PATCH),
_ if user_action_route_matches(path, "/reset-quota") => Some(ALLOW_POST),
_ if user_action_route_matches(path, "/rotate-secret") => Some(ALLOW_POST),
_ if user_action_route_matches(path, "/enable") => Some(ALLOW_POST),