using ZB.MOM.WW.Secrets.Abstractions;
namespace ZB.MOM.WW.Secrets.Replicator.SqlServer;
///
/// Publishes local writes to the shared SQL-Server hub, so a secret written on one node is
/// immediately visible to every other node that syncs against the same hub.
///
///
/// The row is written through , not
/// — the hub must record the row verbatim, keeping
/// the originating node's revision and updated_utc. An upsert would stamp the hub's own
/// revision and timestamp, and the row would then look newer than the writer's own copy, so it
/// would bounce straight back on the next sync.
///
/// The shared hub store.
public sealed class SqlServerSecretReplicator(ISecretReplicationHub hub) : ISecretReplicator
{
///
public Task PublishAsync(StoredSecret row, CancellationToken ct)
{
ArgumentNullException.ThrowIfNull(row);
return hub.ApplyReplicatedAsync(row, ct);
}
}