🐛 Refactor: Consolidated user management and security functions in the backend. Added legal pages blueprint for compliance. Removed legacy rate limiter functions to streamline security integration. Updated logging for better clarity. 📚

This commit is contained in:
2025-06-12 20:44:11 +02:00
parent 69fd3187cf
commit 6b8fca218b
19 changed files with 698 additions and 3639 deletions

View File

@@ -391,7 +391,6 @@ from utils.utilities_collection import SECRET_KEY, SESSION_LIFETIME
# Blueprints importieren
from blueprints.auth import auth_blueprint
# from blueprints.user import user_blueprint # Konsolidiert in user_management
from blueprints.admin_unified import admin_blueprint, admin_api_blueprint
from blueprints.guest import guest_blueprint
from blueprints.calendar import calendar_blueprint
@@ -403,16 +402,10 @@ from blueprints.uploads import uploads_blueprint
from blueprints.sessions import sessions_blueprint
from blueprints.tapo_control import tapo_blueprint # Tapo-Steckdosen-Steuerung
from blueprints.api import api_blueprint # API-Endpunkte mit Session-Management
from blueprints.legal_pages import legal_bp # Rechtliche Seiten (Impressum, Datenschutz, etc.)
# Import der Sicherheits- und Hilfssysteme
from utils.security_suite import init_security
# Legacy rate_limiter and permissions functions - integrated into security_suite
def cleanup_rate_limiter():
pass # Simplified - no longer needed with consolidated security
def init_permission_helpers(app):
# Integrated into init_security
return app
# Logging initialisieren
setup_logging()
@@ -682,6 +675,7 @@ app.register_blueprint(uploads_blueprint)
app.register_blueprint(sessions_blueprint)
app.register_blueprint(tapo_blueprint) # Tapo-Steckdosen-Steuerung
app.register_blueprint(api_blueprint) # Einfache API-Endpunkte
app.register_blueprint(legal_bp) # Rechtliche Seiten (Impressum, Datenschutz, etc.)
# Energiemonitoring-Blueprints registrieren
from blueprints.energy_monitoring import energy_blueprint, energy_api_blueprint
@@ -690,7 +684,6 @@ app.register_blueprint(energy_api_blueprint) # API-Endpunkte für Energiedaten
# ===== HILFSSYSTEME INITIALISIEREN =====
init_security(app)
init_permission_helpers(app)
# ===== KONTEXT-PROZESSOREN =====
@app.context_processor
@@ -1387,8 +1380,6 @@ def main():
scheduler.shutdown()
app_logger.info("[SHUTDOWN] ✅ Job Scheduler gestoppt")
# Rate Limiter cleanup
cleanup_rate_limiter()
app_logger.info("[SHUTDOWN] ✅ Rate Limiter bereinigt")
# Caches leeren