Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e3c0503a4f | |||
| a0527f9b5a |
@@ -9,7 +9,8 @@ runtime dependency** — `aahClientManaged.dll` / `aahClient.dll` are not refere
|
||||
The library runs on any OS for offline/unit testing; live WCF transports require Windows.
|
||||
|
||||
**Status: ported and rebranded into this repo; builds and 191 tests pass on macOS. Version 0.1.0.
|
||||
NOT yet packed/published to any NuGet feed. NOT yet adopted by any consumer.**
|
||||
The `RemoteGrpc` (2023 R2) read path is live-verified (2026-06-19). NOT yet packed/published to any
|
||||
NuGet feed beyond the local `artifacts/` nupkg. NOT yet adopted by any consumer.**
|
||||
|
||||
---
|
||||
|
||||
@@ -52,7 +53,7 @@ Configured via `HistorianClientOptions.Transport` (`HistorianTransport` enum).
|
||||
| `LocalPipe` | WCF/MDAS over Net.NamedPipe (local) | Windows-only | live-verified (read / browse / metadata / event / status) |
|
||||
| `RemoteTcpIntegrated` | WCF/MDAS over Net.TCP + Windows transport auth | Windows-only | live-verified (full read / browse / metadata / event / status surface) |
|
||||
| `RemoteTcpCertificate` | WCF/MDAS over Net.TCP + server-cert TLS | Windows-only | `ProbeAsync` live-verified; deeper coverage pending |
|
||||
| `RemoteGrpc` | gRPC (2023 R2), Grpc.Net.Client/.Web | cross-platform | unit-tested; NOT yet live-verified against a real 2023 R2 server (`ExchangeKey` auth step is unproven) |
|
||||
| `RemoteGrpc` | gRPC (2023 R2), Grpc.Net.Client/.Web | cross-platform | **live-verified 2026-06-19** against a 2023 R2 server — TLS + `StorageService.ValidateClientCredential` NTLM handshake + raw read returning correct values |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ services.AddZbSpHistorianClient(
|
||||
| `LocalPipe` | WCF/MDAS over Net.NamedPipe | Windows-only | live-verified |
|
||||
| `RemoteTcpIntegrated` | WCF/MDAS over Net.TCP + Windows auth | Windows-only | live-verified |
|
||||
| `RemoteTcpCertificate` | WCF/MDAS over Net.TCP + TLS | Windows-only | `ProbeAsync` live-verified; deeper coverage pending |
|
||||
| `RemoteGrpc` | gRPC (2023 R2) | cross-platform | unit-tested; live verification pending |
|
||||
| `RemoteGrpc` | gRPC (2023 R2) | cross-platform | live-verified 2026-06-19 |
|
||||
|
||||
---
|
||||
|
||||
|
||||
+13
-9
@@ -5,6 +5,7 @@ using ZB.MOM.WW.SPHistorianClient.Models;
|
||||
using ZB.MOM.WW.SPHistorianClient.Wcf;
|
||||
using GrpcHistory = ArchestrA.Grpc.Contract.History;
|
||||
using GrpcRetrieval = ArchestrA.Grpc.Contract.Retrieval;
|
||||
using GrpcStorage = ArchestrA.Grpc.Contract.Storage;
|
||||
|
||||
namespace ZB.MOM.WW.SPHistorianClient.Grpc;
|
||||
|
||||
@@ -16,17 +17,19 @@ namespace ZB.MOM.WW.SPHistorianClient.Grpc;
|
||||
///
|
||||
/// Operation mapping (2020 WCF → 2023 R2 gRPC):
|
||||
/// Hist.GetInterfaceVersion → HistoryService.GetInterfaceVersion
|
||||
/// Hist.ValidateClientCredential (loop) → HistoryService.ExchangeKey (loop)
|
||||
/// Hist.ValidateClientCredential (loop) → StorageService.ValidateClientCredential (loop)
|
||||
/// Hist.OpenConnection2 → HistoryService.OpenConnection
|
||||
/// Retr.StartQuery2 → RetrievalService.StartQuery
|
||||
/// Retr.GetNextQueryResultBuffer2 (loop) → RetrievalService.GetNextQueryResultBuffer (loop)
|
||||
/// Retr.EndQuery2 → RetrievalService.EndQuery
|
||||
///
|
||||
/// NOTE: not yet live-verified against a 2023 R2 server. The auth handshake uses
|
||||
/// HistoryService.ExchangeKey because the gRPC HistoryService dropped ValidateClientCredential
|
||||
/// (it now lives only on StorageService) and gained ExchangeKey with the identical
|
||||
/// handle+token→token shape. If a live server rejects this, the handshake op is the first thing
|
||||
/// to revisit — everything else is the proven 2020 byte protocol.
|
||||
/// AUTH: the SSPI/Negotiate token loop runs through StorageService.ValidateClientCredential
|
||||
/// (Handle + InBuff → Status + OutBuff) — per the 2023 R2 contract analysis, that op carries the
|
||||
/// NTLM/SSPI tokens (the field names inBuff/outBuff match the 2020 native contract), whereas
|
||||
/// HistoryService.ExchangeKey is a separate key-exchange/cert op (NOT the credential handshake).
|
||||
/// OpenConnection and the retrieval chain stay on their original services; the server correlates
|
||||
/// the validated context by the handshake GUID handle. Live-verified 2026-06-19 against a 2023 R2
|
||||
/// server (wonder-sql-vd03) — earlier ExchangeKey wiring was rejected at token round 0.
|
||||
/// </summary>
|
||||
internal sealed class HistorianGrpcReadOrchestrator
|
||||
{
|
||||
@@ -162,18 +165,19 @@ internal sealed class HistorianGrpcReadOrchestrator
|
||||
{
|
||||
Guid contextKey = Guid.NewGuid();
|
||||
var historyClient = new GrpcHistory.HistoryService.HistoryServiceClient(connection.Channel);
|
||||
var storageClient = new GrpcStorage.StorageService.StorageServiceClient(connection.Channel);
|
||||
|
||||
historyClient.GetInterfaceVersion(new GrpcHistory.GetInterfaceVersionRequest(), connection.Metadata, Deadline(), cancellationToken);
|
||||
|
||||
HistorianNativeHandshake.RunTokenRounds(
|
||||
(handle, wrapped, _) =>
|
||||
{
|
||||
GrpcHistory.ExchangeKeyResponse response = historyClient.ExchangeKey(
|
||||
new GrpcHistory.ExchangeKeyRequest { StrHandle = handle, BtInput = ByteString.CopyFrom(wrapped) },
|
||||
GrpcStorage.ValidateClientCredentialResponse response = storageClient.ValidateClientCredential(
|
||||
new GrpcStorage.ValidateClientCredentialRequest { Handle = handle, InBuff = ByteString.CopyFrom(wrapped) },
|
||||
connection.Metadata,
|
||||
Deadline(),
|
||||
cancellationToken);
|
||||
byte[] serverOutput = response.BtOutput?.ToByteArray() ?? [];
|
||||
byte[] serverOutput = response.OutBuff?.ToByteArray() ?? [];
|
||||
byte[] error = response.Status?.BtError?.ToByteArray() ?? [];
|
||||
bool success = response.Status?.BSuccess ?? false;
|
||||
return new HistorianNativeHandshake.TokenExchangeResult(success, serverOutput, error);
|
||||
|
||||
Reference in New Issue
Block a user