/home/runner/work/tenet/tenet/tenet-aws/src/services/mcp/handlers/tools_auth.rs
Line | Count | Source |
1 | | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
2 | | pub(super) enum ToolAuthScope { |
3 | | Org(crate::authz::Action), |
4 | | Project(crate::authz::Action), |
5 | | } |
6 | | |
7 | 1.60k | pub(super) fn tool_auth_scope_for_name(name: &str) -> Option<ToolAuthScope> { |
8 | | use crate::authz::Action::{ |
9 | | AdminOrg, AdminProject, ReadOrg, ReadProject, WriteOrg, WriteProject, |
10 | | }; |
11 | | use ToolAuthScope::{Org, Project}; |
12 | | |
13 | 1.60k | match name { |
14 | 1.60k | "create_actor" |
15 | 1.58k | | "create_component" |
16 | 1.56k | | "create_connection" |
17 | 1.53k | | "create_container" |
18 | 1.51k | | "create_external_system" |
19 | 1.48k | | "create_quality_attribute" |
20 | 1.46k | | "create_skill" |
21 | 1.44k | | "create_spec" |
22 | 1.41k | | "create_store" |
23 | 1.39k | | "create_task" |
24 | 1.36k | | "import_skill" |
25 | 1.34k | | "link_actor_to_component" |
26 | 1.32k | | "link_quality_to_component" |
27 | 1.29k | | "link_spec" |
28 | 1.27k | | "link_skill_to_component" |
29 | 1.24k | | "link_task" |
30 | 1.22k | | "reimport_skill" |
31 | 1.20k | | "reset_graph_layout" |
32 | 1.17k | | "unlink_actor_from_component" |
33 | 1.15k | | "unlink_quality_from_component" |
34 | 1.12k | | "unlink_spec" |
35 | 1.10k | | "unlink_skill_from_component" |
36 | 1.08k | | "unlink_task" |
37 | 1.05k | | "update_actor" |
38 | 1.03k | | "update_component" |
39 | 1.00k | | "update_container" |
40 | 984 | | "update_external_system" |
41 | 960 | | "update_graph_layout" |
42 | 936 | | "update_quality_attribute" |
43 | 912 | | "update_skill" |
44 | 888 | | "update_spec" |
45 | 864 | | "update_task" |
46 | 840 | | "update_store" => Some(Project(WriteProject))792 , |
47 | 816 | "delete_actor" |
48 | 792 | | "delete_component" |
49 | 768 | | "delete_container" |
50 | 744 | | "delete_external_system" |
51 | 720 | | "delete_quality_attribute" |
52 | 696 | | "delete_skill" |
53 | 672 | | "delete_spec" |
54 | 648 | | "delete_task" |
55 | 624 | | "delete_store" => Some(Project(AdminProject))216 , |
56 | 600 | "get_actor" |
57 | 576 | | "get_component" |
58 | 552 | | "get_container" |
59 | 528 | | "get_external_system" |
60 | 504 | | "get_graph_layout" |
61 | 480 | | "get_quality_attribute" |
62 | 456 | | "get_skill" |
63 | 432 | | "get_spec" |
64 | 408 | | "get_store" |
65 | 384 | | "get_task" |
66 | 360 | | "get_working_context" |
67 | 336 | | "list_actors" |
68 | 312 | | "list_components" |
69 | 288 | | "list_containers" |
70 | 264 | | "list_external_systems" |
71 | 240 | | "list_quality_attributes" |
72 | 216 | | "list_skills" |
73 | 192 | | "list_specs" |
74 | 168 | | "list_tasks" |
75 | 480 | | "list_stores"144 => Some(Project(ReadProject)), |
76 | 120 | "create_rule" => Some(Org(WriteOrg))24 , |
77 | 96 | "delete_rule" | "get_rules"72 => Some(Org(AdminOrg))48 , |
78 | 48 | "create_project_architecture" | "get_project_info"24 => Some(Org(ReadOrg)), |
79 | 0 | _ => None, |
80 | | } |
81 | 1.60k | } |