fix: resolve CLI serialization failures and add README

Two Akka.NET deserialization bugs prevented CLI commands from reaching ManagementActor: IReadOnlyList<string> in AuthenticatedUser serialized as a compiler-generated internal type unknown to the server, and ManagementSuccess.Data carried server-side assembly types the CLI couldn't resolve on receipt. Fixed by using string[] for roles and pre-serializing response data to JSON in ManagementActor before sending. Adds full CLI reference documentation covering all 10 command groups.
This commit is contained in:
Joseph Doherty
2026-03-17 18:17:47 -04:00
parent 40f74e4a42
commit eea50014de
4 changed files with 566 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
using System.Security.Cryptography;
using Akka.Actor;
using Newtonsoft.Json;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using ScadaLink.Commons.Entities.ExternalSystems;
@@ -56,7 +57,8 @@ public class ManagementActor : ReceiveActor
try
{
var result = await DispatchCommand(scope.ServiceProvider, envelope.Command, user.Username);
sender.Tell(new ManagementSuccess(correlationId, result));
var json = JsonConvert.SerializeObject(result, Formatting.None);
sender.Tell(new ManagementSuccess(correlationId, json));
}
catch (Exception ex)
{