feat(server): store inventory and handle ReportInventory RPC
Server Deploy / deploy (push) Successful in 1m4s

This commit is contained in:
2026-07-21 14:05:19 +01:00
parent 03e2c3c50d
commit a28157dcf8
4 changed files with 63 additions and 1429 deletions
+11
View File
@@ -95,6 +95,17 @@ func (s *vantageServer) ReportUpdates(ctx context.Context, req *pb.ReportUpdates
return &pb.ReportUpdatesResponse{}, nil
}
func (s *vantageServer) ReportInventory(ctx context.Context, req *pb.InventoryReport) (*pb.InventoryReportResponse, error) {
srv, err := services.ValidateAgentToken(req.ServerId, req.AgentToken)
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "invalid agent token")
}
if err := services.StoreInventory(srv.ServerID, req); err != nil {
log.Printf("store inventory for %s: %v", srv.ServerID, err)
}
return &pb.InventoryReportResponse{}, nil
}
func (s *vantageServer) CommandStream(stream pb.Vantage_CommandStreamServer) error {
// First message authenticates the agent and signals readiness.
msg, err := stream.Recv()