namespace ZB.MOM.WW.Secrets.Abstractions;

/// <summary>
/// Publishes an encrypted row to cluster peers. Core registers a no-op implementation;
/// <c>ZB.MOM.WW.Secrets.Replication.Akka</c> (peer-to-peer over the cluster) and
/// <c>ZB.MOM.WW.Secrets.Replication.SqlServer</c> (via a shared hub database) provide the real ones.
/// </summary>
public interface ISecretReplicator
{
    /// <summary>
    /// Broadcasts the already-encrypted <paramref name="row"/> to peer nodes. This is a no-op
    /// in single-node deployments.
    /// </summary>
    /// <param name="row">The encrypted row to replicate.</param>
    /// <param name="ct">A token to cancel the operation.</param>
    /// <returns>A task that completes when the row has been published.</returns>
    Task PublishAsync(StoredSecret row, CancellationToken ct);
}
