Структура, доп модули, федерация, документация

This commit is contained in:
Халимов Рустам
2026-03-27 00:55:01 +03:00
parent 7cb6ac61dd
commit 7ef73b414c
64 changed files with 3080 additions and 133 deletions

View File

@@ -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 пользователя-исполнителя (для реакций и т.д.)
);