"""REST bindings; operations also serve the MCP interface.""" from fastapi import APIRouter, Depends from application import firewall as operations app = APIRouter() startup = operations.startup shutdown = operations.shutdown reset = operations.reset # Keep existing imports working while there is only one owner of managers and state. def __getattr__(name): return getattr(operations, name) app.get('/settings', response_model=operations.FirewallSettings)(operations.get_settings) app.put('/settings', response_model=operations.StatusMessageModel)(operations.set_settings) app.get('/rules', response_model=operations.RuleInfo)(operations.get_rule_list) app.post('/enable', response_model=operations.StatusMessageModel)(operations.enable_firewall) app.post('/disable', response_model=operations.StatusMessageModel)(operations.disable_firewall) app.post('/rules', response_model=operations.StatusMessageModel)(operations.add_new_service)