Структура, доп модули, федерация, документация
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Knot.Shared.Kernel;
|
||||
|
||||
namespace Knot.Modules.Federation.Application.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// Шлюз для безопасной передачи данных между серверами Knot Messager.
|
||||
/// </summary>
|
||||
public interface IFederationGateway
|
||||
{
|
||||
/// <summary>
|
||||
/// Отправляет пакет на конкретный домен.
|
||||
/// </summary>
|
||||
Task<Result> SendPacketAsync(FederationMessagePacket packet, string targetDomain, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Федеративный пакет сообщения с гибридным шифрованием.
|
||||
/// </summary>
|
||||
public record FederationMessagePacket(
|
||||
string SenderDomain,
|
||||
string RecipientDomain,
|
||||
string EncryptedPayload, // AES-256
|
||||
string EncryptedIV, // RSA-Encrypted for Recipient
|
||||
string Signature, // RSA-Signed by Sender
|
||||
FederationMetadata Metadata
|
||||
);
|
||||
|
||||
public record FederationMetadata(
|
||||
Guid ChatId,
|
||||
Guid SenderId,
|
||||
string SenderUsername,
|
||||
string MessageType,
|
||||
DateTime CreatedAt,
|
||||
Guid UserId = default // ID пользователя-исполнителя (для реакций и т.д.)
|
||||
);
|
||||
Reference in New Issue
Block a user