|
15 | 15 | from sqlalchemy.orm import Session |
16 | 16 | from app.services.redis import get_redis_client |
17 | 17 |
|
18 | | -# see: https://fastapi.tiangolo.com/tutorial/security/oauth2-jwt/ |
19 | | -# see: https://fastapi.tiangolo.com/advanced/security/ |
20 | | - |
21 | 18 |
|
22 | 19 | class Token(BaseModel): |
23 | 20 | access_token: str |
@@ -124,6 +121,29 @@ class TokenData(BaseModel): |
124 | 121 | "hunts:run": "Run hunts.", |
125 | 122 | "notifications:read": "Read notifications.", |
126 | 123 | "notifications:update": "Update notifications.", |
| 124 | + "mcp:list_tools": "List MCP tools.", |
| 125 | + "mcp:list_resources": "List MCP resources.", |
| 126 | + "mcp:list_prompts": "List MCP prompts.", |
| 127 | + "mcp:search_events": "Search events via MCP.", |
| 128 | + "mcp:search_attributes": "Search attributes via MCP.", |
| 129 | + "mcp:get_event": "Get event details via MCP.", |
| 130 | + "mcp:get_correlations": "Get correlations via MCP.", |
| 131 | + "mcp:detect_indicator_type": "Detect indicator types via MCP.", |
| 132 | + "mcp:get_statistics": "Get statistics via MCP.", |
| 133 | + "mcp:get_tags": "List tags via MCP.", |
| 134 | + "mcp:get_index_mapping": "Get index mappings via MCP.", |
| 135 | + "mcp:search_galaxy": "Search galaxy clusters via MCP.", |
| 136 | + "mcp:search_taxonomy": "Search taxonomies via MCP.", |
| 137 | + "mcp:get_sightings": "Get sightings via MCP.", |
| 138 | + "mcp:list_hunts": "List hunts via MCP.", |
| 139 | + "mcp:get_hunt_results": "Get hunt results via MCP.", |
| 140 | + "mcp:run_hunt": "Run hunts via MCP.", |
| 141 | + "mcp:config": "Generate an MCP client configuration token.", |
| 142 | + "mcp:get_event_reports": "Get event reports via MCP.", |
| 143 | + "mcp:search_event_reports": "Search event reports via MCP.", |
| 144 | + "mcp:create_event_report": "Create event reports via MCP.", |
| 145 | + "mcp:get_notifications": "Get user notifications via MCP.", |
| 146 | + "mcp:list_modules": "List enrichment modules via MCP.", |
127 | 147 | }, |
128 | 148 | ) |
129 | 149 |
|
@@ -226,6 +246,7 @@ def get_scopes_for_user(user: user_schemas.User): |
226 | 246 | scopes.add("settings:*") |
227 | 247 | scopes.add("hunts:*") |
228 | 248 | scopes.add("notifications:*") |
| 249 | + scopes.add("mcp:*") |
229 | 250 |
|
230 | 251 | if user.role.perm_auth: |
231 | 252 | scopes.add("auth:login") |
|
0 commit comments