feat: admin enrollment controls and prune scheduler

This commit is contained in:
2025-10-17 17:43:14 -06:00
parent a72bff5e8e
commit f63d5c4f83
6 changed files with 352 additions and 0 deletions

View File

@@ -58,6 +58,8 @@ from Modules.crypto import certificates, signing
from Modules.enrollment import routes as enrollment_routes
from Modules.enrollment.nonce_store import NonceCache
from Modules.tokens import routes as token_routes
from Modules.admin import routes as admin_routes
from Modules.jobs.prune import start_prune_job
try:
from cryptography.fernet import Fernet # type: ignore
@@ -4866,6 +4868,20 @@ agent_routes.register(
script_signer=SCRIPT_SIGNER,
)
admin_routes.register(
app,
db_conn_factory=_db_conn,
require_admin=_require_admin,
current_user=_current_user,
log=_write_service_log,
)
start_prune_job(
socketio,
db_conn_factory=_db_conn,
log=_write_service_log,
)
def ensure_default_admin():
"""Ensure at least one admin user exists.