fix: agent permission erlaubt /api/v1/agent/register (BSD Agent braucht das zum Start)

This commit is contained in:
cynfo3000 2026-03-10 00:15:17 +01:00
parent 97eefcde5d
commit ebd8f1ebb8

View File

@ -129,8 +129,10 @@ func hasAPIKeyPermission(key *db.APIKey, r *http.Request) bool {
switch perm {
case "agent":
// Nur Agent-Endpunkte: WS-Connect und Heartbeat
return path == "/api/v1/agent/ws" || path == "/api/v1/agent/heartbeat"
// Nur Agent-Endpunkte: Registrierung, WS-Connect, Heartbeat
return path == "/api/v1/agent/ws" ||
path == "/api/v1/agent/heartbeat" ||
path == "/api/v1/agent/register"
case "read":
// Nur GET-Requests, keine destruktiven Aktionen