feat: Agent zeigt Warnung wenn er nicht den Kunden-Key nutzt
- last_api_key Spalte in agents, wird bei Heartbeat gesetzt - GetAgentsByCustomer liefert last_api_key mit - Frontend: rot + Warnsymbol wenn Key abweicht vom Kunden-Agent-Key - Grau wenn noch kein Heartbeat mit Key-Info
This commit is contained in:
@@ -252,6 +252,11 @@ func (h *Handler) heartbeat(w http.ResponseWriter, r *http.Request) {
|
||||
h.db.UpdateAgentVersion(req.AgentID, req.AgentVersion)
|
||||
}
|
||||
|
||||
// Genutzten API-Key speichern (aus Middleware-Kontext)
|
||||
if keyInfo := GetAPIKeyFromContext(r); keyInfo != nil {
|
||||
h.db.UpdateAgentAPIKey(req.AgentID, keyInfo.Key)
|
||||
}
|
||||
|
||||
if err := h.db.SaveSystemData(req.AgentID, &req.SystemData); err != nil {
|
||||
if strings.Contains(err.Error(), "nicht gefunden") {
|
||||
writeError(w, http.StatusNotFound, "Agent nicht gefunden")
|
||||
|
||||
Reference in New Issue
Block a user