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:
@@ -18,7 +18,6 @@ internal static class CommandHelpers
|
||||
object command)
|
||||
{
|
||||
var contactPointsRaw = result.GetValue(contactPointsOption);
|
||||
var format = result.GetValue(formatOption) ?? "json";
|
||||
|
||||
if (string.IsNullOrWhiteSpace(contactPointsRaw))
|
||||
{
|
||||
@@ -41,18 +40,15 @@ internal static class CommandHelpers
|
||||
var envelope = new ManagementEnvelope(PlaceholderUser, command, NewCorrelationId());
|
||||
var response = await connection.AskManagementAsync(envelope, TimeSpan.FromSeconds(30));
|
||||
|
||||
return HandleResponse(response, format);
|
||||
return HandleResponse(response);
|
||||
}
|
||||
|
||||
internal static int HandleResponse(object response, string format)
|
||||
internal static int HandleResponse(object response)
|
||||
{
|
||||
switch (response)
|
||||
{
|
||||
case ManagementSuccess success:
|
||||
if (format == "table")
|
||||
WriteAsTable(success.Data);
|
||||
else
|
||||
OutputFormatter.WriteJson(success.Data);
|
||||
Console.WriteLine(success.JsonData);
|
||||
return 0;
|
||||
|
||||
case ManagementError error:
|
||||
@@ -68,10 +64,4 @@ internal static class CommandHelpers
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
private static void WriteAsTable(object? data)
|
||||
{
|
||||
// For table format, delegate to JSON if data shape is unknown
|
||||
OutputFormatter.WriteJson(data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user